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

Support PyPy3 v5.2 #23

Closed
wants to merge 1 commit into from
Closed

Support PyPy3 v5.2 #23

wants to merge 1 commit into from

Conversation

jayvdb
Copy link
Collaborator

@jayvdb jayvdb commented Jul 14, 2016

PyPy has started releasing alpha releases of PyPy3 v5.2, and Travis now supports python: pypy3.3-5.2-alpha1.

PyPy3 v5.2 depends on virtualenv>=15.0.2, whereas Travis installs 12.0.6. Only force the use of virtualenv>=15.0.2 on PyPy3 v5.2, so that existing users of tox-travis are not impacted. This is complicated by Travis providing setuptools 12.0.5, which does not support platform_python_implementation=="PyPy" as an environment marker, and fails to install tox-travis from a source tarball. However tox-travis provides a universal wheel, which supports that environment marker, and Travis pip 6.0.7 can install it.

This change breaks any use of tox-travis with old setuptools. As tox-travis uses tox to install and test the package, either we use skipdist=True or tell tox to use a wheel to install tox-travis, thereby avoiding setuptools in tox.

Also, fiddle with tox internals so that it attempts to run python for the Travis versions pypy3.3-5.2-*.

Fixes #22

PyPy has started releasing alpha releases of PyPy3 v5.2,
and Travis now supports `python: pypy3.3-5.2-alpha1`.

PyPy3 v5.2 depends on virtualenv>=15.0.2, whereas Travis installs 12.0.6.
Only force the use of virtualenv>=15.0.2 on PyPy3 v5.2, so that existing
users of tox-travis are not impacted.
This is complicated by Travis providing setuptools 12.0.5,
which does not support `platform_python_implementation=="PyPy"`
as an environment marker, and fails to install tox-travis
from a source tarball.  However tox-travis provides a universal wheel,
which supports that environment marker, and Travis pip 6.0.7 can install it.

This change breaks any use of tox-travis with old setuptools.
As tox-travis uses tox to install and test the package,
either we use `skipdist=True` or tell tox to use a wheel
to install tox-travis, thereby avoiding setuptools in tox.

Also, fiddle with tox internals so that it attempts to
run `python` for the Travis versions `pypy3.3-5.2-*`.
@jayvdb
Copy link
Collaborator Author

jayvdb commented Jul 14, 2016

I have yet to add tests for the code changes.

I would appreciate it if you could first upload this to https://testpypi.python.org/pypi , then we can double check that pip install --index-url "https://testpypi.python.org/pypi" tox-travis works on Travis, without attempting to use the old setuptools, and any other scenarios we think people might actually be using.
I am assuming that nobody is putting tox-travis in their setup.py install_requires, or if they do then they can upgrade setuptools themselves.

I have avoided using setup_requires, as everything I read about it says it causes more obscure bugs than it solves. I could add a PEP 518 pyproject.toml , however pip and setuptools dont support that yet.
pypa/pip#3691
pypa/setuptools#651

@ryanhiebert
Copy link
Collaborator

This is excellent work. I'm learning a lot from reviewing it, thank you. I'll probably take a couple more days to figure it all out (not enough time available to review quickly), so don't think I'm ignoring you. You've also requested that I test this on testpypi before I merge it, so I'll do that too.

@jayvdb
Copy link
Collaborator Author

jayvdb commented Jul 14, 2016

Nod. Im happy for this one to be done slowly and carefully.
Need to check the min tox version.

@jayvdb
Copy link
Collaborator Author

jayvdb commented Jul 14, 2016

Confirmed the tox min version is still 2.0 . Here is the last change related to tox.config.default_factors, occurring in the 2.0 dev releases.
https://bitbucket.org/hpk42/tox/commits/5fbd833e8b0e88cf71920a147

@ryanhiebert
Copy link
Collaborator

Thank you for checking on that.

@jayvdb
Copy link
Collaborator Author

jayvdb commented Jul 14, 2016

Here is a nice breakdown of the problem with detecting PyPy:
pypa/packaging#72 (comment)

I have independently found that ~18+ is the min that supports platform_python_implementation
https://travis-ci.org/jayvdb/tox-travis/builds/144847778

However my testing shows that platform.python_implementation is 20+
https://travis-ci.org/jayvdb/tox-travis/builds/144854169

And python_implementation (which I didnt know about ...) is strange - it works for setup.py build_wheel , but then fails for tox installing the wheel in pkg_resources/_markerlib (not packaging) https://travis-ci.org/jayvdb/tox-travis/builds/144860056 , so I think that python_implementation is 100% off the table for tox-travis (unless we fiddle with the wheel to replace python_implementation with platform_python_implementation after setuptools has created it.... interesting...).

We still probably need to dance around tox by using the wheel, because tox-travis installs various virtualenv (esp. virtualenv<13 on Python 3.2), and those virtualenv may install very old setuptools into the venv.

@jayvdb
Copy link
Collaborator Author

jayvdb commented Jul 15, 2016

I've found two solutions which I believe will work with any version of setuptools.
pypa/packaging#72 (comment)
I'm still looking for downsides, but havent found any yet.

I'll be working on that over the w/e, as that reduces the chance that tox-travis users will have their builds broken by this enhancement which most users will probably not use in the near future.

@ryanhiebert
Copy link
Collaborator

#24 was merged, so this is no longer appropriate to merge, as they were targeting the same result.

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.

2 participants