frostming / unearth

A utility to fetch and download python packages
https://unearth.readthedocs.io
MIT License
142 stars 18 forks source link

Invalid requires-python: py3 #119

Closed blueninja416 closed 6 months ago

blueninja416 commented 6 months ago

Describe the bug Wheel files never seem to be chosen as the best match due to invalid requires-python versions.

To Reproduce Steps to reproduce the behavior:

  1. Create a simple PDM project without Rust installed on the machine.
  2. Attempt to add ruff as a dependency.
  3. Check log for the following error message:

unearth.evaluator: Skipping link <Link ...>: Invalid requires-python: py3

Expected behavior If a wheel file is marked as py3, it should work with any python3 implementation and install that version.

System (please complete the following information):

BlackPowerade commented 6 months ago

Seconding.

I have encountered this issue with pydantic, pydantic-core, uvicorn, and fastapi

They all share a similar format: {name}-{version}-py3-none-any.whl

System:

BlackPowerade commented 6 months ago

@blueninja416 @frostming Upon taking another look at this, I don't think this is an issue with unearth, but with pypi repo mirrors. In my case at least I dug through my work's pypi mirror and found that they messed up the data-requires-python in the simple index. Something caused their latest additions to have py3 and ppc put in there instead of "&gt;=3.7".

<a href="https://files.pythonhosted.org/packages/79/00/2470956ed833488a8fe4dd245782022686ba20579f63b5b968b90dc71d45/ruff-0.4.4-py3-none-win_amd64.whl#sha256=424e5b72597482543b684c11def82669cc6b395aa8cc69acc1858b5ef3e5daae" data-requires-python="&gt;=3.7" data-dist-info-metadata="sha256=b0669aead1790ae7d5ba3c77cefa4106c9c82a8454026b8635b619859a8df629" data-core-metadata="sha256=b0669aead1790ae7d5ba3c77cefa4106c9c82a8454026b8635b619859a8df629">ruff-0.4.4-py3-none-win_amd64.whl</a>
        <br/>
        <a href="https://files.pythonhosted.org/packages/60/39/c554b9f2af7788c63c2ca872bedec26e7a60771215fe75a997927cf22657/ruff-0.4.4-py3-none-win_arm64.whl#sha256=39df0537b47d3b597293edbb95baf54ff5b49589eb7ff41926d8243caa995ea6" data-requires-python="&gt;=3.7" data-dist-info-metadata="sha256=b0669aead1790ae7d5ba3c77cefa4106c9c82a8454026b8635b619859a8df629" data-core-metadata="sha256=b0669aead1790ae7d5ba3c77cefa4106c9c82a8454026b8635b619859a8df629">ruff-0.4.4-py3-none-win_arm64.whl</a>
        <br/>
        <a href="https://files.pythonhosted.org/packages/2f/2f/1e91c17c5223a37992a9302af69056966657d23f945e07039319fe006f82/ruff-0.4.4.tar.gz#sha256=f87ea42d5cdebdc6a69761a9d0bc83ae9b3b30d0ad78952005ba6568d6c022af" data-requires-python="&gt;=3.7">ruff-0.4.4.tar.gz</a>

If you are having this issue with a mirror I would definitely bring it up with them. Suggesting to maybe close this.

blueninja416 commented 6 months ago

Looks like that was the issue for me as well. Not sure how that happened, but will raise it to our mirror.