-
Notifications
You must be signed in to change notification settings - Fork 765
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
A uv run
subcommand
#1207
Comments
xref #1173 |
This would support PEP 721? One issue with |
Good question! I'm wondering how to handle conflicts. If a file contains a PEP 723 comment and exists in a uv workspace (with a pyproject.toml with uv configuration), should |
I believe the inline metadata should override the more general config. It’s the same way I’d hope Ruff support for PEP 723 would work, it’s a way to put per file config in the files. Like the matching feature in Rust (that partially inspired the PEP). |
I agree that PEP 723 metadata should take precedence. An obvious use case I would have for a feature like this would be to write small "workflow support" scripts in my project directory. These would have their own dependencies, and could very easily not share any dependencies with the project itself (imagine, for example, a |
In the initial implementation, the
puffin run
subcommand looks for a venv in.venv
in the current or any parent directory, activates it by settingVIRTUAL_ENV
andPATH
and then replaces itself with the python interpreter with the trailing args (on unix, it might be faster to not spawn a new process but load libpython and runPy_Main
).In further steps we can extend this to read pyproject.toml, create a venv if none exists, install all (missing) dependencies and run. This enables a "git clone and puffin run" workflow where the user does not need to manually handle venvs and dependency installation anymore.
puffin run
could replacepython
as batteries-included entrypoint for running python code.The text was updated successfully, but these errors were encountered: