-
Notifications
You must be signed in to change notification settings - Fork 667
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
Allow creating a python
shim on python install
#6265
Comments
not sure this was the original intention, but if the shim will work the same as uv run (in terms of environment resolution) it would be very useful this will allow simpler integration with IDEs (instead of explicitly providing a venv, they could be pointed to the uv shim that will do the environment resolution) |
This would be very useful, and is also what is missing in uv compared to pyenv. |
Please just 👍 the original post if you want this. If you have commentary on the implementation or behavior of the shim, that's totally welcome but let's keep the noise down for those subscribing to updates.
We don't think we can do this by default because people have specific expectations about |
This would be a great improvement for the entire Python ecosystem user-friendliness. Currently we manage Python projects like this where I work:
Having |
I want to migrate from rye to uv, but the migration is blocked by this issue. |
I am currently using this workaround to expose uv's Pythons to my shell's for dir in $(uv python dir)/*/bin; do PYTHON_PATHS="$dir:$PYTHON_PATHS"; done
export PATH="$PYTHON_PATHS:$PATH" The problem is that there are multiple |
As a workaround, I wrote the following script #!/usr/bin/env bash
set -euo pipefail
SCRIPT_NAME="$(basename "${BASH_SOURCE[0]}")"
if [[ "${SCRIPT_NAME}" =~ ^python3\.[0-9]+$ ]]; then
PYTHON_VERSION="${SCRIPT_NAME#python}"
else
2>&1 echo "Error: Invalid script name: ${SCRIPT_NAME}"
exit 1
fi
exec uv run --no-project --python "${PYTHON_VERSION}" --python-preference only-managed --no-config python "$@" And I have symlinks
It's not great, but it works. |
When installing Python, I should be able to opt-in to adding a
python
shim to my PATH.The text was updated successfully, but these errors were encountered: