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 lock files for inline script metadata #7483

Closed
ketozhang opened this issue Sep 18, 2024 · 2 comments
Closed

Add lock files for inline script metadata #7483

ketozhang opened this issue Sep 18, 2024 · 2 comments
Assignees
Labels
wish Not on the immediate roadmap

Comments

@ketozhang
Copy link

ketozhang commented Sep 18, 2024

https://docs.astral.sh/uv/guides/scripts/#declaring-script-dependencies

I find inline script metadata difficult to adopt because it forces all my users to run the script with a compatible runner (e.g., uv or pipx). For backwards compatibility with pip install method, a tradition requirements file is still necessary.

$ uv pip compile --script example.py -o requirements.txt
# Users without uv
$ pip install -r requirements.txt
$ python example.py

Other use cases involve, not relying on uv's venv management. For example, you have many scripts with inline metadata, but want 1 venv to be compatible with all:

$ uv pip compile --scripts scripts/*.py -o requirements.txt

My title could be more specific, but I am opening it up to uv run example.py automatically creating a uv.lock. This could be a future once we have a standard lock file.

@charliermarsh charliermarsh added the wish Not on the immediate roadmap label Sep 20, 2024
@charliermarsh
Copy link
Member

There's some overlap with #6318, though I guess you're also asking here for a way to install the script dependencies outside of uv. I'm not sure if we're likely to support that since it kind of defeats the purpose of the PEP.

@ketozhang
Copy link
Author

There's significant overlap with #6318 that I am OK with closing this as duplicate.

I feel it---I have the same sentiment back when the PEP was designed. After the fact, I now wish the PEP went further with addressing reproducibility (no good ideas until we have a standard lock file)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wish Not on the immediate roadmap
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants