Skip to content

Remove test-defaults from default features to fix cargo install#17908

Closed
jeffs wants to merge 1 commit intoastral-sh:mainfrom
jeffs:fix-cargo-install
Closed

Remove test-defaults from default features to fix cargo install#17908
jeffs wants to merge 1 commit intoastral-sh:mainfrom
jeffs:fix-cargo-install

Conversation

@jeffs
Copy link

@jeffs jeffs commented Feb 7, 2026

Summary

  • Remove test-defaults from the default feature set in crates/uv/Cargo.toml
  • Add test-defaults explicitly to the Linux CI test features in test.yml

The test-defaults feature propagates features to uv-test, which is a dev-dependency. Since cargo install strips dev-dependencies, this causes installation to fail:

error: package `uv v0.10.0` does not have a dependency named `uv-test`

This was introduced by #17551 (splitting TestContext into a dedicated uv-test crate). macOS and Windows CI already use --no-default-features with explicit feature lists, so they are unaffected. Linux CI needed test-defaults added to its explicit feature list.

Test plan

  • cargo check -p uv succeeds with the new default features
  • Verify cargo install --path crates/uv succeeds
  • CI passes with test-defaults explicitly enabled for Linux

The `test-defaults` feature propagates features to `uv-test`, a
dev-dependency. Since `cargo install` strips dev-dependencies, this
caused installation to fail with "does not have a dependency named
uv-test". Move the feature to an explicit opt-in in CI instead.
@jeffs
Copy link
Author

jeffs commented Feb 7, 2026

CI hit a 502 downloading Python.

warning: `C:\Users\runneradmin\.local\bin` is not on your PATH. To use installed Python executables, run `$env:PATH = "C:\Users\runneradmin\.local\bin;$env:PATH"` or `uv python update-shell`.
error: Failed to install cpython-3.9.20-windows-x86_64-none
  Caused by: Request failed after 3 retries
  Caused by: Failed to download https://github.com/astral-sh/python-build-standalone/releases/download/20241016/cpython-3.9.20%2B20241016-x86_64-pc-windows-msvc-install_only_stripped.tar.gz
  Caused by: HTTP status server error (502 Bad Gateway) for url (https://github.com/astral-sh/python-build-standalone/releases/download/20241016/cpython-3.9.20%2B20241016-x86_64-pc-windows-msvc-install_only_stripped.tar.gz)

@zanieb
Copy link
Member

zanieb commented Feb 7, 2026

Hm, sorry I broke this — I did not foresee that.

I think we need it in the default feature set for local development to be palatable though.

@konstin
Copy link
Member

konstin commented Feb 10, 2026

I added a workaround in #17954

@konstin konstin marked this pull request as draft February 10, 2026 12:00
@jeffs jeffs closed this Feb 10, 2026
@jeffs jeffs deleted the fix-cargo-install branch February 10, 2026 12:48
zanieb pushed a commit that referenced this pull request Feb 10, 2026
The uv crate has uv-test as dev-dependency. We want that by default, uv
runs tests with `uv-test/git`, so it's a default feature in uv. The
problem is that uv-test is only a dev dependency, which gets stripped by
`cargo install`, and `cargo install` fails with a missing crate error.

As workaround, we make `uv-test` a regular optional dependency. It's
never used as a regular dependency, but it allows using `uv-test?/git`
as default feature.

Closes #17908
Fixes #17955
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants