Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for global, non venv Python invocations #336

Merged
merged 3 commits into from Jun 20, 2023

Conversation

mitsuhiko
Copy link
Collaborator

@mitsuhiko mitsuhiko commented Jun 20, 2023

This adds support for invoking the python shim from outside of a rye managed virtualenv. This behavior is disabled by default but turned on by turning it on in the config.toml:

[behavior]
global-python = true

Then running python will pick up the .python-version defined Python or one that is sett in default.toolchain in the config.toml. Additionally it's possible run python +3.8 to invoke a Python 3.8 interpreter on the spot.

Fixes #330

let version_request = if let Some(rest) = args
.get(1)
.and_then(|x| x.as_os_str().to_str())
.and_then(|x| x.strip_prefix('+'))

This comment was marked as outdated.

@mitsuhiko mitsuhiko merged commit 544811a into main Jun 20, 2023
12 checks passed
@mitsuhiko mitsuhiko deleted the feature/global-python-shim branch June 20, 2023 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Global Python Shim Behavior
2 participants