Open sgrzemski opened 4 years ago
I'm seeing the same issue over on https://github.com/ciena/afkak/pull/110.
The root of this is that a bunch of pyhash's transitive install-time (setup_requires
) dependencies have dropped Python 2.7 support. The setup_requires
mechanism basically installs stuff using setuptools easy_install, rather than Pip. easy_install doesn't know about Requires-Python (PEP 345), so it tries to install a bunch of packages in spite of this metadata.
It looks like the easiest way to fix this is to move away from pytest-runner. Its maintainers have deprecated it, essentially exactly for this reason. You'd start by deleting these lines:
https://github.com/flier/pyfasthash/blob/5f81262d4897e5d4b79c09179d901cdb6207e5f8/setup.py#L238-L239
The current Tox config installs these test dependencies:
That should work, but if you were still getting the wrong pytest version you can add an additional constraint like:
pytest <5.0; python_version<"3.0"
Another option is to ship Python 2.7 wheels for more platforms so that setup.py
is never run. This is, admittedly, quite a lot of work. argon2-cffi is a fully worked example of this.
As a user of the library, we can work around these issues by ensuring that Python 2.7-compatible versions of these libraries are installed before pyhash. For example, you could add a Python 2.7-qualified dep
in tox.ini
:
[testenv]
deps =
{py27,pypy}: pytest-runner
{py27,pypy}: pytest-benchmark
Here's a real-world example: https://github.com/ciena/afkak/pull/110/commits/8c7bd8aa6e3a1acdf134f0b568145f9b4acfe23a
Whoa, nice analysis. Much appreciated, thanks!
Hi there, I am experiencing issues installing pyhash when more-itertools over 5.x is installed:
When downgrading more-itertools to 5.0 pyhash installs flawless: