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

uv export --script being able to export the requirements of a script to a requirements.txt #9657

Closed
samster25 opened this issue Dec 5, 2024 · 2 comments · Fixed by #10160
Assignees
Labels
duplicate This issue or pull request already exists

Comments

@samster25
Copy link

It would be very useful to be able to export the requirements from a script to a requirements.txt file.

This is especially the case when you need to work with a tool that doesn't support uv and expects a requirements.txt to set up the environment like with ray.

# set up script
uv init --script example.py --python 3.12
# add numpy
uv add --script example.py 'numpy'

# this is what would be nice
uv export --script example.py > requirements.txt
@my1e5
Copy link
Contributor

my1e5 commented Dec 5, 2024

Duplicate of

@zanieb
Copy link
Member

zanieb commented Dec 5, 2024

Thanks @my1e5 !

@zanieb zanieb closed this as not planned Won't fix, can't repro, duplicate, stale Dec 5, 2024
@zanieb zanieb added the duplicate This issue or pull request already exists label Dec 5, 2024
@charliermarsh charliermarsh self-assigned this Dec 25, 2024
charliermarsh added a commit that referenced this issue Jan 8, 2025
## Summary

You can now run `uv export --script main.py` to show the dependency tree
for a given script. If a lockfile doesn't exist, it will create one.

Closes #8609.

Closes #9657.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants