Open bayashi-cl opened 1 month ago
For completeness, simply running python
gives
error: Target Python binary 'python' not found in project. Most likely running 'rye sync' will resolve this.
What was the reasoning behind this default behaviour?
I am also confused by the inconsistent behavior of rye shims.
A toolchain seems to be working fine with behavior.global-python=true
, but rye suddenly refuses to use it once it finds an empty file named pyproject.toml
:
which python3
# /Users/watal/.rye/shims/python3
python3 -c "import sys; print(sys.prefix)"
# /Users/watal/.rye/py/cpython@3.12.3
touch pyproject.toml
python3 -c "import sys; print(sys.prefix)"
# /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9
I'm gonna add to this. The global behavior isn't very good. I have to do lots of work arounds to make it work.
It seems @bayashi-cl has it right with #1122: for python projects not managed by rye (so no tool.rye.managed = true
), rye should probably use global python all the time, through global shims if activated.
Steps to Reproduce
Start Global Shims within the sampleproject.
Expected Result
The Python shell will start.
Actual Result
The command will fail with error.
Version Info
Stacktrace
No response