Browse Source

Added setup.py and rules for using it in the Makefile

dstromberg 13 years ago
parent
commit
b77b4c8f6a
2 changed files with 48 additions and 4 deletions
  1. 13 4
      Makefile
  2. 35 0
      setup.py

+ 13 - 4
Makefile

@@ -1,17 +1,17 @@
 
 go: performance-graph.pdf
-	#xpdf performance-graph.pdf
+	xpdf performance-graph.pdf
 
 performance-graph.pdf: performance-numbers.db gen-performance-graph
-	#./gen-performance-graph
+	./gen-performance-graph
 
 .PRECIOUS: performance-numbers.db
 
 performance-numbers.db: test-bloom-filter
 	./this-pylint bloom_filter_mod.py test-bloom-filter
 	rm -f seek.txt array.txt hybrid.txt mmap.txt
-	/usr/local/pypy-1.7/bin/pypy ./test-bloom-filter
-	/usr/local/cpython-3.2/bin/python ./test-bloom-filter
+	#/usr/local/pypy-1.7/bin/pypy ./test-bloom-filter --performance-test
+	/usr/bin/python ./test-bloom-filter --performance-test
 	#/usr/local/cpython-3.2/bin/python ./test-bloom-filter
 	#/usr/local/cpython-2.5/bin/python ./test-bloom-filter
 	#/usr/local/cpython-2.7/bin/python ./test-bloom-filter
@@ -24,7 +24,16 @@ clean:
 	rm -f bloom-filter-rm-me
 	rm -f *.ps *.pdf
 	rm -f seek.txt array.txt
+	rm -rf dist build drs_bloom_filter.egg-info
 
 veryclean: clean
 	rm -f performance-numbers.db
 	
+register:
+	# Once
+	python setup.py register
+	
+publish:
+	# Each new version
+	python setup.py sdist upload
+

+ 35 - 0
setup.py

@@ -0,0 +1,35 @@
+
+from setuptools import setup, find_packages
+setup(
+    name = "drs-bloom-filter",
+    version = "1.0",
+    packages = find_packages(),
+    scripts = ['bloom_filter_mod.py', 'python2x3.py' ],
+
+    # metadata for upload to PyPI
+    author = "Daniel Richard Stromberg",
+    author_email = "strombrg@gmail.com",
+    description='Pure Python Bloom Filter module',
+    long_description='''
+A pure python bloom filter (low storage requirement, probabilistic
+set datastructure) is provided.  It is known to work on CPython 2.x,
+CPython 3.x, Pypy and Jython.
+
+Includes mmap, in-memory and disk-seek backends.
+
+The user specifies the desired maximum number of elements and the
+desired maximum false positive probability, and the module
+calculates the rest.
+''',
+    license = "MIT",
+    keywords = "probabilistic set datastructure",
+	 url='http://stromberg.dnsalias.org/~strombrg/drs-bloom-filter/',
+	 platforms='Cross platform',
+	 classifiers=[
+		 "Development Status :: 5 - Production/Stable",
+		 "Intended Audience :: Developers",
+		 "Programming Language :: Python :: 2",
+		 "Programming Language :: Python :: 3",
+		 ],
+)
+