Skip to content

Conversation

@zanieb
Copy link
Member

@zanieb zanieb commented Jul 25, 2025

I needed this for a test, e.g., to disable a source for an extra build dependency without disabling the source for a workspace member, and had also seen some requests for it. I think it makes sense to allow this.

The refactor is fairly mechanical, we go from SourceStrategy::Enabled|Disabled to NoSources::All|None|Package(names) as we do for other options like NoBinary.

Related #17441

@zanieb zanieb added the cli Related to the command line interface label Jul 25, 2025
@zanieb zanieb force-pushed the zb/no-sources-package branch 2 times, most recently from d2676f6 to cc12ce5 Compare July 25, 2025 21:53
@zanieb zanieb temporarily deployed to uv-test-registries July 25, 2025 21:56 — with GitHub Actions Inactive
@zanieb zanieb force-pushed the zb/no-sources-package branch from cc12ce5 to d217468 Compare July 25, 2025 22:04
@zanieb zanieb temporarily deployed to uv-test-registries July 25, 2025 22:06 — with GitHub Actions Inactive
@zanieb zanieb force-pushed the zb/no-sources-package branch from d217468 to ad82433 Compare July 25, 2025 22:49
@zanieb zanieb temporarily deployed to uv-test-registries July 25, 2025 22:51 — with GitHub Actions Inactive
@zanieb zanieb temporarily deployed to uv-test-registries July 28, 2025 16:57 — with GitHub Actions Inactive
@zanieb zanieb temporarily deployed to uv-test-publish July 28, 2025 16:58 — with GitHub Actions Inactive
@zanieb zanieb temporarily deployed to uv-test-registries July 31, 2025 12:36 — with GitHub Actions Inactive
@zanieb zanieb force-pushed the zb/no-sources-package branch from 2f7c997 to 3c1d06b Compare January 14, 2026 17:37
@zanieb zanieb marked this pull request as ready for review January 14, 2026 17:50
@zanieb zanieb temporarily deployed to uv-test-registries January 14, 2026 18:17 — with GitHub Actions Inactive
@zanieb zanieb force-pushed the zb/no-sources-package branch from 3c1d06b to fd5c1aa Compare January 14, 2026 19:37
@zanieb zanieb requested a review from charliermarsh January 15, 2026 03:33
build_requires.requires_dist
}
SourceStrategy::Disabled => extra_requires.into_iter().map(Requirement::from).collect(),
let extra_requires = if no_sources.no_sources() {
Copy link
Member

Choose a reason for hiding this comment

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

no_sources.no_sources() is a bit awkward.


fn sources(&self) -> SourceStrategy {
self.sources
fn sources(&self) -> NoSources {
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 I would expect this to return &NoSources? Callers can clone if they need to.

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 think I did this for some painful reason, but it was a while ago now. I'll look again.

Copy link
Member

@charliermarsh charliermarsh left a comment

Choose a reason for hiding this comment

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

Looks reasonable. I find NoSources name to be a bit confusing because it's sort of like a double-negative? I probably would've left it as SourceStrategy and just added a Disabled(Vec<Package>) variant.

@zanieb
Copy link
Member Author

zanieb commented Jan 15, 2026

Hm. I was mostly mirroring the NoBinary and NoBuild patterns. I think it'd need to be SourceStrategy::Disabled and SourceStrategy::DisabledPackages or SourceStrategy::Disabled(Option<Vec<Packages>>)? both of which feel a little weird to me too.

@zanieb zanieb temporarily deployed to uv-test-publish January 15, 2026 18:06 — with GitHub Actions Inactive
@zanieb zanieb merged commit 490b7f3 into main Jan 15, 2026
136 of 138 checks passed
@zanieb zanieb deleted the zb/no-sources-package branch January 15, 2026 19:53
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Jan 17, 2026
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [astral-sh/uv](https://github.com/astral-sh/uv) | patch | `0.9.24` → `0.9.26` |

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.26`](https://github.com/astral-sh/uv/blob/HEAD/CHANGELOG.md#0926)

[Compare Source](astral-sh/uv@0.9.25...0.9.26)

Released on 2026-01-15.

##### Python

- Add CPython 3.15.0a5

##### Enhancements

- Add a hint to update uv when a managed Python download is not found ([#&#8203;17461](astral-sh/uv#17461))
- Improve cache initialization failure error message ([#&#8203;17469](astral-sh/uv#17469))
- Improve error message for abi3 wheels on free-threaded Python ([#&#8203;17442](astral-sh/uv#17442))
- Add support for `--no-sources-package` ([#&#8203;14910](astral-sh/uv#14910))

##### Preview features

- Add `METADATA.json` and `WHEEL.json` in uv build backend ([#&#8203;15510](astral-sh/uv#15510))
- Add support for GCS request signing ([#&#8203;17474](astral-sh/uv#17474))
- Adjust the process ulimit to the maximum allowed on startup ([#&#8203;17464](astral-sh/uv#17464))

##### Bug fixes

- Lock to avoid concurrent refresh of pyx tokens ([#&#8203;17479](astral-sh/uv#17479))

##### Documentation

- Add linting and formatting instructions to the CONTRIBUTING guide ([#&#8203;17470](astral-sh/uv#17470))
- Avoid rendering `pyproject.toml` examples for more system-level settings ([#&#8203;17462](astral-sh/uv#17462))

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

[Compare Source](astral-sh/uv@0.9.24...0.9.25)

Released on 2026-01-13.

##### Python

- Add CPython 3.15.0a4
- Upgrade Tcl/Tk used by CPython to 9.0

##### Enhancements

- Add `--compile-bytecode` to `uv python install` and `uv python upgrade` to compile the standard library ([#&#8203;17088](astral-sh/uv#17088))
- Allow disabling `exclude-newer` per package ([#&#8203;16854](astral-sh/uv#16854))
- Broadcast `WM_SETTINGCHANGE` on `uv tool update-shell` ([#&#8203;17404](astral-sh/uv#17404))

##### Preview features

- Detect workspace from `uv run` target ([#&#8203;17423](astral-sh/uv#17423))

##### Bug fixes

- Avoid unwrapping size for file responses ([#&#8203;17434](astral-sh/uv#17434))
- Use keyring authentication when retrieving `tool@latest` version ([#&#8203;17448](astral-sh/uv#17448))
- Use latest Pyodide version for each python version ([#&#8203;17372](astral-sh/uv#17372))
- Improve trampoline file handle closing ([#&#8203;17374](astral-sh/uv#17374))
- Fix error message when installing musl python on armv7 ([#&#8203;17213](astral-sh/uv#17213))

</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:eyJjcmVhdGVkSW5WZXIiOiI0Mi44MC4xIiwidXBkYXRlZEluVmVyIjoiNDIuODEuOCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90IiwiYXV0b21hdGlvbjpib3QtYXV0aG9yZWQiLCJkZXBlbmRlbmN5LXR5cGU6OnBhdGNoIl19-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli Related to the command line interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants