Skip to content

Commit

Permalink
Merge pull request #42 from NextThought/zodbpickle-required
Browse files Browse the repository at this point in the history
Make zodbpickle non-optional.
  • Loading branch information
mgedmin committed Nov 7, 2015
2 parents e76c5b0 + 3ea2015 commit 5e82e6d
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -9,7 +9,7 @@ python:
- 3.3
- 3.4
install:
- travis_retry pip install BTrees ZConfig manuel persistent six transaction zc.lockfile zdaemon zope.interface zope.testing zope.testrunner
- travis_retry pip install BTrees ZConfig manuel persistent six transaction zc.lockfile zdaemon zodbpickle zope.interface zope.testing zope.testrunner
- travis_retry pip install -e .
script:
- zope-testrunner -u --test-path=src --auto-color --auto-progress
Expand Down
5 changes: 4 additions & 1 deletion CHANGES.rst
Expand Up @@ -5,7 +5,10 @@
4.2.1 (unreleased)
==================

- TBD
- Make the ``zodbpickle`` dependency required and not conditional.
This fixes various packaging issues involving pip and its wheel
cache. zodbpickle was only optional under Python 2.6 so this change
only impacts users of that version.

4.2.0 (2015-06-02)
==================
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -153,7 +153,6 @@ def read_file(*path):
tests_require = tests_require,
extras_require = {
'test': tests_require,
':python_version != "2.6"': ['zodbpickle >= 0.6.0'],
},
install_requires = [
'persistent >= 4.1.0',
Expand All @@ -164,6 +163,7 @@ def read_file(*path):
'zc.lockfile',
'zdaemon >= 4.0.0a1',
'zope.interface',
'zodbpickle >= 0.6.0',
],
zip_safe = False,
entry_points = """
Expand Down
22 changes: 11 additions & 11 deletions src/ZODB/_compat.py
Expand Up @@ -12,20 +12,20 @@
#
##############################################################################
import sys
from six import PY3

IS_JYTHON = sys.platform.startswith('java')

try:

if not PY3:
# Python 2.x
import cPickle
if ((hasattr(cPickle.Unpickler, 'load') and 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
# PyPy's cPickle doesn't have noload, and noload is broken in Python 2.7,
# so we need zodbpickle.
# Get the fastest working 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
Expand All @@ -36,7 +36,7 @@
NAME_MAPPING = {}
_protocol = 1
FILESTORAGE_MAGIC = b"FS21"
except ImportError:
else:
# Python 3.x: can't use stdlib's pickle because
# http://bugs.python.org/issue6784
import zodbpickle.pickle
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Expand Up @@ -20,6 +20,7 @@ deps =
transaction
zc.lockfile
zdaemon
zodbpickle
zope.interface
zope.testing
zope.testrunner >= 4.4.6
Expand Down

0 comments on commit 5e82e6d

Please sign in to comment.