Skip to content

Conversation

@konstin
Copy link
Member

@konstin konstin commented Oct 20, 2025

Fixes #16332

@konstin konstin requested a review from zanieb October 20, 2025 09:34
@konstin konstin added the enhancement New feature or improvement to existing functionality label Oct 20, 2025
@konstin konstin temporarily deployed to uv-test-registries October 20, 2025 09:36 — with GitHub Actions Inactive
@konstin konstin force-pushed the konsti/build-no-gitignore branch from 91d1d55 to 8396c4c Compare October 20, 2025 09:51
@konstin konstin temporarily deployed to uv-test-registries October 20, 2025 09:53 — with GitHub Actions Inactive
#[arg(long, overrides_with("no_gitignore"), hide = true)]
pub gitignore: bool,

/// Do not create a `.gitignore` file in the output directory
Copy link
Member

Choose a reason for hiding this comment

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

I usually add a second paragraph explaining why we do this by default, e.g.,

By default, uv will create a .gitignore file in the output directory to ...
When this flag is used, the file will be omitted.

#[arg(long, overrides_with("no_gitignore"), hide = true)]
pub gitignore: bool,

/// Do not create a `.gitignore` file in the output directory
Copy link
Member

Choose a reason for hiding this comment

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

(I think these tend to end in periods?)


/// Do not create a `.gitignore` file in the output directory
#[arg(long, overrides_with("gitignore"))]
pub no_gitignore: bool,
Copy link
Member

Choose a reason for hiding this comment

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

My intuition when I saw this flag is that it would toggle whether or not gitignore is respected during the build. I think this could be confusing enough (and need for this option seems rare enough) that I would call this --no-create-gitignore / --create-gitignore.

@konstin konstin changed the title Add --no-gitignore to uv build Add --no-create-gitignore to uv build Oct 27, 2025
Comment on lines 2644 to 2645
/// artifacts from version control. When this flag is used, the file will be omitted and only
/// the build artifacts (source distributions and wheels) are stored in the output directory.
Copy link
Member

Choose a reason for hiding this comment

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

only the build artifacts (source distributions and wheels) are stored in the output directory.

This part isn't particularly future-proof. I'd probably reference the use-case instead?

When this flag is used, the file will be omitted, e.g., for use-cases where the artifacts
need to be checked in to version control.

Copy link
Member Author

Choose a reason for hiding this comment

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

I chose the shorter version, there's other use cases e.g. building a find links index where you don't want a gitignore but it's also not in Git.

@konstin konstin force-pushed the konsti/build-no-gitignore branch from f7f18d9 to 0cdb01e Compare October 28, 2025 08:00
@konstin konstin temporarily deployed to uv-test-registries October 28, 2025 08:04 — with GitHub Actions Inactive
@zanieb zanieb merged commit cfa1de3 into main Oct 28, 2025
100 checks passed
@zanieb zanieb deleted the konsti/build-no-gitignore branch October 28, 2025 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or improvement to existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

option to not create .gitignore in dist/ folder when using uv build

3 participants