-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python3 compatible imports #1
Conversation
rudaporto
commented
Oct 21, 2017
- Adjust Pickler and UnPickler imports to use ZODB._compat python 2 and… 3 compatible versions.
- Add conditional import for cStringIO also.
- Update setup.py to use direct ZODB package and not the ZODB3 meta package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar comment to zopefoundation/AccessControl#48: Python 3.4 remains supported by the Python community, why not here? Also, setup.py
needs to declare supported Python 3.x versions.
Hi @tseaver, I made the changes you requested. But I noted that there is four tests failing in this branch or in the master branch when using Plone buildout.coredev tag 5.2. Do you have any tip to help me fix this? $ ./bin/test -m Products.ZopeVersionControl Failure in test testDetectPersistentSubObjectChange (Products.ZopeVersionControl.tests.testVersionControl.VersionControlTests)
Failure in test testDetectPersistentSubObjectChange (Products.ZopeVersionControl.tests.testVersionControl.VersionControlTestsWithCommits)
Failure in test testDetectPersistentSubObjectChange (Products.ZopeVersionControl.tests.testVersionControl.VersionControlTests)
Failure in test testDetectPersistentSubObjectChange (Products.ZopeVersionControl.tests.testVersionControl.VersionControlTestsWithCommits) Ran 77 tests with 4 failures, 0 errors, 0 skipped in 1.346 seconds. |
To debug locally, I recommend installing [tox]
envlist =
py27,
py34,
py35,
py36
[testenv]
commands =
{envbindir}/buildout -c {toxinidir}/buildout.cfg buildout:directory={envdir} buildout:develop={toxinidir} bootstrap
{envbindir}/buildout -c {toxinidir}/buildout.cfg buildout:directory={envdir} buildout:develop={toxinidir}
{envbindir}/test -v1
skip_install = true
deps =
setuptools==33.1.1
zc.buildout You can then run the environment to be debugged, e.g.: $ tox -e py27 Once that environment is created, you can debug more closely, e.g.: $ .tox/py27/bin/test -D
Running zope.testrunner.layer.UnitTests tests:
Set up zope.testrunner.layer.UnitTests in 0.000 seconds.
Error in test testDetectPersistentSubObjectChange (Products.ZopeVersionControl.tests.testVersionControl.VersionControlTests)
Traceback (most recent call last):
File "/opt/Python-2.7.14/lib/python2.7/unittest/case.py", line 398, in debug
getattr(self, self._testMethodName)()
File "/home/tseaver/projects/Zope/Z2/Products.ZopeVersionControl/src/Products/ZopeVersionControl/tests/testVersionControl.py", line 668, in testDetectPersistentSubObjectChange
self.failUnless(repository.isResourceChanged(folder2))
File "/opt/Python-2.7.14/lib/python2.7/unittest/case.py", line 612, in deprecated_func
return original_func(*args, **kwargs)
File "/opt/Python-2.7.14/lib/python2.7/unittest/case.py", line 422, in assertTrue
raise self.failureException(msg)
AssertionError: False is not true
AssertionError: False is not true
> /opt/Python-2.7.14/lib/python2.7/unittest/case.py(422)assertTrue()
-> raise self.failureException(msg)
(Pdb) u
> /opt/Python-2.7.14/lib/python2.7/unittest/case.py(612)deprecated_func()
-> return original_func(*args, **kwargs)
(Pdb) u
> /home/tseaver/projects/Zope/Z2/Products.ZopeVersionControl/src/Products/ZopeVersionControl/tests/testVersionControl.py(668)testDetectPersistentSubObjectChange()
-> self.failUnless(repository.isResourceChanged(folder2))
(Pdb) pp repository.__dict__
{'_branches': <BTrees.OIBTree.OIBTree object at 0x7fd0c77d7a70>,
'_created': 1508864217.585644,
'_histories': <BTrees.OOBTree.OOBTree object at 0x7fd0c77d75f0>,
'_labels': <BTrees.OIBTree.OIBTree object at 0x7fd0c77d7950>,
'id': 'repository',
'title': ''}
(pdb) |
… 3 compatible versions. Add conditional import for cStringIO also.
Update tox configuration. Added missing bootstrap.py and buildout.cfg.
Added pyhton versions 3.4, 3.5 and 3.6 to setup.py. Added six as depency.
The corresponding Travis CI job is: https://travis-ci.org/zopefoundation/Products.ZopeVersionControl/builds/360742495 |