-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add support for PyPy, Python 2.7, and Python 3. #1
Conversation
There are two changes. First, ZODB has changed the way that blob POSKeyErrors are represented. Second, objects 3 and 4 that really are garbage from db2 are collected during the first pass. This has a small trickle down effect.
…ed in tox.ini and .travis.yml.
…t) is to use the 'raw' method of the timestamp, not try to get its repr. The repr of a persistent timestamp changed sometime ago.
- 3.3 | ||
- 3.4 | ||
install: | ||
- pip install . --use-mirrors |
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.
--use-mirrors
is deprecated and pip ignores it.
This is also an excellent opportunity to update this PR so we can see if Travis will start building it.
I tried to run the tox tests locally, and I'm seeing pypy3 failures:
Full log at https://gist.github.com/mgedmin/56b7efa581fbfb206dc8 |
See #2.
Apologies for introducing a merge conflict: I didn't want to leave Travis CI enabled without a .travis.yml in master (beause without a .travis.yml Travis defaults to Ruby builds, which are useless for us). Would you mind rebasing? |
…v qualifier, that's long released). Explicitly note all the Python 3 versions tested/supported---previously it was just a copy of Acquisition's classifiers which only list the latest.
Good point about pypy3. It wasn't on my path so tox was happily ignoring it :( It could be a GC/del issue in |
There are two changes. First, ZODB has changed the way that blob POSKeyErrors are represented. Second, objects 3 and 4 that really are garbage from db2 are collected during the first pass. This has a small trickle down effect.
…ed in tox.ini and .travis.yml.
…t) is to use the 'raw' method of the timestamp, not try to get its repr. The repr of a persistent timestamp changed sometime ago.
…v qualifier, that's long released). Explicitly note all the Python 3 versions tested/supported---previously it was just a copy of Acquisition's classifiers which only list the latest.
Rebased, and the Travis build ran clean. Thank you! |
LGTM, but I'm not familiar with zc.zodbdgc (and I'm not willing to take responsibility for it ;-), so I'll wait for someone else to review and merge this. (If the PR sits ignored for a week or two, I think it would be fine to merge it yourself -- I see you're a ZF member. You'll need to get @jimfulton's attention to push a new release to PyPI, though, he's the only one with PyPI access to zc.zodbdgc.) |
…es the use of _p_changed.
…ckfile issues from earlier. Maybe someone else can?
@mgedmin If you have a chance, could you please try the latest code with |
@mgedmin Whups, there went Travis. Build was green with PyPy3. |
tox -e pypy3 of commit 666772f: green. There were quite a few
BTW |
I do care about the ResourceWarnings, but I haven't been able to track them down. The lines in question are different on every run, e.g.,
The code in question doesn't use the Thanks for the tip for |
…rceWarning/leak under Py3/PyPy. However, the bulk of the remainder are due to the use of a TemporaryFile in the return value from gc_command, which closing could potentially break semantics. Needs input.
@mgedmin I was looking in the wrong place. Under the covers, Now, the test cases all continue to pass if that temporary file is closed (thus solving the I can see a few options:
Doing nothing may be the easiest way to get the PR completed and merged, although option 4 is close :) @jimfulton no doubt has the best view of the original intent and use cases, hopefully he will have some time to weigh in. |
+1 for not tackling ResourceWarnings in this PR. |
Bump. Unless there are objections, per the recommendation earlier of @mgemin I will probably merge this soon (my organization is about to try to move to pypy) |
Add support for PyPy, Python 2.7, and Python 3.
This PR adds support for versions of Python > 2.6 and PyPy by using
zodbpickle
when needed.As summarized in the zodbpickle issue,
noload
is broken in CPython 2.7, as well as being completely missing in PyPy and Python 3.zodbpickle
fixes this for CPython 2.7 and adds it back for PyPy and Python 3.The tests were initially broken under 2.6 due to changes in the latest ZODB/persistent, so the first/fourth commit fixes those tests. Then CPython 2.7 support was added by creating a dependency on
zodbpickle
and using it when needed. Fixing PyPy support was a matter of ensuring that resources get closed in a timely fashion, and Python 3 support consisted of some minor syntax changes to account for theprint
statement and the differences between bytes and strings, plus one__bool__
alias.A
tox.ini
for local use and a.travis.yml
file for github use were added to ensure the tests run on all supported platforms (this required aMANIFEST.in
for tox):The smelliest part is that a monkey-patch against
ZODB.serialize
is necessary to work with older versions of ZODB that don't properly support PyPy (since it has never had a version ofnoload
). I can submit a PR for ZODB to fix that problem going forward.