-
Notifications
You must be signed in to change notification settings - Fork 4
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
Python 3 support. #1
Conversation
jamadden
commented
Apr 20, 2017
- Update travis.yml
- Add tox.ini
- Enable coverage.
- Update travis.yml - Add tox.ini - Enable coverage.
…h pkg_resources not being available
The tests pass, but they need unreleased versions of zope.app.basicskin (zopefoundation/zope.app.basicskin#1) and zope.app.pagetemplate (zopefoundation/zope.app.pagetemplate#1). We also have a workaround for zopefoundation/zope.mimetype#6 (no issue/fix yet) and the unreleased zopefoundation/zope.publisher#13
@@ -15,16 +15,21 @@ | |||
|
|||
The macros are drawn from various different page templates. | |||
""" | |||
from __future__ import print_function, absolute_import, division | |||
|
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.
The diff doesn't introduce / rely on any of those feaures.
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.
Perhaps not, but it seems to me it's proactive to ensure that Py2 and Py3 behave as similarly as possible. It's similar to the same reason that one would write class Thing(object):
, to be sure there are new-style classes everywhere.
The file was being touched now with the express intent of making it work under Python 3, so I didn't see any reason to wait. Especially print_function
tends to creep in during debugging, and it's a hassle to add and remove it.
But if you feel strongly I can remove it.
setup.py
Outdated
'Development Status :: 5 - Production/Stable', | ||
'Environment :: Web Environment', | ||
'Intended Audience :: Developers', | ||
'License :: OSI Approved :: Zope Public License', | ||
'Programming Language :: Python', | ||
'Programming Language :: Python:: 2.7', | ||
'Programming Language :: Python:: 3.5', |
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.
Per the Python devguide, Python 3.4 is not EOL until 2019-03-16. Shouldn't we be supporting it? Python 3.3. goes EOL 2017-09-29, which makes it more obvious to drop / avoid.
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.
Well, we probably could. But I'm not using Python 3.4 and have no plans to---PyPy won't have a Python 3.4 release, just a 3.5 release, and for me that's enough reason to skip 3.4 (and 3.3) entirely. Since this is the first time Python 3 has been addressed here, it didn't seem like people were clamoring 3.4 support. So it just seemed simpler to not put it in---plus it saves time on Travis, in tox, etc.
But if you feel strongly, I can add it to all those places.
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.
I got to looking, and all of the packages I've opened Py 3 PRs for lately are used by Plone. Plone is not quite ready for Python 3 yet, but they will be, so there is good motivation to add 3.4 support (hopefully they're ready before 2019 😄 ). I've done so.
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.
LGTM!
@@ -60,7 +68,9 @@ def read(*rnames): | |||
extras_require=dict( | |||
test=[ | |||
'zope.component [test]', | |||
'zope.testrunner', |
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.
This is surprising to me -- we're not importing anything from zope.testrunner
in our test code.
I suppose we rely on zope.testrunner's test layer support for our tests, but in theory that could be implemented by other test runners as well.
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.
tox.ini and .travis.yml both use zope.testrunner. So the choice is to either list the dependency once in [test]
, or to repeat it twice in both those files. Repetition doesn't sound awful (since they already explicitly mention zope.testrunner)...until (if) we need a version pin of it for some reason; then it seems likely one of the repetitions will be missed.
It's true, nose2
supports layers. But the last time I used nose2, they weren't fully compatible with zope.testrunner layers in some corner cases and I eventually gave up on it.
Thanks! Could we get a PyPI release when you have a chance @mgedmin ? (I don't have rights to any of the zope.app packages.) |
Congratulations: user @strichter had a script to grant PyPI rights to all the zope packages via the API... |
Cool, thanks. If there are no objections, I'll go ahead and release this soon. |