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.4/5/6 and PyPy support #2
Conversation
- Tests run on Python 2.7 with modern buildout. -- Known issue when PYTHONHASHSEED is set to random on Python 2. - Add .travis.yml and tox.ini for modern testing. -- Add MANIFEST.in for tox and sdists. - Rename .txt -> .rst
… stops them from fully working in some cases.
Also use git master of zc.buildout for tests until there is a release.
I got coverage for the subprocesses figured out (a tiny bit of boiler code that could potentially be added to the existing buildoutSetUp/tearDown methods in zc.buildout.testng). It's pretty good at 96%. It's still a WIP pending a zc.buildout release. |
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, I suppose.
I don't quite understand how you can keep re-writing bin/buildout without failing when the tests run again and line[1] no longer passes the == '' assertion, but let's assume I missed something and it's fine.
setup.py
Outdated
zip_safe = True, | ||
) | ||
), | ||
package_dir={'':'src'}, |
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.
Space after the :
please?
setup.py
Outdated
# sadly zc.buildout doesn't have a test extra, so we | ||
# need to duplicate its test dependencies, since we import its | ||
# test package. | ||
'zc.buildout[test]', |
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.
You say that zc.buildout doesn't have a test extra, and then go ahead and use zc.buildout's test extra. ... ?
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'm wrong about that. It does have a test extra, but I can't figure out how to get the test extra to install when I install from the VCS url.
But anyway, looking at the test extra it drags in things we really don't want ('bobo ==2.3.0', 'zdaemon', 'zc.zdaemonrecipe', 'zc.recipe.deployment') and that apparently aren't necessary.
setup.py
Outdated
|
||
name = "zc.recipe.cmmi" | ||
name="zc.recipe.cmmi" |
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.
Please no?
src/zc/recipe/cmmi/tests.py
Outdated
lines = f.read().splitlines() | ||
assert lines[1] == '', lines | ||
lines[1] = 'import coverage; coverage.process_startup()' | ||
with open('bin/buildout', 'w') as f: |
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.
O.O
...
I suppose it works :/
|
The |
Since we're going to require a new zc.buildout release anyway, I'd like to prepare a PR for it that moves the coverage support code there. Hopefully it will be accepted and make life easier for all buildout recipe authors that use this doctest-based testing that spawn subprocesses. |
buildout 2.9.4 has been released with the fix we needed and the support for coverage added. Tests are green here and PR has been approved, so I'm going to go ahead and merge. @jimfulton Could we get a PyPI release please? Or if you'd like to add |
I've added both 'jamadden' and 'mgedmin' as project owners on PyPI. |
Thank you! |
WIP because Python 3 tests won't reliably pass until buildout/buildout#393 is released.
Also WIP because coverage isn't right yet because of all the subprocesses. I still need to work on that.