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.
VERSION = "4.1.0"
import os
import platform
import sys
from setuptools import setup, find_packages
......@@ -35,6 +36,10 @@ if (3,) < sys.version_info < (3, 2):
sys.exit(0)
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:
# Development Status :: 5 - Production/Stable
......@@ -154,14 +159,14 @@ setup(name="ZODB",
extras_require = dict(test=tests_require),
install_requires = [
'persistent',
'BTrees',
'BTrees >= 4.1.2',
'ZConfig',
'transaction >= 1.4.1' if PY3 else 'transaction',
'six',
'zc.lockfile',
'zdaemon >= 4.0.0a1',
'zope.interface',
] + (['zodbpickle >= 0.2'] if PY3 else []),
] + (['zodbpickle >= 0.6.0'] if (PY3 or PY27 or PYPY) else []),
zip_safe = False,
entry_points = """
[console_scripts]
......
......@@ -11,15 +11,24 @@
# FOR A PARTICULAR PURPOSE
#
##############################################################################
import sys
try:
# Python 2.x
from cPickle import Pickler
from cPickle import Unpickler
from cPickle import dump
from cPickle import dumps
from cPickle import loads
from cPickle import HIGHEST_PROTOCOL
import cPickle
if not hasattr(cPickle.Unpickler, 'noload') or sys.version_info >= (2,7):
# PyPy doesn't have noload, and noload is broken in Python 2.7.
# Get the fastest version we can (PyPy has no fastpickle)
try:
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 = {}
NAME_MAPPING = {}
_protocol = 1
......
[tox]
envlist = py26,py27,py32,py33,py34,simple
envlist = py26,py27,py32,py33,py34,pypy,simple
[testenv]
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