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

A way to trigger uv run #3267

Open
straygar opened this issue Mar 4, 2025 · 2 comments
Open

A way to trigger uv run #3267

straygar opened this issue Mar 4, 2025 · 2 comments

Comments

@straygar
Copy link

straygar commented Mar 4, 2025

Problem description

Since pixi uses the UV resolver for pypi packages and (probably uses uv to install them as well?), if it's not difficult, it'd be great to expose an interface to: uv run my_script.py.

One benefit of doing this over defining tasks, is that your scripts can have their own dependencies defined in-line, without having to create a new dependency group & task for each one-off script:

# /// script
# 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])
@ruben-arts
Copy link
Contributor

We're interested in supporting PEP723 too. Which would allow for that to work. Including the pixi tool parts.

@pavelzw
Copy link
Contributor

pavelzw commented Mar 5, 2025

This is somewhat similar to https://pixi.sh/dev/advanced/shebang/

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

No branches or pull requests

3 participants