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

Allow uv run to be used without --no-project #13599

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

Avasam
Copy link
Collaborator

@Avasam Avasam commented Mar 8, 2025

This enables running uv run without having to add --no-project every time. Until astral-sh/uv#8666, this requires adding a [project] section to pyproject.toml and .gitignoring the uv.lock file.

Using uv run is optional. "medium to advanced" python users already know to activate their venv and use the right py/python/python3 command if they want to.

Contributors who want to use uv run but with a custom venv can do so with uv run --active. I use that on WSL with a .venv-linux venv.

@Avasam Avasam added the project: infrastructure typeshed build, test, documentation, or distribution related label Mar 8, 2025
@Avasam
Copy link
Collaborator Author

Avasam commented Mar 8, 2025

Oh, no shebang update until astral-sh/ruff#13021, I'll revert those.

@Akuli
Copy link
Collaborator

Akuli commented Mar 9, 2025

Let's wait for #13597 (comment) to be resolved before merging this. (Edit: resolved now)

@Akuli
Copy link
Collaborator

Akuli commented Mar 11, 2025

I still don't like this. If someone wants to contribute a small fix to typeshed, e.g. stubs for a simple library, they shouldn't be thrown on a tangent about a tool named uv that they don't really even need to use.

python vs python3

I think it is safe to assume that anyone contributing to typeshed already knows how to run Python on their own system. Figuring out whether to put 3 in the command or not is much easier than learning about uv, even if uv is very simple and easy to use.

@Avasam
Copy link
Collaborator Author

Avasam commented Mar 11, 2025

I still don't like this. If someone wants to contribute a small fix to typeshed, e.g. stubs for a simple library, they shouldn't be thrown on a tangent about a tool named uv that they don't really even need to use.

Yeah my comment at #13597 (comment) will apply here as well

Using it in doc was less about install speed, and more about not having to worry about virtual environments, and whether it exists / is activated.

I could see being told to run a custom tool (uv) when you may not even know that it was part of the installed requirements to be jarring.

I'll update this PR


python vs python3 and .venv vs .venv3 in doc: I guess more of an annoyance where it'd be nice if we were consistant.

@Avasam Avasam changed the title Promote usage of uv run (no more python vs python3) Allow uv run to be used without --no-project Mar 11, 2025
@Avasam
Copy link
Collaborator Author

Avasam commented Mar 11, 2025

This PR is now only scoped to allowing using uv run without having to run --no-project every time.

You may have reasons to not want to modify the pyproject.toml. In which case please voice them! (even if it's just "let's wait for uv to support this"). Since I'm fine with such a change.
But please upvote astral-sh/uv#8666 in that case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
project: infrastructure typeshed build, test, documentation, or distribution related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants