Commit 1a40a7e1 authored by Jason Madden's avatar Jason Madden

Use zodbpickle under pypy and 2.7 for a working noload. Also add pypy to tox...

Use zodbpickle under pypy and 2.7 for a working noload. Also add pypy to tox so I can start testing it.
parent 5b28e80a
...@@ -23,6 +23,7 @@ interface, rich transaction support, and undo. ...@@ -23,6 +23,7 @@ interface, rich transaction support, and undo.
VERSION = "4.1.0" VERSION = "4.1.0"
import os import os
import platform
import sys import sys
from setuptools import setup, find_packages from setuptools import setup, find_packages
...@@ -35,6 +36,10 @@ if (3,) < sys.version_info < (3, 2): ...@@ -35,6 +36,10 @@ if (3,) < sys.version_info < (3, 2):
sys.exit(0) sys.exit(0)
PY3 = sys.version_info >= (3,) PY3 = sys.version_info >= (3,)
PY27 = sys.version_info >= (2,7)
py_impl = getattr(platform, 'python_implementation', lambda: None)
PYPY = py_impl() == 'PyPy'
# The (non-obvious!) choices for the Trove Development Status line: # The (non-obvious!) choices for the Trove Development Status line:
# Development Status :: 5 - Production/Stable # Development Status :: 5 - Production/Stable
...@@ -154,14 +159,14 @@ setup(name="ZODB", ...@@ -154,14 +159,14 @@ setup(name="ZODB",
extras_require = dict(test=tests_require), extras_require = dict(test=tests_require),
install_requires = [ install_requires = [
'persistent', 'persistent',
'BTrees', 'BTrees >= 4.1.2',
'ZConfig', 'ZConfig',
'transaction >= 1.4.1' if PY3 else 'transaction', 'transaction >= 1.4.1' if PY3 else 'transaction',
'six', 'six',
'zc.lockfile', 'zc.lockfile',
'zdaemon >= 4.0.0a1', 'zdaemon >= 4.0.0a1',
'zope.interface', 'zope.interface',
] + (['zodbpickle >= 0.2'] if PY3 else []), ] + (['zodbpickle >= 0.6.0'] if (PY3 or PY27 or PYPY) else []),
zip_safe = False, zip_safe = False,
entry_points = """ entry_points = """
[console_scripts] [console_scripts]
......
...@@ -11,15 +11,24 @@ ...@@ -11,15 +11,24 @@
# FOR A PARTICULAR PURPOSE # FOR A PARTICULAR PURPOSE
# #
############################################################################## ##############################################################################
import sys
try: try:
# Python 2.x # Python 2.x
from cPickle import Pickler import cPickle
from cPickle import Unpickler if not hasattr(cPickle.Unpickler, 'noload') or sys.version_info >= (2,7):
from cPickle import dump # PyPy doesn't have noload, and noload is broken in Python 2.7.
from cPickle import dumps # Get the fastest version we can (PyPy has no fastpickle)
from cPickle import loads try:
from cPickle import HIGHEST_PROTOCOL import zodbpickle.fastpickle as cPickle
except ImportError:
import zodbpickle.pickle as cPickle
Pickler = cPickle.Pickler
Unpickler = cPickle.Unpickler
dump = cPickle.dump
dumps = cPickle.dumps
loads = cPickle.loads
HIGHEST_PROTOCOL = cPickle.HIGHEST_PROTOCOL
IMPORT_MAPPING = {} IMPORT_MAPPING = {}
NAME_MAPPING = {} NAME_MAPPING = {}
_protocol = 1 _protocol = 1
......
[tox] [tox]
envlist = py26,py27,py32,py33,py34,simple envlist = py26,py27,py32,py33,py34,pypy,simple
[testenv] [testenv]
commands = commands =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment