Skip to content

Comments

Add --no-create-gitignore to uv build#16369

Merged
zanieb merged 3 commits intomainfrom
konsti/build-no-gitignore
Oct 28, 2025
Merged

Add --no-create-gitignore to uv build#16369
zanieb merged 3 commits intomainfrom
konsti/build-no-gitignore

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
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Nov 3, 2025
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [astral-sh/uv](https://github.com/astral-sh/uv) | patch | `0.9.5` -> `0.9.7` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>astral-sh/uv (astral-sh/uv)</summary>

### [`v0.9.7`](https://github.com/astral-sh/uv/blob/HEAD/CHANGELOG.md#097)

[Compare Source](astral-sh/uv@0.9.6...0.9.7)

Released on 2025-10-30.

##### Enhancements

- Add Windows x86-32 emulation support to interpreter architecture checks ([#&#8203;13475](astral-sh/uv#13475))
- Improve readability of progress bars ([#&#8203;16509](astral-sh/uv#16509))
- Add GitHub attestations for uv release artifacts ([#&#8203;11357](astral-sh/uv#11357))

##### Bug fixes

- Drop terminal coloring from `uv auth token` output ([#&#8203;16504](astral-sh/uv#16504))
- Don't use UV\_LOCKED to enable `--check` flag ([#&#8203;16521](astral-sh/uv#16521))

### [`v0.9.6`](https://github.com/astral-sh/uv/blob/HEAD/CHANGELOG.md#096)

[Compare Source](astral-sh/uv@0.9.5...0.9.6)

Released on 2025-10-29.

This release contains an upgrade to Astral's fork of `async_zip`, which addresses potential sources of ZIP parsing differentials between uv and other Python packaging tooling. See [GHSA-pqhf-p39g-3x64](GHSA-pqhf-p39g-3x64) for additional details.

##### Security

- Address ZIP parsing differentials ([GHSA-pqhf-p39g-3x64](GHSA-pqhf-p39g-3x64))

##### Python

- Upgrade GraalPy to 25.0.1 ([#&#8203;16401](astral-sh/uv#16401))

##### Enhancements

- Add `--clear` to `uv build` to remove old build artifacts ([#&#8203;16371](astral-sh/uv#16371))
- Add `--no-create-gitignore` to `uv build` ([#&#8203;16369](astral-sh/uv#16369))
- Do not error when a virtual environment directory cannot be removed due to a busy error ([#&#8203;16394](astral-sh/uv#16394))
- Improve hint on `pip install --system` when externally managed ([#&#8203;16392](astral-sh/uv#16392))
- Running `uv lock --check` with outdated lockfile will print that `--check` was passed, instead of `--locked`  ([#&#8203;16322](astral-sh/uv#16322))
- Update `uv init` template for Maturin ([#&#8203;16449](astral-sh/uv#16449))
- Improve ordering of Python sources in logs ([#&#8203;16463](astral-sh/uv#16463))
- Restore DockerHub release images and annotations ([#&#8203;16441](astral-sh/uv#16441))

##### Bug fixes

- Check for matching Python implementation during `uv python upgrade` ([#&#8203;16420](astral-sh/uv#16420))
- Deterministically order `--find-links` distributions ([#&#8203;16446](astral-sh/uv#16446))
- Don't panic in `uv export --frozen` when the lockfile is outdated ([#&#8203;16407](astral-sh/uv#16407))
- Fix root of `uv tree` when `--package` is used with circular dependencies ([#&#8203;15908](astral-sh/uv#15908))
- Show package list with `pip freeze --quiet` ([#&#8203;16491](astral-sh/uv#16491))
- Limit `uv auth login pyx.dev` retries to 60s ([#&#8203;16498](astral-sh/uv#16498))
- Add an empty group with `uv add --group ... -r ...` ([#&#8203;16490](astral-sh/uv#16490))

##### Documentation

- Update docs for maturin build backend init template ([#&#8203;16469](astral-sh/uv#16469))
- Update docs to reflect previous changes to signal forwarding semantics ([#&#8203;16430](astral-sh/uv#16430))
- Add instructions for installing via MacPorts ([#&#8203;16039](astral-sh/uv#16039))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNjkuMSIsInVwZGF0ZWRJblZlciI6IjQxLjE2OS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
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

2 participants