astral-sh / rye

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

Switch default toolchain version #1242

Open thewh1teagle opened 1 month ago

thewh1teagle commented 1 month ago

I would like to change the default cpython version. By default it uses pyhton3.12 which sometimes it's too new. So every time I create virtual environmentI have to pin the version. Is there a way to change the default python version? I imagine command like

rye toolchain switch cpython@3.8.0

And then the default python version will be cpython@3.8.0

Thanks a lot for the project. It really improve my python experience!

ijohn commented 1 month ago

You could edit ~/.rye/config.toml, [default] section, toolchain key

thewh1teagle commented 1 month ago

You could edit ~/.rye/config.toml, [default] section, toolchain key

Thanks. I think that this project should take inspiration from rustup. it works great there. In rustup we use rustup default <toolchain> and it install the toolchain and set it to default. or rustup default to show the current toolchain.