astral-sh / rye

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

`universal = true` giving errors with version 0.37.0 #1259

Closed my1e5 closed 1 month ago

my1e5 commented 2 months ago

I have been using this config with version 0.36.0 and had no issues

[tool.rye]
managed = true
universal = true

But I've just updated rye to version 0.37.0 and now I'm getting a Failed to run uv compile error.

Steps to reproduce

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

$ cd new_project/

$ rye add dearpygui==1.11.1
Initializing new virtualenv in C:\Users\my1e5\Projects\Test\new_project\.venv
Python version: cpython@3.12.3
Added dearpygui==1.11.1 as regular dependency
Reusing already existing virtualenv
Generating production lockfile: \\?\C:\Users\my1e5\Projects\Test\new_project\requirements.lock
Generating dev lockfile: \\?\C:\Users\my1e5\Projects\Test\new_project\requirements-dev.lock
Installing dependencies
Resolved 2 packages in 13ms
   Built new-project @ file:///C:/Users/my1e5/Projects/Test/new_project
Prepared 1 package in 899ms
Installed 2 packages in 15ms
 + dearpygui==1.11.1
 + new-project==0.1.0 (from file:///C:/Users/my1e5/Projects/Test/new_project)
Done!

Go into the pyproject.toml file and add universal = true under [tool.rye]

$ rye sync
Reusing already existing virtualenv
Generating production lockfile: C:\Users\my1e5\Projects\Test\new_project\requirements.lock
  × No solution found when resolving dependencies:
  ╰─▶ Because the requested Python version (>=3.12.3) does not satisfy Python>=3.12.3 and dearpygui==1.11.1 depends on
      Python>=3.12.3, we can conclude that dearpygui==1.11.1 cannot be used.
      And because you require dearpygui==1.11.1, we can conclude that the requirements are unsatisfiable.

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

Caused by:
    Failed to run uv compile C:\Users\my1e5\AppData\Local\Temp\.tmpZJPouW\requirements.txt. uv exited with status: exit code: 1

I'm not sure what's going wrong. But it seems odd that it says Because the requested Python version (>=3.12.3) does not satisfy Python>=3.12.3.

I've gone back and tried this same workflow using version 0.36.0 and it gives no errors.

charliermarsh commented 2 months ago

Thanks, I'll take a look.

charliermarsh commented 2 months ago

What is the requires-python in your pyproject.toml?

charliermarsh commented 2 months ago

It seems like one issue here is that we aren't passing the requires-python to the resolver, but also seeing this behavior in uv with echo "dearpygui==1.11.1" | cargo run pip compile --universal --python 3.12.3 which is weird.

my1e5 commented 2 months ago

What is the requires-python in your pyproject.toml?

requires-python = ">= 3.8"

charliermarsh commented 2 months ago

I've filed a few issues around this (one specific to Rye):

my1e5 commented 1 month ago

@charliermarsh This specific error is now fixed in version 0.38.0 - many thanks!