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

PyPy CFFI and Cython builds fail on Travis #161

Closed
dHannasch opened this issue Oct 11, 2019 · 5 comments · Fixed by #167
Closed

PyPy CFFI and Cython builds fail on Travis #161

dHannasch opened this issue Oct 11, 2019 · 5 comments · Fixed by #167

Comments

@dHannasch
Copy link
Collaborator

dHannasch commented Oct 11, 2019

When the CFFI option is enabled, testenv pypy fails with

ERROR: invocation failed (exit code 1), logfile: /home/travis/build/ionelmc/cookiecutter-pylibrary/python-nameless/.tox/pypy/log/pypy-2.log
================================== log start ==================================
Looking in links: file:///home/travis/.pip/wheels
Processing ./.tox/.tmp/package/1/nameless-1.0.0.zip
  Could not find a version that satisfies the requirement cffi>=1.0.0 (from versions: )

CFFI 1.0 is distributed with PyPy 2.6, so normally I might think this is just failing to find it because it's already included, but also...

When the Cython option is enabled, testenv pypy fails with

pypy inst: /home/travis/build/ionelmc/cookiecutter-pylibrary/python-nameless/.tox/.tmp/package/1/nameless-1.0.0.zip
ERROR: invocation failed (exit code 1), logfile: /home/travis/build/ionelmc/cookiecutter-pylibrary/python-nameless/.tox/pypy/log/pypy-2.log
================================== log start ==================================
Looking in links: file:///home/travis/.pip/wheels
Processing ./.tox/.tmp/package/1/nameless-1.0.0.zip
  Could not find a version that satisfies the requirement cython (from versions: )

In both cases, the error is presumably emanating from setup_requires in setup.py: cython or cffi>=1.0.0. Why it's failing to install, though...that's a mystery. Both Cython and CFFI are supposed to work with PyPy: http://packages.pypy.org/
setup_requires uses easy_install rather than pip, but I don't see why it would matter that the Python running is PyPy.
I see some vague noise about PyPy not having easy_install installed by default. In that case, we would expect both cookiecutter.setup_py_uses_test_runner and cookiecutter.setup_py_uses_setuptools_scm to also fail on PyPy, since those both need setup_requires. Neither is currently part of the test matrix. But something is reporting "Could not find a version", so it seems like easy_install must be around to say that.

https://bitbucket.org/pypy/pypy/issues/735/unable-to-install-twisted-via-easy_install

@ionelmc
Copy link
Owner

ionelmc commented Oct 11, 2019

Mkay but this only happens only on pypy 2.6 (which is kinda ancient and irrelevant) right?

@ionelmc
Copy link
Owner

ionelmc commented Oct 11, 2019

Also another thing, now I realize cython shouldn't be in deps in pyproject.toml - maintainers are expected to pre-cythonize their modules so that users don't have slow source installs.

@dHannasch
Copy link
Collaborator Author

dHannasch commented Oct 11, 2019

Mkay but this only happens only on pypy 2.6 (which is kinda ancient and irrelevant) right?

No idea. I've never tried PyPy, so I don't know much about that. It's whatever the tox.ini is pulling up.

Disabling PyPy certainly makes the build pass.

cython shouldn't be in deps in pyproject.toml

Possibly. The point of having pyproject.toml is just to try to avoid setup_requires activating as much as possible, right? e3fef72 And the trouble is, pyproject.toml is very inflexible --- it can't, for example, use Cython if Cython happens to be available, as setup.py does. pypa/pip#6144

Do you mean to remove CFFI from pyproject.toml too?

There's supposedly a way to use pyproject.toml to specify that a package should be installed with Flit or Poetry rather than pip. Poetry also says it can handle more complex pyproject.toml files. I can't quite figure out how that's supposed to work --- maybe pyproject.toml gets read twice? --- but that might allow more sophisticated behavior from pyproject.toml.
(Looks like flit still wouldn't work for this layout, though. pypa/flit#260)

@ionelmc
Copy link
Owner

ionelmc commented Oct 12, 2019

Flit will eventually work with the src layout.

Anyway, something really weird is going on in the CI, cause upgrading cffi on pypy works well locally.

@ionelmc
Copy link
Owner

ionelmc commented Oct 12, 2019

Trying some stuff in https://travis-ci.org/ionelmc/cookiecutter-pylibrary/builds/596992568 - cross fingers!

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