Permalink
Browse files

Fixed tests.

  • Loading branch information...
1 parent f1dbe6e commit 073e12d6e7cfaee7464d6df56d6a35fa292ee075 @axiak committed Jan 5, 2012
View
@@ -8,3 +8,4 @@ MANIFEST
/lib
*.egg-info
*~
+*pyc
View
@@ -1,7 +1,6 @@
include CHANGELOG
include LICENSE
include AUTHORS
-include README
-recursive-include *.py
+include README.markdown
recursive-include src *
recursive-include tests *
View
@@ -10,7 +10,7 @@ BloomFilter Class Reference
.. moduleauthor:: Michael Axiak <mike@axiak.net>
-.. class:: BloomFilter(capacity : int, error_rate : float, filename : string)
+.. class:: BloomFilter(capacity : int, error_rate : float, [filename=None : string], [perm=0755])
Create a new BloomFilter object with a given capacity and error_rate.
**Note that we do not check capacity.** This is important, because
@@ -19,9 +19,6 @@ BloomFilter Class Reference
less than capacity items, and the Bloom Filter will have an error rate
less than error_rate.
- **NEW**: If you specify ``None`` for the filename, then the bloom filter
- will be backed by malloc'd memory, rather than by a file.
-
Static Methods
------------------
@@ -0,0 +1,11 @@
+K 25
+svn:wc:ra_dav:version-url
+V 47
+/svn/!svn/ver/46219/lxml/trunk/fake_pyrex/Pyrex
+END
+__init__.py
+K 25
+svn:wc:ra_dav:version-url
+V 59
+/svn/!svn/ver/46219/lxml/trunk/fake_pyrex/Pyrex/__init__.py
+END
@@ -0,0 +1,65 @@
+10
+
+dir
+80414
+http://codespeak.net/svn/lxml/trunk/fake_pyrex/Pyrex
+http://codespeak.net/svn
+
+
+
+2007-08-31T17:01:53.941550Z
+46219
+scoder
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+fd0d7bf2-dfb6-0310-8d31-b7ecfe96aada
+
+Distutils
+dir
+
+__init__.py
+file
+
+
+
+
+2012-01-04T20:10:47.429233Z
+8213a7cbff30b82637a6a31ea1b8e4c1
+2007-08-31T17:01:53.941550Z
+46219
+scoder
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+48
+
@@ -0,0 +1 @@
+# work around broken setuptools monkey patching
@@ -0,0 +1,17 @@
+K 25
+svn:wc:ra_dav:version-url
+V 57
+/svn/!svn/ver/46219/lxml/trunk/fake_pyrex/Pyrex/Distutils
+END
+__init__.py
+K 25
+svn:wc:ra_dav:version-url
+V 69
+/svn/!svn/ver/46219/lxml/trunk/fake_pyrex/Pyrex/Distutils/__init__.py
+END
+build_ext.py
+K 25
+svn:wc:ra_dav:version-url
+V 70
+/svn/!svn/ver/46219/lxml/trunk/fake_pyrex/Pyrex/Distutils/build_ext.py
+END
@@ -0,0 +1,96 @@
+10
+
+dir
+80414
+http://codespeak.net/svn/lxml/trunk/fake_pyrex/Pyrex/Distutils
+http://codespeak.net/svn
+
+
+
+2007-08-31T17:01:53.941550Z
+46219
+scoder
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+fd0d7bf2-dfb6-0310-8d31-b7ecfe96aada
+
+__init__.py
+file
+
+
+
+
+2012-01-04T20:10:47.421233Z
+8213a7cbff30b82637a6a31ea1b8e4c1
+2007-08-31T17:01:53.941550Z
+46219
+scoder
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+48
+
+build_ext.py
+file
+
+
+
+
+2012-01-04T20:10:47.421233Z
+708366fb576674605bad33ea1d8600f4
+2007-08-31T17:01:53.941550Z
+46219
+scoder
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+31
+
@@ -0,0 +1 @@
+# work around broken setuptools monkey patching
@@ -0,0 +1 @@
+build_ext = "yes, it's there!"
@@ -0,0 +1 @@
+# work around broken setuptools monkey patching
@@ -0,0 +1 @@
+build_ext = "yes, it's there!"
@@ -0,0 +1 @@
+# work around broken setuptools monkey patching
View
@@ -1,5 +1,7 @@
-from distutils.core import setup
-from distutils.extension import Extension
+import os
+import sys
+
+here = os.path.dirname(__file__)
ext_files = ["src/mmapbitarray.c",
"src/bloomfilter.c",
@@ -10,25 +12,51 @@
kwargs = {}
try:
+ import Cython
+ sys.path.insert(0, os.path.join(here, 'fake_pyrex'))
+except ImportError:
+ pass
+
+
+from setuptools import setup, Extension
+
+try:
from Cython.Distutils import build_ext
- print "Building from Cython"
+ print "info: Building from Cython"
ext_files.append("src/pybloomfilter.pyx")
kwargs['cmdclass'] = {'build_ext': build_ext}
+ try:
+ os.unlink(os.path.join(here, 'src', 'pybloomfilter.c'))
+ os.unlink(os.path.join(here, 'pybloomfilter.so'))
+ except:
+ pass
except ImportError:
+ if '--cython' in sys.argv:
+ raise
ext_files.append("src/pybloomfilter.c")
- print "Building from C"
+ print "info: Building from C"
+
+if '--cython' in sys.argv:
+ sys.argv.remove('--cython')
ext_modules = [Extension("pybloomfilter",
ext_files)]
+requirements = []
+
+if sys.version_info[0] < 3 and sys.version_info[1] < 7:
+ requirements.append('importlib')
+
setup(
name = 'pybloomfiltermmap',
- version = "0.3.2",
+ version = "0.3.4",
author = "Michael Axiak, Rob Stacey",
author_email = "mike@axiak.net",
url = "http://github.com/axiak/pybloomfiltermmap/",
description = "A Bloom filter (bloomfilter) for Python built on mmap",
license = "MIT License",
+ test_suite = 'tests.test_all',
+ install_requires=requirements,
ext_modules = ext_modules,
classifiers = [
'Intended Audience :: Developers',
@@ -40,4 +68,4 @@
],
**kwargs
)
-
+
View
@@ -167,7 +167,7 @@ uint32_t _hash_char(uint32_t hash_seed, Key * key) {
}
CODE TO USE SHA512..
-
+*/
#include <openssl/evp.h>
uint32_t _hash_char(uint32_t hash_seed, Key * key) {
@@ -184,7 +184,7 @@ uint32_t _hash_char(uint32_t hash_seed, Key * key) {
EVP_DigestFinal_ex(&ctx, &result_buffer, NULL);
return *(uint32_t *)result_buffer;
}
-
+/*
CODE TO USE md5sum
#include "md5.h"
@@ -199,13 +199,14 @@ uint32_t _hash_char(uint32_t hash_seed, Key * key) {
md5_finish(&state, result);
return *(uint32_t *)(&result[4]);
}
-*/
-/* Code for SuperFast */
+
+/* Code for SuperFast * /
#include "superfast.h"
uint32_t _hash_char(uint32_t hash_seed, Key * key) {
return SuperFastHash(key->shash, key->nhash, hash_seed);
}
+*/
#if 0
int main(int argc, char **argv)
Oops, something went wrong.

0 comments on commit 073e12d

Please sign in to comment.