Skip to content

Add an environment variable for UV_NO_PROJECT#19052

Merged
charliermarsh merged 1 commit intomainfrom
charlie/no-project-env
Apr 19, 2026
Merged

Add an environment variable for UV_NO_PROJECT#19052
charliermarsh merged 1 commit intomainfrom
charlie/no-project-env

Conversation

@charliermarsh
Copy link
Copy Markdown
Member

Closes #19020.

@charliermarsh charliermarsh added the configuration Settings and such label Apr 19, 2026
@charliermarsh charliermarsh marked this pull request as ready for review April 19, 2026 20:25
@zsol
Copy link
Copy Markdown
Member

zsol commented Apr 19, 2026

hah i have a local branch for this too

@charliermarsh charliermarsh requested a review from zsol April 19, 2026 21:42
Copy link
Copy Markdown
Member

@zsol zsol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems fine to me, but for the purposes of astral-sh/setup-uv#854 I wonder if setup-uv should have a project: require|ignore|auto setting instead, which would result in setup-uv calling uv with the appropriate flags for all its underlying invocations instead of relying on this env var leaking through.

  • require would make sure that the pyproject.toml exists and is valid by failing the setup-uv action if it isn't
  • ignore would make setup-uv just install uv without inspecting pyproject.toml at all
  • auto would be today's behavior, where a missing pyproject.toml isn't fatal, but an existing one must always be valid

@charliermarsh charliermarsh merged commit d5223f6 into main Apr 19, 2026
55 checks passed
@charliermarsh charliermarsh deleted the charlie/no-project-env branch April 19, 2026 23:19
pub const UV_PROJECT: &'static str = "UV_PROJECT";

/// Equivalent to the `--no-project` command-line argument.
#[attr_added_in("next")]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if rooster will be happy with just "next"?

Suggested change
#[attr_added_in("next")]
#[attr_added_in("next release")]

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will fix thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

configuration Settings and such

Projects

None yet

Development

Successfully merging this pull request may close these issues.

env var for --no-project

3 participants