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 PEP 723 support to uv run #3096

Closed
zanieb opened this issue Apr 17, 2024 · 3 comments · Fixed by #4656
Closed

Add PEP 723 support to uv run #3096

zanieb opened this issue Apr 17, 2024 · 3 comments · Fixed by #4656
Assignees
Labels
enhancement New feature or request

Comments

@zanieb
Copy link
Member

zanieb commented Apr 17, 2024

No description provided.

@zanieb
Copy link
Member Author

zanieb commented Apr 17, 2024

First step in #3110

zanieb added a commit that referenced this issue Apr 19, 2024
e.g. `uv run foo.py` implies `python foo.py`

Future work includes #3096
@zanieb
Copy link
Member Author

zanieb commented May 13, 2024

See discussion at #1207 (comment)

@charliermarsh
Copy link
Member

I'll take this one.

charliermarsh added a commit that referenced this issue Jul 1, 2024
Closes #3096 

## Summary

Enables `uv run foo.py` to execute PEP 723-compatible scripts.

For example, given:

```python
# /// script
# requires-python = ">=3.11"
# dependencies = [
#   "requests<3",
#   "rich",
# ]
# ///

import requests
from rich.pretty import pprint

resp = requests.get("https://peps.python.org/api/peps.json")
data = resp.json()
pprint([(k, v["title"]) for k, v in data.items()][:10])
```

![Screenshot 2024-06-29 at 7 23
52 PM](https://github.com/astral-sh/uv/assets/1309177/c60f2415-4874-4b15-b9f5-dd8c8c35382e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants