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

Shims like in pyenv or rye #6598

Closed
martenlienen opened this issue Aug 25, 2024 · 7 comments
Closed

Shims like in pyenv or rye #6598

martenlienen opened this issue Aug 25, 2024 · 7 comments
Labels
question Asking for clarification or support

Comments

@martenlienen
Copy link

Does uv plan to add shims as they exist in rye or pyenv? With this, I mean a bunch of executables that dispatch to the correct executable when called depending on a local .python-version file or an environment variable. For example, in pyenv I can run cd ~/src/some-project; pyenv local project-venv and then, whenever I change into ~/src/some-project or a subdirectory, running python or another executable from some package will automatically dispatch to the environment project-venv without me having to explicitly activate it.

@charliermarsh
Copy link
Member

Thanks! We plan to add this kind of behavior for Python, but likely not for other executables. I believe that's tracked here: #6265.

@charliermarsh charliermarsh closed this as not planned Won't fix, can't repro, duplicate, stale Aug 25, 2024
@charliermarsh charliermarsh added the question Asking for clarification or support label Aug 25, 2024
@charliermarsh
Copy link
Member

(Gonna merge into that other issue.)

@martenlienen
Copy link
Author

That is great! Is there a reason why you plan to support it only for the python executable?

@zanieb
Copy link
Member

zanieb commented Aug 26, 2024

@martenlienen like.. what other executables? We install tools separately and don't need shims to manage them.

@martenlienen
Copy link
Author

An example would be torchrun from pytorch, which I usually use as a library, but it also comes with this torchrun executable for multi-node training. Would the uv solution be to install pytorch in the project environment and separately as a tool?

@n-gao
Copy link

n-gao commented Sep 2, 2024

@zanieb Another example would be our experiment management library seml which must be executed from the same environment as the project environment. At the moment, I always have to manually activate my uv virtual environment. The actual project environment is needed to resolve configurations and discover loaded source files.

@zanieb
Copy link
Member

zanieb commented Sep 3, 2024

Yeah until we have project-level tools (as described in #3560), I think a development dependency and uv run is the solution for tools that require the project to be installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Asking for clarification or support
Projects
None yet
Development

No branches or pull requests

4 participants