Skip to content
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

Merged
merged 6 commits into from Jun 21, 2017
Merged

Python 3.4/5/6 and PyPy support #2

merged 6 commits into from Jun 21, 2017

Conversation

jamadden
Copy link
Member

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.

- 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.
@jamadden
Copy link
Member Author

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.

Copy link
Member

@mgedmin mgedmin left a 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'},
Copy link
Member

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]',
Copy link
Member

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. ... ?

Copy link
Member Author

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"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please no?

lines = f.read().splitlines()
assert lines[1] == '', lines
lines[1] = 'import coverage; coverage.process_startup()'
with open('bin/buildout', 'w') as f:
Copy link
Member

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 :/

@mgedmin
Copy link
Member

mgedmin commented May 29, 2017

Package Index Owner: J1m, batlogg, fdrake, tarek, jrush, tseaver, wosc, tlotze, patricks, davisagli
Package Index Maintainer: batlogg, fdrake, davisagli

@jamadden
Copy link
Member Author

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

The setUp method defined here is used for doctests, and so is called only once for each file. The first thing it does is call zc.buildout.testing.buildoutSetUp(test) which creates a new temporary directory containing bin/buildout (and changes to it). Our setUp then proceeds to modify that file. This happens just once for the whole test file.

@jamadden
Copy link
Member Author

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.

@jamadden jamadden changed the title [WIP] Python 3.4/5/6 and PyPy support Python 3.4/5/6 and PyPy support Jun 21, 2017
@jamadden
Copy link
Member Author

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 jamadden and mgedmin as PyPI owners I'd be happy to take care of it.

@jamadden jamadden merged commit 5964ab7 into master Jun 21, 2017
@jamadden jamadden deleted the python3 branch June 21, 2017 12:10
@tseaver
Copy link
Member

tseaver commented Jun 21, 2017

I've added both 'jamadden' and 'mgedmin' as project owners on PyPI.

@jamadden
Copy link
Member Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants