astral-sh / rye

a Hassle-Free Python Experience
https://rye.astral.sh
MIT License
13.6k stars 466 forks source link

universal=true is failing to install package "hext" #1267

Closed impredicative closed 1 month ago

impredicative commented 2 months ago

Steps to Reproduce

I am using rye 1.0. I have no issues if I don't specify universal=true under [tool.rye].

With universal=true however, a package hext fails to install when running rye sync --update-all.

Under [project], note that it makes no difference whether requires-python is set to ">= 3.8" or to ">= 3.12.4"

I understand that there may exist similar issues, e.g. #1259, #1261, etc., but I still want this issue to be on record.

Expected Result

The package hext should install irrespective of universal=true.

Actual Result

$ rye sync --update-all
Reusing already existing virtualenv
Generating production lockfile: /workspaces/project/requirements.lock
  × No solution found when resolving dependencies:
  ╰─▶ Because the requested Python version (>=3.12.4) does not satisfy Python>=3.12.4 and hext==1.0.9 depends on Python>=3.12.4, we can conclude that hext==1.0.9 cannot
      be used.
      And because only hext<=1.0.9 is available and you require hext>=1.0.9, we can conclude that the requirements are unsatisfiable.

      hint: The `Requires-Python` requirement (>=3.12.4) includes Python versions that are not supported by your dependencies (e.g., hext==1.0.9 only supports >=3.12.4).
      Consider using a more restrictive `Requires-Python` requirement (like >=3.12.4).
error: could not write production lockfile for project

Caused by:
    Failed to run uv compile /tmp/.tmp7OS1X9/requirements.txt. uv exited with status: exit status: 1

Version Info

$ rye --version
rye 0.37.0
commit: 0.37.0 (09b67c469 2024-07-20)
platform: linux (x86_64)
self-python: cpython@3.12.4
symlink support: true
uv enabled: true

Stacktrace

No response

charliermarsh commented 2 months ago

I think this is fixed in latest uv.

impredicative commented 2 months ago

@charliermarsh Great. How do I get it to work in rye?

charliermarsh commented 2 months ago
❯ echo "hext" | cargo run pip compile --universal --python 3.12.4 -
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.16s
     Running `target/debug/uv pip compile --universal --python 3.12.4 -`
Resolved 1 package in 1.14s
# This file was autogenerated by uv via the following command:
#    uv pip compile --universal --python 3.12.4 -
hext==1.0.9
charliermarsh commented 2 months ago

You have to wait for the next release unfortunately.

charliermarsh commented 2 months ago

Although I think requires-python: ">=3.12.0" should work?

impredicative commented 2 months ago

@charliermarsh I will wait. Btw, it might help for rye --version to also print the uv version in-line due to the tight integration iff uv is enabled. For example, as: uv enabled: true (0.2.27).

Unfortunately, requires-python: ">=3.12.0" is not fixing it for me.