astral-sh / rye

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

Rye 0.37.0 build python 3.7 project incompatible #1291

Open zedongh opened 4 months ago

zedongh commented 4 months ago

Steps to Reproduce

  1. use rye with version 0.37.0
  2. create a new project (rye new example)
  3. change work directory (cd example)
  4. use rye pin python version 3.7.5 (rye pin 3.7.5)
  5. run rye build (rye build -c) get error info
    Python version: cpython@3.7.5
    × No solution found when resolving dependencies:
    ╰─▶ Because the current Python version (3.7.5) does not satisfy Python>=3.8 and build==1.2.1 depends on Python>=3.8, we can conclude that build==1.2.1 cannot be used.
      And because you require build==1.2.1, we can conclude that the requirements are unsatisfiable.

Expected Result

build successfully like rye 0.36.0 version.

temporary solutions (MAC OS)

  1. wget https://github.com/astral-sh/rye/releases/download/0.36.0/rye-x86_64-macos.gz
  2. gzip -d rye-x86_64-macos.gz
  3. chmod +x rye-x86_64-macos
  4. mv rye-x86_64-macos /usr/local/bin/rye@0.36.0

use rye@0.36.0 will be fine on build.

Actual Result

rye build stablely failed

Version Info

rye 0.37.0
commit: 0.37.0 (2024-07-20)
platform: macos (x86_64)
self-python: cpython@3.12.2
symlink support: true
uv enabled: true

Stacktrace

Python version: cpython@3.7.5 × No solution found when resolving dependencies: ╰─▶ Because the current Python version (3.7.5) does not satisfy Python>=3.8 and build==1.2.1 depends on Python>=3.8, we can conclude that build==1.2.1 cannot be used. And because you require build==1.2.1, we can conclude that the requirements are unsatisfiable. building example Could not find platform dependent libraries Consider setting $PYTHONHOME to [:] /var/folders/xw/1y8r5r4x5m19cdsw255gw1d40000gn/T/.tmpB0MoTO/bin/python: No module named build error: failed to build dist

Stack backtrace: 0: std::backtrace::Backtrace::create 1: std::backtrace::Backtrace::capture 2: anyhow::error::::msg 3: rye::cli::build::execute 4: rye::cli::execute 5: std::panicking::try 6: rye::utils::panic::trap_bad_pipe 7: rye::main 8: std::sys_common::backtrace::__rust_begin_short_backtrace 9: std::rt::lang_start::{{closure}} 10: std::panicking::try 11: std::rt::lang_start_internal 12: _main 13:

Systemcluster commented 4 months ago

This isn't just Python 3.7. I'm seeing the same error with a 3.10 project.

❯ rye sync
Reusing already existing virtualenv
Generating production lockfile: D:\Development\the-witcher-3-mod-manager\requirements.lock
Generating dev lockfile: D:\Development\the-witcher-3-mod-manager\requirements-dev.lock
Installing dependencies
  × No solution found when resolving dependencies:
  ╰─▶ Because the current Python version (3.12.3) does not satisfy Python>=3.10,<3.11 and the-witcher-3-mod-manager==0.9.2rc0 depends on
      Python>=3.10,<3.11, we can conclude that the-witcher-3-mod-manager==0.9.2rc0 cannot be used.
      And because only the-witcher-3-mod-manager==0.9.2rc0 is available and you require the-witcher-3-mod-manager, we can conclude that the
      requirements are unsatisfiable.
error: Installation of dependencies failed in venv at D:\Development\the-witcher-3-mod-manager\.venv. uv exited with status: exit code: 1

It seems to be using the default Python for this step even though it should be using the project Python.

❯ rye show
project: the-witcher-3-mod-manager
path: D:\Development\the-witcher-3-mod-manager
venv: D:\Development\the-witcher-3-mod-manager\.venv
target python: 3.10
venv python: cpython@3.10.14
virtual: false
configured sources:
  default (index: https://pypi.org/simple/)
❯ rye run python --version
Python 3.10.14
❯ rye --version
rye 0.38.0
commit: 0.38.0 (3e3c8540f 2024-08-02)
platform: windows (x86_64)
self-python: cpython@3.12.3
symlink support: true
uv enabled: true
Systemcluster commented 4 months ago

This should be a uv issue I think? @charliermarsh

charliermarsh commented 4 months ago

These look like distinct issues. The first is that build doesn't support Python 3.7 (and uv doesn't officially support it either). The latter isn't as clear to me -- can you open a new issue with a minimally reproducible example please?