astral-sh / rye

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

Rye doesn't respect the chosen toolchain version during installation #1024

Closed ma-sadeghi closed 5 months ago

ma-sadeghi commented 5 months ago

Steps to Reproduce

When running the installation script, choose a different Python version for the default toolchain, e.g., cpython@3.10

Expected Result

For rye to install cpython@3.10

Actual Result

Rye still installs the latest Python, only to realize later than it's missing it:

ams002@host:~$ curl -sSf https://rye-up.com/get | bash
This script will automatically download and install rye (latest) for you.
######################################################################## 100.0%
Welcome to Rye!

This installer will install rye to /home/ams002/.rye
This path can be changed by exporting the RYE_HOME environment variable.

Details:
  Rye Version: 0.32.0
  Platform: linux (x86_64)

✔ Continue? · yes
✔ Select the preferred package installer · uv (fast, recommended)
✔ What should running `python` or `python3` do when you are not inside a Rye managed project? · Run a Python installed and managed by Rye
✔ Which version of Python should be used as default toolchain? · cpython@3.10
Installed binary to /home/ams002/.rye/shims/rye
Bootstrapping rye internals
Downloading cpython@3.12.2
Checking checksum
Unpacking
Downloaded cpython@3.12.2
Updated self-python installation at /home/ams002/.rye/self

The rye directory /home/ams002/.rye/shims was not detected on PATH.
It is highly recommended that you add it.
✔ Should the installer add Rye to PATH via .profile? · yes
Added to PATH.
note: for this to take effect you will need to restart your shell or run this manually:

    source "$HOME/.rye/env"

For more information read https://rye-up.com/guide/installation/

All done!
ams002@host:~$ source "$HOME/.rye/env"
ams002@host:~$ rye^C
ams002@host:~$ which python
/home/ams002/.rye/shims/python
ams002@host:~$ python
error: Requested Python version (cpython@3.10.13) is not installed. Install with `rye fetch`
ams002@host:~$ rye fetch
Downloading cpython@3.10.13
Checking checksum
Unpacking
Downloaded cpython@3.10.13

Version Info

rye 0.32.0
commit: 0.32.0 (e1b4f2a29 2024-03-29)
platform: linux (x86_64)
self-python: cpython@3.12.2
symlink support: true
uv enabled: true

Stacktrace

No response

pjdon commented 5 months ago

Example of this happening in action

image