ionelmc / cookiecutter-pylibrary

Enhanced cookiecutter template for Python libraries.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PyPy CFFI and Cython builds fail on Travis

dHannasch opened this issue · comments

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

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

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.

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)

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.