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

uv pip compile uses overly specific python_version with -p markers #2392

Closed
charliermarsh opened this issue Mar 12, 2024 · 0 comments · Fixed by #2395
Closed

uv pip compile uses overly specific python_version with -p markers #2392

charliermarsh opened this issue Mar 12, 2024 · 0 comments · Fixed by #2395
Assignees
Labels
bug Something isn't working

Comments

@charliermarsh
Copy link
Member

echo "pandas" | cargo run pip compile - -p 3.11.8 fails to include NumPy, I think we must be treating python_version as 3.11.8 instead of 3.11 in the markers or something. Pandas requirements are:

Requires-Dist: numpy<2,>=1.22.4; python_version < "3.11"
Requires-Dist: numpy<2,>=1.23.2; python_version == "3.11"
Requires-Dist: numpy<2,>=1.26.0; python_version >= "3.12"
@charliermarsh charliermarsh added the bug Something isn't working label Mar 12, 2024
@charliermarsh charliermarsh self-assigned this Mar 12, 2024
charliermarsh added a commit that referenced this issue Mar 13, 2024
## Summary

Per [PEP 508](https://peps.python.org/pep-0508/), `python_version` is
just major and minor:

![Screenshot 2024-03-12 at 5 15
09 PM](https://github.com/astral-sh/uv/assets/1309177/cc3b8d65-dab3-4229-aed7-c6fe590b8da0)

Right now, we're using the provided version directly, so if it's, e.g.,
`-p 3.11.8`, we'll inject the wrong marker. This was causing `pandas` to
omit `numpy` when `-p 3.11.8` was provided, since its markers look like:

```
Requires-Dist: numpy<2,>=1.22.4; python_version < "3.11"
Requires-Dist: numpy<2,>=1.23.2; python_version == "3.11"
Requires-Dist: numpy<2,>=1.26.0; python_version >= "3.12"
```

Closes #2392.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant