From f3d50129c669960b8753deb002f42cec096042e5 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Thu, 5 Feb 2026 08:06:13 -0600 Subject: [PATCH] Update uv test features to use `test-` as a prefix (#17860) I'll roll this into 0.10 even though it isn't breaking for "users". --------- Co-authored-by: Claude --- .github/workflows/test.yml | 6 +- crates/uv/Cargo.toml | 42 ++++---- crates/uv/tests/it/branching_urls.rs | 16 +-- crates/uv/tests/it/build_backend.rs | 10 +- crates/uv/tests/it/common/mod.rs | 2 +- crates/uv/tests/it/edit.rs | 54 +++++----- crates/uv/tests/it/export.rs | 20 ++-- crates/uv/tests/it/extract.rs | 2 +- crates/uv/tests/it/init.rs | 10 +- crates/uv/tests/it/lock.rs | 48 ++++----- crates/uv/tests/it/lock_scenarios.rs | 2 +- crates/uv/tests/it/main.rs | 80 ++++++++------- crates/uv/tests/it/network.rs | 8 +- crates/uv/tests/it/pip_compile.rs | 102 +++++++++---------- crates/uv/tests/it/pip_compile_scenarios.rs | 6 +- crates/uv/tests/it/pip_install.rs | 60 +++++------ crates/uv/tests/it/pip_install_scenarios.rs | 4 +- crates/uv/tests/it/pip_list.rs | 26 ++--- crates/uv/tests/it/pip_show.rs | 24 ++--- crates/uv/tests/it/pip_sync.rs | 18 ++-- crates/uv/tests/it/pip_tree.rs | 42 ++++---- crates/uv/tests/it/pip_uninstall.rs | 12 +-- crates/uv/tests/it/python_find.rs | 10 +- crates/uv/tests/it/python_list.rs | 2 +- crates/uv/tests/it/python_module.rs | 2 +- crates/uv/tests/it/python_pin.rs | 2 +- crates/uv/tests/it/run.rs | 2 +- crates/uv/tests/it/sync.rs | 20 ++-- crates/uv/tests/it/tool_install.rs | 6 +- crates/uv/tests/it/tool_run.rs | 4 +- crates/uv/tests/it/venv.rs | 6 +- crates/uv/tests/it/version.rs | 6 +- crates/uv/tests/it/workspace.rs | 44 ++++---- scripts/scenarios/templates/compile.mustache | 4 +- scripts/scenarios/templates/install.mustache | 4 +- scripts/scenarios/templates/lock.mustache | 2 +- 36 files changed, 356 insertions(+), 352 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ffac6da5c..ba20c0967 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -73,7 +73,7 @@ jobs: run: | cargo nextest run \ --cargo-profile fast-build \ - --features python-patch,native-auth,secret-service \ + --features test-python-patch,native-auth,secret-service \ --workspace \ --profile ci-linux @@ -118,7 +118,7 @@ jobs: cargo nextest run \ --cargo-profile fast-build \ --no-default-features \ - --features python,python-managed,pypi,git,git-lfs,performance,crates-io,native-auth,apple-native \ + --features test-python,test-python-managed,test-pypi,test-git,test-git-lfs,performance,test-crates-io,native-auth,apple-native \ --workspace \ --profile ci-macos @@ -180,7 +180,7 @@ jobs: cargo nextest run \ --cargo-profile fast-build \ --no-default-features \ - --features python,pypi,python-managed,native-auth,windows-native \ + --features test-python,test-pypi,test-python-managed,native-auth,windows-native \ --workspace \ --profile ci-windows \ --partition hash:${{ matrix.partition }}/3 diff --git a/crates/uv/Cargo.toml b/crates/uv/Cargo.toml index 28a3c10bd..3ebedd2ac 100644 --- a/crates/uv/Cargo.toml +++ b/crates/uv/Cargo.toml @@ -158,7 +158,7 @@ nix = { workspace = true } uv-unix = { workspace = true } [features] -default = ["performance", "uv-distribution/static", "default-tests"] +default = ["performance", "uv-distribution/static", "test-defaults"] native-auth = [] # Use better memory allocators, etc. performance = ["performance-memory-allocator"] @@ -172,38 +172,38 @@ self-update = ["axoupdater", "uv-cli/self-update"] tracing-durations-export = ["dep:tracing-durations-export", "uv-resolver/tracing-durations-export", "uv-settings/tracing-durations-export"] # Features that only apply when running tests, no-ops otherwise. -default-tests = [ - "crates-io", - "git", - "git-lfs", - "pypi", - "r2", - "python", - "python-managed", - "python-eol", - "slow-tests", +test-defaults = [ + "test-crates-io", + "test-git", + "test-git-lfs", + "test-pypi", + "test-r2", + "test-python", + "test-python-managed", + "test-python-eol", + "test-slow", "test-ecosystem" ] # Introduces a testing dependency on crates.io. -crates-io = [] +test-crates-io = [] # Introduces a testing dependency on Git. -git = [] +test-git = [] # Introduces a testing dependency on Git LFS. -git-lfs = ["git"] +test-git-lfs = ["test-git"] # Introduces a testing dependency on PyPI. -pypi = [] +test-pypi = [] # Introduces a testing dependency on R2. -r2 = [] +test-r2 = [] # Introduces a testing dependency on a local Python installation. -python = [] +test-python = [] # Introduces a testing dependency on a local Python installation with specific patch versions. -python-patch = [] +test-python-patch = [] # Introduces a testing dependency on a local Python installation with an EOL version. -python-eol = [] +test-python-eol = [] # Introduces a testing dependency on managed Python installations. -python-managed = [] +test-python-managed = [] # Include "slow" test cases. -slow-tests = [] +test-slow = [] # Includes test cases that require ecosystem packages test-ecosystem = [] # Build uvw binary on Windows diff --git a/crates/uv/tests/it/branching_urls.rs b/crates/uv/tests/it/branching_urls.rs index b2834e453..9251139ba 100644 --- a/crates/uv/tests/it/branching_urls.rs +++ b/crates/uv/tests/it/branching_urls.rs @@ -12,7 +12,7 @@ use crate::common::{TestContext, make_project, uv_snapshot}; /// ] /// ``` #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn branching_urls_disjoint() -> Result<()> { let context = TestContext::new("3.12"); @@ -46,7 +46,7 @@ fn branching_urls_disjoint() -> Result<()> { /// ] /// ``` #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn branching_urls_overlapping() -> Result<()> { let context = TestContext::new("3.12"); @@ -84,7 +84,7 @@ fn branching_urls_overlapping() -> Result<()> { /// a -> b -> b2 -> https://../iniconfig-2.0.0-py3-none-any.whl /// ``` #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn root_package_splits_but_transitive_conflict() -> Result<()> { let context = TestContext::new("3.12"); @@ -155,7 +155,7 @@ fn root_package_splits_but_transitive_conflict() -> Result<()> { /// a -> b -> b2 ; python_version >= '3.12' -> https://../iniconfig-2.0.0-py3-none-any.whl /// ``` #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn root_package_splits_transitive_too() -> Result<()> { let context = TestContext::new("3.12"); @@ -361,7 +361,7 @@ fn root_package_splits_transitive_too() -> Result<()> { /// a -> b2 ; python_version >= '3.12' -> iniconfig==2.0.0 /// ``` #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn root_package_splits_other_dependencies_too() -> Result<()> { let context = TestContext::new("3.12"); @@ -545,7 +545,7 @@ fn root_package_splits_other_dependencies_too() -> Result<()> { /// ] /// ``` #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn branching_between_registry_and_direct_url() -> Result<()> { let context = TestContext::new("3.12"); @@ -631,7 +631,7 @@ fn branching_between_registry_and_direct_url() -> Result<()> { /// ] /// ``` #[test] -#[cfg(all(feature = "git", feature = "pypi"))] +#[cfg(all(feature = "test-git", feature = "test-pypi"))] fn branching_urls_of_different_sources_disjoint() -> Result<()> { let context = TestContext::new("3.12"); @@ -715,7 +715,7 @@ fn branching_urls_of_different_sources_disjoint() -> Result<()> { /// ] /// ``` #[test] -#[cfg(all(feature = "git", feature = "pypi"))] +#[cfg(all(feature = "test-git", feature = "test-pypi"))] fn branching_urls_of_different_sources_conflict() -> Result<()> { let context = TestContext::new("3.12"); diff --git a/crates/uv/tests/it/build_backend.rs b/crates/uv/tests/it/build_backend.rs index 446e95cfe..8ecff12cd 100644 --- a/crates/uv/tests/it/build_backend.rs +++ b/crates/uv/tests/it/build_backend.rs @@ -24,7 +24,7 @@ const BUILT_BY_UV_TEST_SCRIPT: &str = indoc! {r#" /// /// We can't test end-to-end here including the PEP 517 bridge code since we don't have a uv wheel. #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn built_by_uv_direct_wheel() -> Result<()> { let context = TestContext::new("3.12"); let built_by_uv = Path::new("../../test/packages/built-by-uv"); @@ -80,7 +80,7 @@ fn built_by_uv_direct_wheel() -> Result<()> { /// We can't test end-to-end here including the PEP 517 bridge code since we don't have a uv wheel, /// so we call the build backend directly. #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn built_by_uv_direct() -> Result<()> { let context = TestContext::new("3.12"); let built_by_uv = Path::new("../../test/packages/built-by-uv"); @@ -154,7 +154,7 @@ fn built_by_uv_direct() -> Result<()> { /// We can't test end-to-end here including the PEP 517 bridge code since we don't have a uv wheel, /// so we call the build backend directly. #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn built_by_uv_editable() -> Result<()> { let context = TestContext::new("3.12"); let built_by_uv = Path::new("../../test/packages/built-by-uv"); @@ -212,7 +212,7 @@ fn built_by_uv_editable() -> Result<()> { Ok(()) } -#[cfg(all(unix, feature = "git"))] +#[cfg(all(unix, feature = "test-git"))] #[test] fn preserve_executable_bit() -> Result<()> { use std::io::Write; @@ -1223,7 +1223,7 @@ fn invalid_pyproject_toml() -> Result<()> { Ok(()) } -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] #[test] fn build_with_all_metadata() -> Result<()> { let context = TestContext::new("3.12"); diff --git a/crates/uv/tests/it/common/mod.rs b/crates/uv/tests/it/common/mod.rs index 279c2d2dc..8da198e30 100755 --- a/crates/uv/tests/it/common/mod.rs +++ b/crates/uv/tests/it/common/mod.rs @@ -671,7 +671,7 @@ impl TestContext { fs_err::create_dir_all(&bin_dir).expect("Failed to create test bin directory"); // When the `git` feature is disabled, enforce that the test suite does not use `git` - if cfg!(not(feature = "git")) { + if cfg!(not(feature = "test-git")) { Self::disallow_git_cli(&bin_dir).expect("Failed to setup disallowed `git` command"); } diff --git a/crates/uv/tests/it/edit.rs b/crates/uv/tests/it/edit.rs index 7adf5a557..8773aeb45 100644 --- a/crates/uv/tests/it/edit.rs +++ b/crates/uv/tests/it/edit.rs @@ -1,11 +1,11 @@ #![allow(clippy::disallowed_types)] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] mod conditional_imports { pub(crate) use crate::common::{READ_ONLY_GITHUB_TOKEN, decode_token}; } -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] use conditional_imports::*; use anyhow::Result; @@ -17,7 +17,7 @@ use std::path::Path; use url::Url; use wiremock::{Mock, MockServer, ResponseTemplate, matchers::method, matchers::path}; -#[cfg(feature = "git-lfs")] +#[cfg(feature = "test-git-lfs")] use uv_cache_key::{RepositoryUrl, cache_digest}; use uv_fs::Simplified; use uv_static::EnvVars; @@ -144,7 +144,7 @@ fn add_registry() -> Result<()> { /// Add a Git requirement. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn add_git() -> Result<()> { let context = TestContext::new("3.12"); @@ -308,7 +308,7 @@ fn add_git() -> Result<()> { /// Add a Git requirement from a private repository, with credentials. The resolution should /// succeed, but the `pyproject.toml` should omit the credentials. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn add_git_private_source() -> Result<()> { let context = TestContext::new("3.12"); let token = decode_token(READ_ONLY_GITHUB_TOKEN); @@ -404,7 +404,7 @@ fn add_git_private_source() -> Result<()> { /// Add a Git requirement from a private repository, with credentials. Since `--raw-sources` is /// specified, the `pyproject.toml` should retain the credentials. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn add_git_private_raw() -> Result<()> { let context = TestContext::new("3.12"); let token = decode_token(READ_ONLY_GITHUB_TOKEN); @@ -497,7 +497,7 @@ fn add_git_private_raw() -> Result<()> { } #[tokio::test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] async fn add_git_private_rate_limited_by_github_rest_api_403_response() -> Result<()> { let context = TestContext::new("3.12"); let token = decode_token(READ_ONLY_GITHUB_TOKEN); @@ -537,7 +537,7 @@ async fn add_git_private_rate_limited_by_github_rest_api_403_response() -> Resul } #[tokio::test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] async fn add_git_private_rate_limited_by_github_rest_api_429_response() -> Result<()> { use uv_client::DEFAULT_RETRIES; @@ -580,7 +580,7 @@ async fn add_git_private_rate_limited_by_github_rest_api_429_response() -> Resul } #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn add_git_error() -> Result<()> { let context = TestContext::new("3.12"); @@ -635,7 +635,7 @@ fn add_git_error() -> Result<()> { } #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn add_git_branch() -> Result<()> { let context = TestContext::new("3.12"); @@ -664,7 +664,7 @@ fn add_git_branch() -> Result<()> { } #[test] -#[cfg(feature = "git-lfs")] +#[cfg(feature = "test-git-lfs")] fn add_git_lfs() -> Result<()> { let context = TestContext::new("3.13").with_git_lfs_config(); @@ -895,7 +895,7 @@ fn add_git_lfs() -> Result<()> { /// Add a Git requirement using the `--raw-sources` API. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn add_git_raw() -> Result<()> { let context = TestContext::new("3.12"); @@ -1045,7 +1045,7 @@ fn add_git_raw() -> Result<()> { /// Add a Git requirement without the `git+` prefix. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn add_git_implicit() -> Result<()> { let context = TestContext::new("3.12"); @@ -1098,7 +1098,7 @@ fn add_git_implicit() -> Result<()> { /// `--raw-sources` should be considered conflicting with sources-specific arguments, like `--tag`. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn add_raw_error() -> Result<()> { let context = TestContext::new("3.12"); @@ -1182,7 +1182,7 @@ fn reinstall_local_source_trees() -> Result<()> { } #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn add_editable_error() -> Result<()> { let context = TestContext::new("3.12"); @@ -1210,7 +1210,7 @@ fn add_editable_error() -> Result<()> { /// Add an unnamed requirement. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn add_unnamed() -> Result<()> { let context = TestContext::new("3.12"); @@ -1798,7 +1798,7 @@ fn add_remove_inline_optional() -> Result<()> { /// Add and remove a workspace dependency. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn add_remove_workspace() -> Result<()> { let context = TestContext::new("3.12"); @@ -3109,7 +3109,7 @@ fn add_path_adjacent_directory() -> Result<()> { /// Update a requirement, modifying the source and extras. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn update() -> Result<()> { let context = TestContext::new("3.12"); @@ -3580,7 +3580,7 @@ fn add_update_marker() -> Result<()> { } #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn update_source_replace_url() -> Result<()> { let context = TestContext::new("3.12"); @@ -3675,7 +3675,7 @@ fn update_source_replace_url() -> Result<()> { /// If a source defined in `tool.uv.sources` but its name is not normalized, `uv add` should not /// add the same source again. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn add_non_normalized_source() -> Result<()> { let context = TestContext::new("3.12"); @@ -3732,7 +3732,7 @@ fn add_non_normalized_source() -> Result<()> { /// Test updating an existing Git reference with branch/tag/rev options without re- specifying the /// URL. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn add_update_git_reference_project() -> Result<()> { let context = TestContext::new("3.12"); @@ -3804,7 +3804,7 @@ fn add_update_git_reference_project() -> Result<()> { /// Test updating an existing Git reference with branch/tag/rev options without re-specifying the /// URL in a script. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn add_update_git_reference_script() -> Result<()> { let context = TestContext::new("3.12"); let script = context.temp_dir.child("script.py"); @@ -3892,7 +3892,7 @@ fn add_update_git_reference_script() -> Result<()> { /// If a source defined in `tool.uv.sources` but its name is not normalized, `uv remove` should /// remove the source. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn remove_non_normalized_source() -> Result<()> { let context = TestContext::new("3.12"); @@ -5514,7 +5514,7 @@ fn add_repeat() -> Result<()> { /// Add from requirement file. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn add_requirements_file() -> Result<()> { let context = TestContext::new("3.12").with_filtered_counts(); @@ -8333,7 +8333,7 @@ fn remove_last_dep_script() -> Result<()> { /// Add a Git requirement to PEP 723 script. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn add_git_to_script() -> Result<()> { let context = TestContext::new("3.12"); @@ -12984,7 +12984,7 @@ fn add_with_build_constraints() -> Result<()> { } #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn add_unsupported_git_scheme() { let context = TestContext::new("3.12"); @@ -14825,7 +14825,7 @@ fn add_no_install_project() -> Result<()> { } #[test] -#[cfg(feature = "git-lfs")] +#[cfg(feature = "test-git-lfs")] fn add_git_lfs_error() -> Result<()> { let context = TestContext::new("3.13").with_git_lfs_config(); diff --git a/crates/uv/tests/it/export.rs b/crates/uv/tests/it/export.rs index 074cc9464..40930cfbe 100644 --- a/crates/uv/tests/it/export.rs +++ b/crates/uv/tests/it/export.rs @@ -1,6 +1,6 @@ #![allow(clippy::disallowed_types)] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] use crate::common::{READ_ONLY_GITHUB_SSH_DEPLOY_KEY, READ_ONLY_GITHUB_TOKEN, decode_token}; use crate::common::{TestContext, apply_filters, copy_dir_ignore, uv_snapshot}; use anyhow::{Ok, Result}; @@ -8,10 +8,10 @@ use assert_cmd::assert::OutputAssertExt; use assert_fs::prelude::*; use indoc::{formatdoc, indoc}; use insta::assert_snapshot; -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] use std::path::Path; use std::process::Stdio; -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] use uv_fs::Simplified; use uv_static::EnvVars; @@ -1241,7 +1241,7 @@ fn virtual_dependency_group() -> Result<()> { Ok(()) } -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] #[test] fn requirements_txt_https_git_credentials() -> Result<()> { let context = TestContext::new("3.12"); @@ -1277,7 +1277,7 @@ fn requirements_txt_https_git_credentials() -> Result<()> { /// SSH blocks too permissive key files, so we need to scope permissions for the file to the current /// user. -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn reduce_ssh_key_file_permissions(key_file: &Path) -> Result<()> { #[cfg(unix)] { @@ -1306,7 +1306,7 @@ fn reduce_ssh_key_file_permissions(key_file: &Path) -> Result<()> { } /// Don't redact the username `git` in SSH URLs. -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] #[test] fn requirements_txt_ssh_git_username() -> Result<()> { let context = TestContext::new("3.12"); @@ -4148,7 +4148,7 @@ fn pep_751_project_extra() -> Result<()> { } #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn pep_751_git_dependency() -> Result<()> { let context = TestContext::new("3.12"); @@ -4529,7 +4529,7 @@ fn pep_751_filename() -> Result<()> { Ok(()) } -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] #[test] fn pep_751_https_git_credentials() -> Result<()> { let context = TestContext::new("3.12"); @@ -5039,7 +5039,7 @@ fn cyclonedx_export_direct_url() -> Result<()> { Ok(()) } -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] #[test] fn cyclonedx_export_git_dependency() -> Result<()> { let context = TestContext::new("3.12").with_cyclonedx_filters(); @@ -5190,7 +5190,7 @@ fn cyclonedx_export_no_dependencies() -> Result<()> { Ok(()) } -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] #[test] fn cyclonedx_export_mixed_source_types() -> Result<()> { let context = TestContext::new("3.12").with_cyclonedx_filters(); diff --git a/crates/uv/tests/it/extract.rs b/crates/uv/tests/it/extract.rs index b0ed62690..2ebf06ec6 100644 --- a/crates/uv/tests/it/extract.rs +++ b/crates/uv/tests/it/extract.rs @@ -1,4 +1,4 @@ -#![cfg(feature = "r2")] +#![cfg(feature = "test-r2")] use backon::{BackoffBuilder, Retryable}; use futures::TryStreamExt; diff --git a/crates/uv/tests/it/init.rs b/crates/uv/tests/it/init.rs index d492ed9ab..f12983ab1 100644 --- a/crates/uv/tests/it/init.rs +++ b/crates/uv/tests/it/init.rs @@ -939,7 +939,7 @@ fn init_script_shebang() -> Result<()> { // Make sure that `uv init --script` picks the latest non-pre-release version of Python // for the `requires-python` constraint. -#[cfg(feature = "python-patch")] +#[cfg(feature = "test-python-patch")] #[test] fn init_script_picks_latest_stable_version() -> Result<()> { let managed_versions = &["3.14.0rc2", "3.13", "3.12"]; @@ -2802,7 +2802,7 @@ fn init_failure_with_invalid_option_named_backend() { "); } #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn init_git() -> Result<()> { let context = TestContext::new("3.12"); @@ -2863,7 +2863,7 @@ fn init_vcs_none() { /// Run `uv init` from within a Git repository. Do not try to reinitialize one. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn init_inside_git_repo() { let context = TestContext::new("3.12"); @@ -3336,7 +3336,7 @@ fn init_library_poetry() -> Result<()> { /// Run `uv init --app --package --build-backend maturin` to create a packaged application project #[test] -#[cfg(feature = "crates-io")] +#[cfg(feature = "test-crates-io")] fn init_app_build_backend_maturin() -> Result<()> { let context = TestContext::new("3.12"); @@ -3591,7 +3591,7 @@ fn init_app_build_backend_scikit() -> Result<()> { /// Run `uv init --lib --build-backend maturin` to create a packaged application project #[test] -#[cfg(feature = "crates-io")] +#[cfg(feature = "test-crates-io")] fn init_lib_build_backend_maturin() -> Result<()> { let context = TestContext::new("3.12"); diff --git a/crates/uv/tests/it/lock.rs b/crates/uv/tests/it/lock.rs index c490ba2d0..9107096cf 100644 --- a/crates/uv/tests/it/lock.rs +++ b/crates/uv/tests/it/lock.rs @@ -6,7 +6,7 @@ use insta::assert_snapshot; use std::io::BufReader; use url::Url; -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] use crate::common::{READ_ONLY_GITHUB_TOKEN, decode_token}; use crate::common::{ TestContext, build_vendor_links_url, download_to_disk, packse_index_url, uv_snapshot, @@ -242,7 +242,7 @@ fn lock_sdist_registry() -> Result<()> { /// Lock a Git requirement using `tool.uv.sources`. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn lock_sdist_git() -> Result<()> { let context = TestContext::new("3.12"); @@ -512,7 +512,7 @@ fn lock_sdist_git() -> Result<()> { /// Lock a Git requirement using PEP 508. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn lock_sdist_git_subdirectory() -> Result<()> { let context = TestContext::new("3.12"); @@ -606,7 +606,7 @@ fn lock_sdist_git_subdirectory() -> Result<()> { /// Lock a Git requirement using PEP 508. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn lock_sdist_git_pep508() -> Result<()> { let context = TestContext::new("3.12"); @@ -841,7 +841,7 @@ fn lock_sdist_git_pep508() -> Result<()> { /// Lock a Git requirement using `tool.uv.sources` with a short revision. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn lock_sdist_git_short_rev() -> Result<()> { let context = TestContext::new("3.12"); @@ -2421,7 +2421,7 @@ fn lock_dependency_extra() -> Result<()> { } /// Lock a project with a dependency that has a conditional extra. -#[cfg(feature = "python-eol")] +#[cfg(feature = "test-python-eol")] #[test] fn lock_conditional_dependency_extra() -> Result<()> { let context = TestContext::new("3.12"); @@ -4750,7 +4750,7 @@ fn lock_preference() -> Result<()> { /// If the user includes `git+` in a `tool.uv.sources` entry, we shouldn't fail. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn lock_git_plus_prefix() -> Result<()> { let context = TestContext::new("3.12"); @@ -4836,7 +4836,7 @@ fn lock_git_plus_prefix() -> Result<()> { } #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn lock_partial_git() -> Result<()> { let context = TestContext::new("3.12"); @@ -5077,7 +5077,7 @@ fn lock_unsupported_tag() -> Result<()> { /// Respect locked versions with `uv lock`, unless `--upgrade` is passed. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn lock_git_sha() -> Result<()> { let context = TestContext::new("3.12"); @@ -6004,7 +6004,7 @@ fn lock_requires_python_upper() -> Result<()> { } /// Lock a requirement from PyPI with an exact Python bound. -#[cfg(feature = "python-patch")] +#[cfg(feature = "test-python-patch")] #[test] fn lock_requires_python_exact() -> Result<()> { let context = TestContext::new("3.13.0"); @@ -6084,7 +6084,7 @@ fn lock_requires_python_exact() -> Result<()> { } /// Lock a requirement from PyPI with a compatible release Python bound. -#[cfg(feature = "python-patch")] +#[cfg(feature = "test-python-patch")] #[test] fn lock_requires_python_compatible_specifier() -> Result<()> { let context = TestContext::new("3.13.0"); @@ -10024,7 +10024,7 @@ fn lock_index_url_username_change_no_update() -> Result<()> { } #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn lock_redact_git_pep508() -> Result<()> { let context = TestContext::new("3.12").with_filtered_link_mode_warning(); let token = decode_token(READ_ONLY_GITHUB_TOKEN); @@ -10109,7 +10109,7 @@ fn lock_redact_git_pep508() -> Result<()> { } #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn lock_redact_git_sources() -> Result<()> { let context = TestContext::new("3.12").with_filtered_link_mode_warning(); let token = decode_token(READ_ONLY_GITHUB_TOKEN); @@ -10197,7 +10197,7 @@ fn lock_redact_git_sources() -> Result<()> { } #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn lock_redact_git_pep508_non_project() -> Result<()> { let context = TestContext::new("3.12").with_filtered_link_mode_warning(); let token = decode_token(READ_ONLY_GITHUB_TOKEN); @@ -13508,7 +13508,7 @@ fn lock_transitive_extra() -> Result<()> { /// If a source is provided via `tool.uv.sources` _and_ a URL is provided in `project.dependencies`, /// we accept the source in `tool.uv.sources`, unless `--no-sources` is provided. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn lock_mismatched_sources() -> Result<()> { let context = TestContext::new("3.12"); @@ -13622,7 +13622,7 @@ fn lock_mismatched_sources() -> Result<()> { /// /// See: #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn lock_mismatched_versions() -> Result<()> { let context = TestContext::new("3.12"); @@ -13709,7 +13709,7 @@ fn lock_mismatched_versions() -> Result<()> { /// Test that `--no-sources-package` allows selectively disabling sources for specific packages. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn lock_no_sources_package() -> Result<()> { let context = TestContext::new("3.12"); @@ -13814,7 +13814,7 @@ fn lock_no_sources_package() -> Result<()> { /// Test that `--no-sources-package` works with multiple packages. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn lock_no_sources_package_multiple() -> Result<()> { let context = TestContext::new("3.12"); @@ -13932,7 +13932,7 @@ fn lock_no_sources_package_multiple() -> Result<()> { /// Test that `--no-sources` takes precedence over `--no-sources-package`. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn lock_no_sources_with_no_sources_package() -> Result<()> { let context = TestContext::new("3.12"); @@ -14042,7 +14042,7 @@ fn lock_no_sources_with_no_sources_package() -> Result<()> { /// Test that `UV_NO_SOURCES_PACKAGE` environment variable works. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn lock_no_sources_package_env_var() -> Result<()> { let context = TestContext::new("3.12"); @@ -21248,7 +21248,7 @@ fn lock_dependency_metadata() -> Result<()> { } #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn lock_dependency_metadata_git() -> Result<()> { let context = TestContext::new("3.12"); @@ -24827,7 +24827,7 @@ fn lock_group_workspace() -> Result<()> { } #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn lock_transitive_git() -> Result<()> { let context = TestContext::new("3.12"); @@ -28116,7 +28116,7 @@ fn lock_split_on_windows() -> Result<()> { } #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn lock_missing_git_prefix() -> Result<()> { let context = TestContext::new("3.12"); @@ -31219,7 +31219,7 @@ fn lock_conflict_for_disjoint_python_version() -> Result<()> { } /// Check that we hint if the resolution failed for a different platform. -#[cfg(feature = "python-patch")] +#[cfg(feature = "test-python-patch")] #[test] fn lock_requires_python_empty_lock_file() -> Result<()> { // N.B. These versions were selected based on what was diff --git a/crates/uv/tests/it/lock_scenarios.rs b/crates/uv/tests/it/lock_scenarios.rs index 31e5d069c..f04566f22 100644 --- a/crates/uv/tests/it/lock_scenarios.rs +++ b/crates/uv/tests/it/lock_scenarios.rs @@ -3,7 +3,7 @@ //! Generated with `./scripts/sync_scenarios.sh` //! Scenarios from //! -#![cfg(all(feature = "python", feature = "pypi"))] +#![cfg(all(feature = "test-python", feature = "test-pypi"))] #![allow(clippy::needless_raw_string_hashes)] #![allow(clippy::doc_markdown)] #![allow(clippy::doc_lazy_continuation)] diff --git a/crates/uv/tests/it/main.rs b/crates/uv/tests/it/main.rs index 16ac12102..acef5f98f 100644 --- a/crates/uv/tests/it/main.rs +++ b/crates/uv/tests/it/main.rs @@ -7,66 +7,70 @@ mod auth; mod branching_urls; -#[cfg(all(feature = "python", feature = "pypi"))] +#[cfg(all(feature = "test-python", feature = "test-pypi"))] mod build; -#[cfg(feature = "python")] +#[cfg(feature = "test-python")] mod build_backend; -#[cfg(all(feature = "python", feature = "pypi"))] +#[cfg(all(feature = "test-python", feature = "test-pypi"))] mod cache; -#[cfg(all(feature = "python", feature = "pypi"))] +#[cfg(all(feature = "test-python", feature = "test-pypi"))] mod cache_clean; -#[cfg(all(feature = "python", feature = "pypi"))] +#[cfg(all(feature = "test-python", feature = "test-pypi"))] mod cache_prune; -#[cfg(all(feature = "python", feature = "pypi"))] +#[cfg(all(feature = "test-python", feature = "test-pypi"))] mod cache_size; -#[cfg(all(feature = "python", feature = "pypi", feature = "test-ecosystem"))] +#[cfg(all( + feature = "test-python", + feature = "test-pypi", + feature = "test-ecosystem" +))] mod ecosystem; -#[cfg(all(feature = "python", feature = "pypi"))] +#[cfg(all(feature = "test-python", feature = "test-pypi"))] mod edit; -#[cfg(all(feature = "python", feature = "pypi"))] +#[cfg(all(feature = "test-python", feature = "test-pypi"))] mod export; -#[cfg(all(feature = "python", feature = "pypi"))] +#[cfg(all(feature = "test-python", feature = "test-pypi"))] mod format; mod help; -#[cfg(all(feature = "python", feature = "pypi", feature = "git"))] +#[cfg(all(feature = "test-python", feature = "test-pypi", feature = "test-git"))] mod init; -#[cfg(all(feature = "python", feature = "pypi"))] +#[cfg(all(feature = "test-python", feature = "test-pypi"))] mod lock; -#[cfg(all(feature = "python", feature = "pypi"))] +#[cfg(all(feature = "test-python", feature = "test-pypi"))] mod lock_conflict; -#[cfg(all(feature = "python", feature = "pypi"))] +#[cfg(all(feature = "test-python", feature = "test-pypi"))] mod lock_exclude_newer_relative; mod lock_scenarios; mod network; -#[cfg(all(feature = "python", feature = "pypi"))] +#[cfg(all(feature = "test-python", feature = "test-pypi"))] mod pip_check; -#[cfg(all(feature = "python", feature = "pypi"))] +#[cfg(all(feature = "test-python", feature = "test-pypi"))] mod pip_compile; mod pip_compile_scenarios; -#[cfg(all(feature = "python", feature = "pypi"))] +#[cfg(all(feature = "test-python", feature = "test-pypi"))] mod pip_freeze; -#[cfg(all(feature = "python", feature = "pypi"))] +#[cfg(all(feature = "test-python", feature = "test-pypi"))] mod pip_install; mod pip_install_scenarios; @@ -75,75 +79,75 @@ mod pip_list; mod pip_show; -#[cfg(all(feature = "python", feature = "pypi"))] +#[cfg(all(feature = "test-python", feature = "test-pypi"))] mod pip_sync; mod pip_debug; mod pip_tree; mod pip_uninstall; -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] mod publish; mod python_dir; -#[cfg(feature = "python")] +#[cfg(feature = "test-python")] mod python_find; -#[cfg(feature = "python")] +#[cfg(feature = "test-python")] mod python_list; -#[cfg(all(feature = "python", feature = "pypi"))] +#[cfg(all(feature = "test-python", feature = "test-pypi"))] mod python_module; -#[cfg(feature = "python-managed")] +#[cfg(feature = "test-python-managed")] mod python_install; -#[cfg(feature = "python")] +#[cfg(feature = "test-python")] mod python_pin; -#[cfg(feature = "python-managed")] +#[cfg(feature = "test-python-managed")] mod python_upgrade; -#[cfg(all(feature = "python", feature = "pypi"))] +#[cfg(all(feature = "test-python", feature = "test-pypi"))] mod run; #[cfg(feature = "self-update")] mod self_update; -#[cfg(all(feature = "python", feature = "pypi"))] +#[cfg(all(feature = "test-python", feature = "test-pypi"))] mod show_settings; -#[cfg(all(feature = "python", feature = "pypi"))] +#[cfg(all(feature = "test-python", feature = "test-pypi"))] mod sync; -#[cfg(all(feature = "python", feature = "pypi"))] +#[cfg(all(feature = "test-python", feature = "test-pypi"))] mod tool_dir; -#[cfg(all(feature = "python", feature = "pypi"))] +#[cfg(all(feature = "test-python", feature = "test-pypi"))] mod tool_install; -#[cfg(all(feature = "python", feature = "pypi"))] +#[cfg(all(feature = "test-python", feature = "test-pypi"))] mod tool_list; -#[cfg(all(feature = "python", feature = "pypi"))] +#[cfg(all(feature = "test-python", feature = "test-pypi"))] mod tool_run; -#[cfg(all(feature = "python", feature = "pypi"))] +#[cfg(all(feature = "test-python", feature = "test-pypi"))] mod tool_uninstall; -#[cfg(all(feature = "python", feature = "pypi"))] +#[cfg(all(feature = "test-python", feature = "test-pypi"))] mod tool_upgrade; -#[cfg(all(feature = "python", feature = "pypi"))] +#[cfg(all(feature = "test-python", feature = "test-pypi"))] mod tree; -#[cfg(feature = "python")] +#[cfg(feature = "test-python")] mod venv; mod version; -#[cfg(all(feature = "python", feature = "pypi"))] +#[cfg(all(feature = "test-python", feature = "test-pypi"))] mod workflow; mod extract; diff --git a/crates/uv/tests/it/network.rs b/crates/uv/tests/it/network.rs index e72139600..3df451ab0 100644 --- a/crates/uv/tests/it/network.rs +++ b/crates/uv/tests/it/network.rs @@ -764,7 +764,7 @@ async fn proxy_invalid_url_not_a_url_in_uv_toml() { } /// Test that valid proxy URL in uv.toml routes requests through the proxy. -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] #[tokio::test] async fn proxy_valid_url_in_uv_toml() { let context = TestContext::new("3.12"); @@ -823,7 +823,7 @@ async fn proxy_valid_url_in_uv_toml() { } /// Test that https-proxy in uv.toml routes HTTPS requests through a CONNECT tunnel proxy. -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] #[test] fn proxy_https_proxy_in_uv_toml() { let context = TestContext::new("3.12"); @@ -860,7 +860,7 @@ fn proxy_https_proxy_in_uv_toml() { } /// Test that no-proxy in uv.toml bypasses the proxy for specified hosts. -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] #[tokio::test] async fn proxy_no_proxy_in_uv_toml() { let context = TestContext::new("3.12"); @@ -928,7 +928,7 @@ no-proxy = ["{target_host}"] } /// Test that proxy URLs without a scheme in uv.toml default to http://. -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] #[tokio::test] async fn proxy_schemeless_url_in_uv_toml() { let context = TestContext::new("3.12"); diff --git a/crates/uv/tests/it/pip_compile.rs b/crates/uv/tests/it/pip_compile.rs index 09daf52f3..5091b037e 100644 --- a/crates/uv/tests/it/pip_compile.rs +++ b/crates/uv/tests/it/pip_compile.rs @@ -2113,7 +2113,7 @@ fn omit_non_matching_annotation() -> Result<()> { /// Test that we select the last 3.8 compatible numpy version instead of trying to compile an /// incompatible sdist -#[cfg(feature = "python-eol")] +#[cfg(feature = "test-python-eol")] #[test] fn compile_numpy_py38() -> Result<()> { let context = TestContext::new("3.8"); @@ -2222,7 +2222,7 @@ fn compile_sdist_url_dependency() -> Result<()> { /// Resolve a specific source distribution via a Git HTTPS dependency. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn compile_git_https_dependency() -> Result<()> { let context = TestContext::new("3.12"); let requirements_in = context.temp_dir.child("requirements.in"); @@ -2255,7 +2255,7 @@ fn compile_git_https_dependency() -> Result<()> { /// Resolve a specific branch via a Git HTTPS dependency. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn compile_git_branch_https_dependency() -> Result<()> { let context = TestContext::new("3.12"); let requirements_in = context.temp_dir.child("requirements.in"); @@ -2283,7 +2283,7 @@ fn compile_git_branch_https_dependency() -> Result<()> { /// Resolve a specific tag via a Git HTTPS dependency. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn compile_git_tag_https_dependency() -> Result<()> { let context = TestContext::new("3.12"); let requirements_in = context.temp_dir.child("requirements.in"); @@ -2313,7 +2313,7 @@ fn compile_git_tag_https_dependency() -> Result<()> { /// /// In this case, the tag is a date, and thus could feasibly refer to a short commit hash. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn compile_git_date_tag_https_dependency() -> Result<()> { let context = TestContext::new("3.12"); let requirements_in = context.temp_dir.child("requirements.in"); @@ -2341,7 +2341,7 @@ fn compile_git_date_tag_https_dependency() -> Result<()> { /// Resolve a specific commit via a Git HTTPS dependency. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn compile_git_long_commit_https_dependency() -> Result<()> { let context = TestContext::new("3.12"); let requirements_in = context.temp_dir.child("requirements.in"); @@ -2369,7 +2369,7 @@ fn compile_git_long_commit_https_dependency() -> Result<()> { /// Resolve a specific commit via a Git HTTPS dependency. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn compile_git_short_commit_https_dependency() -> Result<()> { let context = TestContext::new("3.12"); let requirements_in = context.temp_dir.child("requirements.in"); @@ -2397,7 +2397,7 @@ fn compile_git_short_commit_https_dependency() -> Result<()> { /// Resolve a specific ref via a Git HTTPS dependency. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn compile_git_refs_https_dependency() -> Result<()> { let context = TestContext::new("3.12"); let requirements_in = context.temp_dir.child("requirements.in"); @@ -2424,7 +2424,7 @@ fn compile_git_refs_https_dependency() -> Result<()> { /// Resolve a specific Git dependency with a subdirectory. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn compile_git_subdirectory_dependency() -> Result<()> { let context = TestContext::new("3.12"); let requirements_in = context.temp_dir.child("requirements.in"); @@ -2450,7 +2450,7 @@ fn compile_git_subdirectory_dependency() -> Result<()> { /// Resolve two packages from a `requirements.in` file with the same Git HTTPS dependency. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn compile_git_concurrent_access() -> Result<()> { let context = TestContext::new("3.12"); let requirements_in = context.temp_dir.child("requirements.in"); @@ -2479,7 +2479,7 @@ fn compile_git_concurrent_access() -> Result<()> { /// Resolve two packages from a `requirements.in` file with the same Git HTTPS dependency. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn compile_git_unnamed_concurrent_access() -> Result<()> { let context = TestContext::new("3.12"); let requirements_in = context.temp_dir.child("requirements.in"); @@ -2508,7 +2508,7 @@ fn compile_git_unnamed_concurrent_access() -> Result<()> { /// Resolve a Git dependency with a declared name that differs from the true name of the package. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn compile_git_mismatched_name() -> Result<()> { let context = TestContext::new("3.12"); let requirements_in = context.temp_dir.child("requirements.in"); @@ -2533,7 +2533,7 @@ fn compile_git_mismatched_name() -> Result<()> { /// Resolve a specific Git dependency with a subdirectory, where the root directory contains a /// static `pyproject.toml` file. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn compile_git_subdirectory_static_metadata() -> Result<()> { let context = TestContext::new("3.12"); @@ -2704,7 +2704,7 @@ fn conflicting_repeated_url_dependency_markers() -> Result<()> { /// Request Werkzeug via two different URLs at the same version. Despite mapping to the same /// version, it should still result in a conflict. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn conflicting_repeated_url_dependency_version_match() -> Result<()> { let context = TestContext::new("3.12"); let requirements_in = context.temp_dir.child("requirements.in"); @@ -2751,7 +2751,7 @@ fn conflicting_transitive_url_dependency() -> Result<()> { } /// Request `uv-public-pypackage` via two different URLs which resolve to the same canonical version. -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] #[test] fn compatible_repeated_url_dependency() -> Result<()> { let context = TestContext::new("3.12"); @@ -2781,7 +2781,7 @@ fn compatible_repeated_url_dependency() -> Result<()> { /// Request `uv-public-pypackage` via two different URLs which resolve to the same repository, but /// different commits. -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] #[test] fn conflicting_repeated_url_dependency() -> Result<()> { let context = TestContext::new("3.12"); @@ -2809,7 +2809,7 @@ fn conflicting_repeated_url_dependency() -> Result<()> { /// Request `uv-public-pypackage` via three different URLs: `0.0.2`, a short SHA, and a precise SHA. /// All three are compatible, since they resolve to the same canonical version. -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] #[test] fn compatible_narrowed_url_dependency() -> Result<()> { let context = TestContext::new("3.12"); @@ -2840,7 +2840,7 @@ fn compatible_narrowed_url_dependency() -> Result<()> { /// Request `uv-public-pypackage` via three different URLs: a precise SHA, a short SHA, and `4.3.0`. /// All three are compatible, since they resolve to the same canonical version. -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] #[test] fn compatible_broader_url_dependency() -> Result<()> { let context = TestContext::new("3.12"); @@ -2872,7 +2872,7 @@ fn compatible_broader_url_dependency() -> Result<()> { /// Request `uv-public-pypackage` via two different URLs: `0.0.2`, and a precise SHA, followed by /// `0.0.2` again. All three are compatible, since they resolve to the same canonical version. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn compatible_repeated_narrowed_url_dependency() -> Result<()> { let context = TestContext::new("3.12"); let requirements_in = context.temp_dir.child("requirements.in"); @@ -2905,7 +2905,7 @@ fn compatible_repeated_narrowed_url_dependency() -> Result<()> { /// /// Although `0.0.2` and the precise SHA resolve to the same canonical version, `test-branch` /// resolves to a different version, so there should be a conflict. -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] #[test] fn incompatible_narrowed_url_dependency() -> Result<()> { let context = TestContext::new("3.12"); @@ -2934,7 +2934,7 @@ fn incompatible_narrowed_url_dependency() -> Result<()> { /// Request `hatchling_editable`, which depends on `https://files.pythonhosted.org/packages/ef/a6/62565a6e1cf69e10f5727360368e451d4b7f58beeac6173dc9db836a5b46/iniconfig-2.0.0-py3-none-any.whl`. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn allowed_transitive_git_dependency() -> Result<()> { let context = TestContext::new("3.12"); @@ -2964,7 +2964,7 @@ fn allowed_transitive_git_dependency() -> Result<()> { /// Request `transitive_url_dependency`, which depends on `https://files.pythonhosted.org/packages/ef/a6/62565a6e1cf69e10f5727360368e451d4b7f58beeac6173dc9db836a5b46/iniconfig-2.0.0-py3-none-any.whl`. /// Since this URL is declared as a constraint, we should accept it. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn allowed_transitive_url_dependency() -> Result<()> { let context = TestContext::new("3.12"); @@ -3002,7 +3002,7 @@ fn allowed_transitive_url_dependency() -> Result<()> { /// Since this `iniconfig @ git+https://github.com/pytest-dev/iniconfig.git@9cae43103df70bac6fde7b9f35ad11a9f1be0cb4.git` is declared as a constraint, and /// those map to the same canonical URL, we should accept it. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn allowed_transitive_canonical_url_dependency() -> Result<()> { let context = TestContext::new("3.12"); @@ -3039,7 +3039,7 @@ fn allowed_transitive_canonical_url_dependency() -> Result<()> { /// Request `hatchling_editable`, which depends on `https://files.pythonhosted.org/packages/ef/a6/62565a6e1cf69e10f5727360368e451d4b7f58beeac6173dc9db836a5b46/iniconfig-2.0.0-py3-none-any.whl`. /// Since `hatchling_editable` is a path (local) dependency, we should accept it. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn allowed_transitive_url_path_dependency() -> Result<()> { let context = TestContext::new("3.12"); @@ -4938,7 +4938,7 @@ fn recursive_extras_direct_url() -> Result<()> { /// Compile an editable package with a direct URL requirement. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn compile_editable_url_requirement() -> Result<()> { let context = TestContext::new("3.12"); let requirements_in = context.temp_dir.child("requirements.in"); @@ -5181,7 +5181,7 @@ fn generate_hashes_built_distribution_url() -> Result<()> { /// Given a VCS dependency, include hashes for its dependencies, but not the repository itself. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn generate_hashes_git() -> Result<()> { let context = TestContext::new("3.12"); let requirements_in = context.temp_dir.child("requirements.in"); @@ -5636,7 +5636,7 @@ coverage = ["example[test]", "extras>=0.0.1,<=0.0.2"] /// /// `voluptuous==0.15.1` requires Python 3.9 or later, so we should resolve to an earlier version /// and avoiding building 0.15.1 at all. -#[cfg(feature = "python-eol")] +#[cfg(feature = "test-python-eol")] #[test] fn requires_python_prefetch() -> Result<()> { let context = TestContext::new("3.8").with_exclude_newer("2025-01-01T00:00:00Z"); @@ -11669,7 +11669,7 @@ fn unnamed_path_requirement() -> Result<()> { /// Detect the package name from an unnamed Git requirement. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn unnamed_git_requirement() -> Result<()> { let context = TestContext::new("3.12"); let requirements_in = context.temp_dir.child("requirements.in"); @@ -11778,7 +11778,7 @@ fn dynamic_dependencies() -> Result<()> { /// This tests the marker expressions emitted when depending on a package with /// exciting markers like 'anyio'. -#[cfg(feature = "python-patch")] +#[cfg(feature = "test-python-patch")] #[test] fn emit_marker_expression_exciting_linux() -> Result<()> { let context = TestContext::new("3.12.9"); @@ -11814,7 +11814,7 @@ fn emit_marker_expression_exciting_linux() -> Result<()> { /// This tests that the marker expression emitted accounts for markers directly /// in `requirements.in`. -#[cfg(feature = "python-patch")] +#[cfg(feature = "test-python-patch")] #[test] fn emit_marker_expression_direct() -> Result<()> { let context = TestContext::new("3.12.9"); @@ -11884,7 +11884,7 @@ fn emit_marker_expression_conditional() -> Result<()> { /// This tests the marker expressions emitted when depending on a package with /// a non-pypy dependency. Specifically, `pendulum` depends on `time-machine`, /// but not when using pypy. -#[cfg(feature = "python-patch")] +#[cfg(feature = "test-python-patch")] #[test] fn emit_marker_expression_pypy() -> Result<()> { let context = TestContext::new("3.12.9"); @@ -13007,7 +13007,7 @@ fn python_platform() -> Result<()> { /// Resolve a specific source distribution via a Git HTTPS dependency. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn git_source_default_branch() -> Result<()> { let context = TestContext::new("3.12"); @@ -13049,7 +13049,7 @@ fn git_source_default_branch() -> Result<()> { /// Resolve a specific branch via a Git HTTPS dependency. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn git_source_branch() -> Result<()> { let context = TestContext::new("3.12"); @@ -13085,7 +13085,7 @@ fn git_source_branch() -> Result<()> { /// Resolve a specific tag via a Git HTTPS dependency. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn git_source_tag() -> Result<()> { let context = TestContext::new("3.12"); @@ -13121,7 +13121,7 @@ fn git_source_tag() -> Result<()> { /// Resolve a specific commit via a Git HTTPS dependency. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn git_source_long_commit() -> Result<()> { let context = TestContext::new("3.12"); @@ -13157,7 +13157,7 @@ fn git_source_long_commit() -> Result<()> { /// Resolve a specific commit via a Git HTTPS dependency. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn git_source_short_commit() -> Result<()> { let context = TestContext::new("3.12"); @@ -13193,7 +13193,7 @@ fn git_source_short_commit() -> Result<()> { /// Resolve a specific ref via a Git HTTPS dependency. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn git_source_refs() -> Result<()> { let context = TestContext::new("3.12"); @@ -13229,7 +13229,7 @@ fn git_source_refs() -> Result<()> { /// Request a non-existent tag via a Git HTTPS dependency. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] #[cfg_attr(windows, ignore = "Git error messages differ on Windows")] fn git_source_missing_tag() -> Result<()> { let context = TestContext::new("3.12"); @@ -13350,7 +13350,7 @@ fn dont_warn_missing_constraint_without_sources() -> Result<()> { } #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn tool_uv_sources() -> Result<()> { let context = TestContext::new("3.12"); // Use a subdir to test path normalization. @@ -13728,7 +13728,7 @@ build-constraint-dependencies = [ } /// Include `build-constraint-dependencies` in pyproject.toml with a compatible constraint. -#[cfg(feature = "python-eol")] +#[cfg(feature = "test-python-eol")] #[test] fn compatible_build_constraint_in_pyproject_toml() -> Result<()> { let context = TestContext::new("3.8"); @@ -14561,7 +14561,7 @@ fn unsupported_requires_python_static_metadata() -> Result<()> { /// dynamic metadata. /// /// See: -#[cfg(feature = "python-eol")] +#[cfg(feature = "test-python-eol")] #[test] fn unsupported_requires_python_dynamic_metadata() -> Result<()> { let context = TestContext::new("3.8").with_exclude_newer("2024-11-04T00:00:00Z"); @@ -15079,7 +15079,7 @@ fn compile_lowest_extra_unpinned_warning() -> Result<()> { Ok(()) } -#[cfg(feature = "python-eol")] +#[cfg(feature = "test-python-eol")] #[test] fn disjoint_requires_python() -> Result<()> { let context = TestContext::new("3.8").with_exclude_newer("2025-01-29T00:00:00Z"); @@ -15180,7 +15180,7 @@ fn dynamic_version_source_dist() -> Result<()> { Ok(()) } -#[cfg(feature = "python-eol")] +#[cfg(feature = "test-python-eol")] #[test] fn max_python_requirement() -> Result<()> { let context = TestContext::new("3.8").with_exclude_newer("2024-12-18T00:00:00Z"); @@ -16216,7 +16216,7 @@ fn group_target_does_not_exist() -> Result<()> { } /// See: -#[cfg(feature = "python-eol")] +#[cfg(feature = "test-python-eol")] #[test] fn compile_preserve_requires_python_split() -> Result<()> { let context = TestContext::new("3.8").with_exclude_newer("2025-01-01T00:00:00Z"); @@ -16713,7 +16713,7 @@ fn pep_751_compile_directory() -> Result<()> { } #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn pep_751_compile_git() -> Result<()> { let context = TestContext::new("3.12"); @@ -17758,7 +17758,7 @@ fn pubgrub_panic_double_self_dependency_extra() -> Result<()> { /// /// See: #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn git_path_transitive_dependency() -> Result<()> { let context = TestContext::new("3.13"); @@ -18077,7 +18077,7 @@ fn compile_with_python_platform_and_built_wheel_for_different_platform() -> Resu Ok(()) } -#[cfg(feature = "python-managed")] +#[cfg(feature = "test-python-managed")] #[test] fn compile_missing_python() -> Result<()> { let context = TestContext::new("3.12") @@ -18111,7 +18111,7 @@ fn compile_missing_python() -> Result<()> { Ok(()) } -#[cfg(feature = "python-managed")] +#[cfg(feature = "test-python-managed")] #[test] fn compile_missing_python_version() -> Result<()> { let context = TestContext::new("3.12") @@ -18144,7 +18144,7 @@ fn compile_missing_python_version() -> Result<()> { Ok(()) } -#[cfg(feature = "python-managed")] +#[cfg(feature = "test-python-managed")] #[test] fn compile_missing_python_version_patch_fallback() -> Result<()> { let context = TestContext::new("3.12") @@ -18183,7 +18183,7 @@ fn compile_missing_python_version_patch_fallback() -> Result<()> { Ok(()) } -#[cfg(feature = "python-managed")] +#[cfg(feature = "test-python-managed")] #[test] fn compile_missing_python_version_default_fallback() -> Result<()> { let context = TestContext::new_with_versions(&[]) @@ -18220,7 +18220,7 @@ fn compile_missing_python_version_default_fallback() -> Result<()> { } /// Test that pip compile warns on download errors -#[cfg(feature = "python-managed")] +#[cfg(feature = "test-python-managed")] #[tokio::test] async fn compile_missing_python_download_error_warning() { let context = TestContext::new("3.12") diff --git a/crates/uv/tests/it/pip_compile_scenarios.rs b/crates/uv/tests/it/pip_compile_scenarios.rs index fbcc7edd0..482969858 100644 --- a/crates/uv/tests/it/pip_compile_scenarios.rs +++ b/crates/uv/tests/it/pip_compile_scenarios.rs @@ -3,7 +3,7 @@ //! Generated with `./scripts/sync_scenarios.sh` //! Scenarios from //! -#![cfg(all(feature = "python", feature = "pypi", unix))] +#![cfg(all(feature = "test-python", feature = "test-pypi", unix))] use std::process::Command; @@ -360,7 +360,7 @@ fn incompatible_python_compatible_override() -> Result<()> { /// └── a-1.0.0 /// └── requires python>=3.9.4 /// ``` -#[cfg(feature = "python-patch")] +#[cfg(feature = "test-python-patch")] #[test] fn python_patch_override_no_patch() -> Result<()> { let context = TestContext::new("3.9.20"); @@ -408,7 +408,7 @@ fn python_patch_override_no_patch() -> Result<()> { /// └── a-1.0.0 /// └── requires python>=3.9.0 /// ``` -#[cfg(feature = "python-patch")] +#[cfg(feature = "test-python-patch")] #[test] fn python_patch_override_patch_compatible() -> Result<()> { let context = TestContext::new("3.9.20"); diff --git a/crates/uv/tests/it/pip_install.rs b/crates/uv/tests/it/pip_install.rs index c5f89efe8..e91882885 100644 --- a/crates/uv/tests/it/pip_install.rs +++ b/crates/uv/tests/it/pip_install.rs @@ -15,7 +15,7 @@ use wiremock::{ matchers::{basic_auth, method, path}, }; -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] use crate::common::{self, decode_token}; use crate::common::{ DEFAULT_PYTHON_VERSION, TestContext, build_vendor_links_url, download_to_disk, get_bin, @@ -2102,7 +2102,7 @@ async fn install_deduplicated_indices() { /// Install a package from a public GitHub repository #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn install_git_public_https() { let context = TestContext::new(DEFAULT_PYTHON_VERSION); @@ -2127,7 +2127,7 @@ fn install_git_public_https() { /// Install a package from a public GitHub repository, omitting the `git+` prefix #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn install_implicit_git_public_https() { let context = TestContext::new(DEFAULT_PYTHON_VERSION); @@ -2152,7 +2152,7 @@ fn install_implicit_git_public_https() { /// Install and update a package from a public GitHub repository #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn update_ref_git_public_https() { let context = TestContext::new(DEFAULT_PYTHON_VERSION); @@ -2199,7 +2199,7 @@ fn update_ref_git_public_https() { /// Install a package from a public GitHub repository at a ref that does not exist #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn install_git_public_https_missing_branch_or_tag() { let context = TestContext::new(DEFAULT_PYTHON_VERSION); @@ -2227,7 +2227,7 @@ fn install_git_public_https_missing_branch_or_tag() { } #[tokio::test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] async fn install_git_public_rate_limited_by_github_rest_api_403_response() { let context = TestContext::new("3.12"); @@ -2255,7 +2255,7 @@ async fn install_git_public_rate_limited_by_github_rest_api_403_response() { } #[tokio::test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] async fn install_git_public_rate_limited_by_github_rest_api_429_response() { use uv_client::DEFAULT_RETRIES; @@ -2287,7 +2287,7 @@ async fn install_git_public_rate_limited_by_github_rest_api_429_response() { /// Install a package from a public GitHub repository at a ref that does not exist #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn install_git_public_https_missing_commit() { let context = TestContext::new(DEFAULT_PYTHON_VERSION); @@ -2326,7 +2326,7 @@ fn install_git_public_https_missing_commit() { } #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn install_git_public_https_exact_commit() { let context = TestContext::new(DEFAULT_PYTHON_VERSION); @@ -2374,7 +2374,7 @@ fn install_git_public_https_exact_commit() { /// Install a package from a private GitHub repository using a PAT #[test] -#[cfg(all(not(windows), feature = "git"))] +#[cfg(all(not(windows), feature = "test-git"))] fn install_git_private_https_pat() { use crate::common::decode_token; @@ -2403,7 +2403,7 @@ fn install_git_private_https_pat() { /// Install a package from a private GitHub repository using a PAT /// Include a public GitHub repository too, to ensure that the authentication is not erroneously copied over. #[test] -#[cfg(all(not(windows), feature = "git"))] +#[cfg(all(not(windows), feature = "test-git"))] fn install_git_private_https_pat_mixed_with_public() { let context = TestContext::new(DEFAULT_PYTHON_VERSION); let token = decode_token(common::READ_ONLY_GITHUB_TOKEN); @@ -2431,7 +2431,7 @@ fn install_git_private_https_pat_mixed_with_public() { /// Install packages from multiple private GitHub repositories with separate PATS #[test] -#[cfg(all(not(windows), feature = "git"))] +#[cfg(all(not(windows), feature = "test-git"))] fn install_git_private_https_multiple_pat() { let context = TestContext::new(DEFAULT_PYTHON_VERSION); let token_1 = decode_token(common::READ_ONLY_GITHUB_TOKEN); @@ -2463,7 +2463,7 @@ fn install_git_private_https_multiple_pat() { /// Install a package from a private GitHub repository at a specific commit using a PAT #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn install_git_private_https_pat_at_ref() { let context = TestContext::new(DEFAULT_PYTHON_VERSION); let token = decode_token(common::READ_ONLY_GITHUB_TOKEN); @@ -2501,7 +2501,7 @@ fn install_git_private_https_pat_at_ref() { /// Install a package from a private GitHub repository using a PAT and username /// An arbitrary username is supported when using a PAT. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn install_git_private_https_pat_and_username() { let context = TestContext::new(DEFAULT_PYTHON_VERSION).with_unset_git_credential_helper(); let token = decode_token(common::READ_ONLY_GITHUB_TOKEN); @@ -2525,7 +2525,7 @@ fn install_git_private_https_pat_and_username() { /// Install a package from a private GitHub repository using a PAT #[test] -#[cfg(all(not(windows), feature = "git"))] +#[cfg(all(not(windows), feature = "test-git"))] fn install_git_private_https_pat_not_authorized() { let context = TestContext::new(DEFAULT_PYTHON_VERSION); @@ -2627,7 +2627,7 @@ fn install_github_artifact_private_https_multiple_pat() { /// It should fail gracefully, instead of silently hanging forever /// Regression test for #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn install_git_private_https_interactive() { let context = TestContext::new(DEFAULT_PYTHON_VERSION); @@ -3831,7 +3831,7 @@ fn install_constraints_respects_offline_mode() { } #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn install_git_source_respects_offline_mode() { let context = TestContext::new("3.12"); @@ -6712,7 +6712,7 @@ fn already_installed_multiple_versions() -> Result<()> { /// Install a package from a remote URL #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn already_installed_remote_url() { let context = TestContext::new(DEFAULT_PYTHON_VERSION); @@ -7978,7 +7978,7 @@ fn concatenated_quoted_arguments() -> Result<()> { } #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn tool_uv_sources() -> Result<()> { let context = TestContext::new("3.12"); // Use a subdir to test path normalization. @@ -8843,7 +8843,7 @@ build-constraint-dependencies = [ } /// Include a `build_constraints.txt` file with a compatible constraint. -#[cfg(feature = "python-eol")] +#[cfg(feature = "test-python-eol")] #[test] fn compatible_build_constraint_in_pyproject_toml() -> Result<()> { let context = TestContext::new("3.8"); @@ -9151,7 +9151,7 @@ fn switch_python_version() -> Result<()> { /// See: #[test] -#[cfg(feature = "slow-tests")] +#[cfg(feature = "test-slow")] fn stale_egg_info() -> Result<()> { let context = TestContext::new("3.12"); @@ -9566,7 +9566,7 @@ fn missing_git_prefix() -> Result<()> { } #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn missing_subdirectory_git() -> Result<()> { let context = TestContext::new("3.12"); let requirements_txt = context.temp_dir.child("requirements.txt"); @@ -9817,7 +9817,7 @@ fn cyclic_build_dependency() { } #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn direct_url_json_git_default() -> Result<()> { let context = TestContext::new("3.12"); let requirements_txt = context.temp_dir.child("requirements.txt"); @@ -9855,7 +9855,7 @@ fn direct_url_json_git_default() -> Result<()> { } #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn direct_url_json_git_tag() -> Result<()> { let context = TestContext::new("3.12"); let requirements_txt = context.temp_dir.child("requirements.txt"); @@ -10950,7 +10950,7 @@ fn no_sources_workspace_discovery() -> Result<()> { /// Test `--no-sources-package` with pip install to selectively disable sources. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn pip_install_no_sources_package() -> Result<()> { let context = TestContext::new("3.12"); context.temp_dir.child("pyproject.toml").write_str(indoc! { @@ -11419,7 +11419,7 @@ fn pep_751_install_directory() -> Result<()> { } #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn pep_751_install_git() -> Result<()> { let context = TestContext::new("3.12"); @@ -13671,7 +13671,7 @@ fn pip_install_no_sources_editable_to_registry_switch() -> Result<()> { Ok(()) } -#[cfg(feature = "python-managed")] +#[cfg(feature = "test-python-managed")] #[test] fn install_with_system_interpreter() { let context = TestContext::new_with_versions(&[]) @@ -13701,7 +13701,7 @@ fn install_with_system_interpreter() { } /// Test that a missing Python version is not installed when not using `--target` or `--prefix`. -#[cfg(feature = "python-managed")] +#[cfg(feature = "test-python-managed")] #[test] fn install_missing_python_no_target() { // Create a context that only has Python 3.11 available. @@ -13724,7 +13724,7 @@ fn install_missing_python_no_target() { } // If there are no python interpreters available, `uv pip install` into a target should install one. -#[cfg(feature = "python-managed")] +#[cfg(feature = "test-python-managed")] #[test] fn install_missing_python_with_target() { // Create a context with no installed python interpreters. @@ -13754,7 +13754,7 @@ fn install_missing_python_with_target() { ); } -#[cfg(feature = "python-managed")] +#[cfg(feature = "test-python-managed")] #[test] fn install_missing_python_version_with_target() { // Create a context that only has Python 3.11 available. diff --git a/crates/uv/tests/it/pip_install_scenarios.rs b/crates/uv/tests/it/pip_install_scenarios.rs index 66d9a1a56..9f95901be 100644 --- a/crates/uv/tests/it/pip_install_scenarios.rs +++ b/crates/uv/tests/it/pip_install_scenarios.rs @@ -3,7 +3,7 @@ //! Generated with `./scripts/sync_scenarios.sh` //! Scenarios from //! -#![cfg(all(feature = "python", feature = "pypi", unix))] +#![cfg(all(feature = "test-python", feature = "test-pypi", unix))] use std::process::Command; @@ -3397,7 +3397,7 @@ fn python_greater_than_current_many() { /// └── a-1.0.0 /// └── requires python>=3.13.2 (incompatible with environment) /// ``` -#[cfg(feature = "python-patch")] +#[cfg(feature = "test-python-patch")] #[test] fn python_greater_than_current_patch() { let context = TestContext::new("3.13.0"); diff --git a/crates/uv/tests/it/pip_list.rs b/crates/uv/tests/it/pip_list.rs index 1b823458e..694452876 100644 --- a/crates/uv/tests/it/pip_list.rs +++ b/crates/uv/tests/it/pip_list.rs @@ -57,7 +57,7 @@ fn list_empty_json() { } #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn list_single_no_editable() -> Result<()> { let context = TestContext::new("3.12"); @@ -98,7 +98,7 @@ fn list_single_no_editable() -> Result<()> { } #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn list_outdated_columns() -> Result<()> { let context = TestContext::new("3.12"); @@ -139,7 +139,7 @@ fn list_outdated_columns() -> Result<()> { } #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn list_outdated_json() -> Result<()> { let context = TestContext::new("3.12"); @@ -193,7 +193,7 @@ fn list_outdated_freeze() { } #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn list_outdated_git() -> Result<()> { let context = TestContext::new("3.12"); @@ -236,7 +236,7 @@ fn list_outdated_git() -> Result<()> { } #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn list_outdated_index() -> Result<()> { let context = TestContext::new("3.12"); @@ -280,7 +280,7 @@ fn list_outdated_index() -> Result<()> { } #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn list_editable() { let context = TestContext::new("3.12"); @@ -326,7 +326,7 @@ fn list_editable() { } #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn list_editable_only() { let context = TestContext::new("3.12"); @@ -401,7 +401,7 @@ fn list_editable_only() { } #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn list_exclude() { let context = TestContext::new("3.12"); @@ -483,7 +483,7 @@ fn list_exclude() { } #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] #[cfg(not(windows))] fn list_format_json() { let context = TestContext::new("3.12"); @@ -550,7 +550,7 @@ fn list_format_json() { } #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn list_format_freeze() { let context = TestContext::new("3.12"); @@ -716,7 +716,7 @@ Version: 0.1-bulbasaur } #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn list_ignores_quiet_flag_format_freeze() { let context = TestContext::new("3.12"); @@ -791,7 +791,7 @@ fn list_ignores_quiet_flag_format_freeze() { } #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn list_target() -> Result<()> { let context = TestContext::new("3.12"); @@ -840,7 +840,7 @@ fn list_target() -> Result<()> { } #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn list_prefix() -> Result<()> { let context = TestContext::new("3.12"); diff --git a/crates/uv/tests/it/pip_show.rs b/crates/uv/tests/it/pip_show.rs index bbe6bfa2b..5ab7ab1d5 100644 --- a/crates/uv/tests/it/pip_show.rs +++ b/crates/uv/tests/it/pip_show.rs @@ -26,7 +26,7 @@ fn show_empty() { } #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn show_requires_multiple() -> Result<()> { let context = TestContext::new("3.12"); @@ -76,7 +76,7 @@ fn show_requires_multiple() -> Result<()> { /// Asserts that the Python version marker in the metadata is correctly evaluated. /// `click` v8.1.7 requires `importlib-metadata`, but only when `python_version < "3.8"`. #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn show_python_version_marker() -> Result<()> { let context = TestContext::new("3.12"); @@ -126,7 +126,7 @@ fn show_python_version_marker() -> Result<()> { } #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn show_found_single_package() -> Result<()> { let context = TestContext::new("3.12"); @@ -171,7 +171,7 @@ fn show_found_single_package() -> Result<()> { } #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn show_found_multiple_packages() -> Result<()> { let context = TestContext::new("3.12"); @@ -228,7 +228,7 @@ fn show_found_multiple_packages() -> Result<()> { } #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn show_found_one_out_of_three() -> Result<()> { let context = TestContext::new("3.12"); @@ -281,7 +281,7 @@ fn show_found_one_out_of_three() -> Result<()> { } #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn show_found_one_out_of_two_quiet() -> Result<()> { let context = TestContext::new("3.12"); @@ -329,7 +329,7 @@ fn show_found_one_out_of_two_quiet() -> Result<()> { } #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn show_empty_quiet() -> Result<()> { let context = TestContext::new("3.12"); @@ -376,7 +376,7 @@ fn show_empty_quiet() -> Result<()> { } #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn show_editable() -> Result<()> { let context = TestContext::new("3.12"); @@ -413,7 +413,7 @@ fn show_editable() -> Result<()> { } #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn show_required_by_multiple() -> Result<()> { let context = TestContext::new("3.12"); @@ -469,7 +469,7 @@ fn show_required_by_multiple() -> Result<()> { } #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn show_files() { let context = TestContext::new("3.12"); @@ -536,7 +536,7 @@ fn show_files() { } #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn show_target() -> Result<()> { let context = TestContext::new("3.12"); @@ -588,7 +588,7 @@ fn show_target() -> Result<()> { } #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn show_prefix() -> Result<()> { let context = TestContext::new("3.12"); diff --git a/crates/uv/tests/it/pip_sync.rs b/crates/uv/tests/it/pip_sync.rs index 62828bb90..6fe798493 100644 --- a/crates/uv/tests/it/pip_sync.rs +++ b/crates/uv/tests/it/pip_sync.rs @@ -612,7 +612,7 @@ fn install_url() -> Result<()> { /// Install a package into a virtual environment from a Git repository. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn install_git_commit() -> Result<()> { let context = TestContext::new("3.12"); @@ -643,7 +643,7 @@ fn install_git_commit() -> Result<()> { /// Install a package into a virtual environment from a Git repository. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn install_git_tag() -> Result<()> { let context = TestContext::new("3.12"); @@ -676,7 +676,7 @@ fn install_git_tag() -> Result<()> { /// Install two packages from the same Git repository. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn install_git_subdirectories() -> Result<()> { let context = TestContext::new("3.12"); @@ -912,7 +912,7 @@ fn install_version_then_install_url() -> Result<()> { /// Test that we select the last 3.8 compatible numpy version instead of trying to compile an /// incompatible sdist -#[cfg(feature = "python-eol")] +#[cfg(feature = "test-python-eol")] #[test] fn install_numpy_py38() -> Result<()> { let context = TestContext::new("3.8"); @@ -1472,7 +1472,7 @@ fn install_url_source_dist_cached() -> Result<()> { /// Check that we show the right messages on cached, Git source distribution installs. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn install_git_source_dist_cached() -> Result<()> { let context = TestContext::new("3.12"); @@ -2093,7 +2093,7 @@ fn reinstall_package() -> Result<()> { /// Verify that we can force reinstall of Git dependencies. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn reinstall_git() -> Result<()> { let context = TestContext::new("3.12"); @@ -4005,7 +4005,7 @@ fn require_hashes_wheel_url_mismatch() -> Result<()> { /// Reject Git dependencies when `--require-hashes` is provided. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn require_hashes_git() -> Result<()> { let context = TestContext::new("3.12"); @@ -6157,7 +6157,7 @@ fn incompatible_platform_direct_url() -> Result<()> { } /// Test that a missing Python version is not installed when not using `--target` or `--prefix`. -#[cfg(feature = "python-managed")] +#[cfg(feature = "test-python-managed")] #[test] fn sync_missing_python_no_target() -> Result<()> { // Create a context that only has Python 3.11 available. @@ -6183,7 +6183,7 @@ fn sync_missing_python_no_target() -> Result<()> { Ok(()) } -#[cfg(feature = "python-managed")] +#[cfg(feature = "test-python-managed")] #[test] fn sync_with_target_installs_missing_python() -> Result<()> { // Create a context that only has Python 3.11 available. diff --git a/crates/uv/tests/it/pip_tree.rs b/crates/uv/tests/it/pip_tree.rs index c0c3da793..2f33a0955 100644 --- a/crates/uv/tests/it/pip_tree.rs +++ b/crates/uv/tests/it/pip_tree.rs @@ -25,7 +25,7 @@ fn no_package() { } #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn prune_last_in_the_subgroup() { let context = TestContext::new("3.12"); @@ -69,7 +69,7 @@ fn prune_last_in_the_subgroup() { } #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn single_package() { let context = TestContext::new("3.12"); @@ -115,7 +115,7 @@ fn single_package() { } #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn nested_dependencies() { let context = TestContext::new("3.12"); @@ -165,7 +165,7 @@ fn nested_dependencies() { /// Identical test as `invert` since `--reverse` is simply an alias for `--invert`. #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn reverse() { let context = TestContext::new("3.12"); @@ -217,7 +217,7 @@ fn reverse() { } #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn invert() { let context = TestContext::new("3.12"); @@ -269,7 +269,7 @@ fn invert() { } #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn depth() { let context = TestContext::new("3.12"); @@ -348,7 +348,7 @@ fn depth() { } #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn prune() { let context = TestContext::new("3.12"); @@ -432,7 +432,7 @@ fn prune() { /// Ensure `pip tree` behaves correctly after a package has been removed. #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn removed_dependency() { let context = TestContext::new("3.12"); @@ -488,7 +488,7 @@ fn removed_dependency() { } #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn multiple_packages() { let context = TestContext::new("3.12"); @@ -543,7 +543,7 @@ fn multiple_packages() { /// Show the installed tree in the presence of a cycle. #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn cycle() { let context = TestContext::new("3.12"); @@ -611,7 +611,7 @@ fn cycle() { /// Both `pendulum` and `boto3` depend on `python-dateutil`. #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn multiple_packages_shared_descendant() { let context = TestContext::new("3.12"); @@ -665,7 +665,7 @@ fn multiple_packages_shared_descendant() { /// Test the interaction between `--no-dedupe` and `--invert`. #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn no_dedupe_and_invert() { let context = TestContext::new("3.12"); @@ -718,7 +718,7 @@ fn no_dedupe_and_invert() { } #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn no_dedupe() { let context = TestContext::new("3.12"); @@ -772,7 +772,7 @@ fn no_dedupe() { } #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn with_editable() { let context = TestContext::new("3.12"); @@ -813,7 +813,7 @@ fn with_editable() { } #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn package_flag() { let context = TestContext::new("3.12"); @@ -881,7 +881,7 @@ fn package_flag() { } #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn show_version_specifiers_simple() { let context = TestContext::new("3.12"); @@ -925,7 +925,7 @@ fn show_version_specifiers_simple() { } #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn show_version_specifiers_with_invert() { let context = TestContext::new("3.12"); @@ -981,7 +981,7 @@ fn show_version_specifiers_with_invert() { } #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn show_version_specifiers_with_package() { let context = TestContext::new("3.12"); @@ -1029,7 +1029,7 @@ fn show_version_specifiers_with_package() { } #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn print_output_even_with_quite_flag() { let context = TestContext::new("3.12"); @@ -1069,7 +1069,7 @@ fn print_output_even_with_quite_flag() { } #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn outdated() { let context = TestContext::new("3.12"); @@ -1120,7 +1120,7 @@ fn outdated() { /// Test that dependencies with multiple marker-specific requirements /// are only displayed once in the tree. #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn no_duplicate_dependencies_with_markers() { const PY_PROJECT: &str = indoc! {r#" [project] diff --git a/crates/uv/tests/it/pip_uninstall.rs b/crates/uv/tests/it/pip_uninstall.rs index e116de3ff..4c7dd449e 100644 --- a/crates/uv/tests/it/pip_uninstall.rs +++ b/crates/uv/tests/it/pip_uninstall.rs @@ -85,7 +85,7 @@ fn invalid_requirements_txt_requirement() -> Result<()> { } #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn uninstall() -> Result<()> { let context = TestContext::new("3.12"); @@ -118,7 +118,7 @@ fn uninstall() -> Result<()> { } #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn missing_record() -> Result<()> { let context = TestContext::new("3.12"); @@ -152,7 +152,7 @@ fn missing_record() -> Result<()> { } #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn uninstall_editable_by_name() -> Result<()> { let context = TestContext::new("3.12"); @@ -193,7 +193,7 @@ fn uninstall_editable_by_name() -> Result<()> { } #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn uninstall_by_path() -> Result<()> { let context = TestContext::new("3.12"); @@ -234,7 +234,7 @@ fn uninstall_by_path() -> Result<()> { } #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn uninstall_duplicate_by_path() -> Result<()> { let context = TestContext::new("3.12"); @@ -277,7 +277,7 @@ fn uninstall_duplicate_by_path() -> Result<()> { /// Uninstall a duplicate package in a virtual environment. #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn uninstall_duplicate() -> Result<()> { use uv_fs::copy_dir_all; diff --git a/crates/uv/tests/it/python_find.rs b/crates/uv/tests/it/python_find.rs index cf49fb845..8eda5baa6 100644 --- a/crates/uv/tests/it/python_find.rs +++ b/crates/uv/tests/it/python_find.rs @@ -981,7 +981,7 @@ fn python_find_managed() { /// used in the test context. #[test] #[cfg(unix)] -#[cfg(feature = "python-managed")] +#[cfg(feature = "test-python-managed")] fn python_required_python_major_minor() { let context: TestContext = TestContext::new_with_versions(&["3.11", "3.12"]); @@ -1248,7 +1248,7 @@ fn python_find_path() { } #[test] -#[cfg(feature = "python-managed")] +#[cfg(feature = "test-python-managed")] fn python_find_freethreaded_313() { let context: TestContext = TestContext::new_with_versions(&[]) .with_filtered_python_keys() @@ -1288,7 +1288,7 @@ fn python_find_freethreaded_313() { } #[test] -#[cfg(feature = "python-managed")] +#[cfg(feature = "test-python-managed")] fn python_find_freethreaded_314() { let context: TestContext = TestContext::new_with_versions(&[]) .with_filtered_python_keys() @@ -1366,7 +1366,7 @@ fn python_find_freethreaded_314() { } #[test] -#[cfg(feature = "python-managed")] +#[cfg(feature = "test-python-managed")] fn python_find_prerelease_version_specifiers() { let context: TestContext = TestContext::new_with_versions(&[]) .with_filtered_python_keys() @@ -1466,7 +1466,7 @@ fn python_find_prerelease_version_specifiers() { } #[test] -#[cfg(feature = "python-managed")] +#[cfg(feature = "test-python-managed")] fn python_find_prerelease_with_patch_request() { let context: TestContext = TestContext::new_with_versions(&[]) .with_filtered_python_keys() diff --git a/crates/uv/tests/it/python_list.rs b/crates/uv/tests/it/python_list.rs index e31794dbe..bc54ce874 100644 --- a/crates/uv/tests/it/python_list.rs +++ b/crates/uv/tests/it/python_list.rs @@ -411,7 +411,7 @@ fn python_list_downloads() { } #[test] -#[cfg(feature = "python-managed")] +#[cfg(feature = "test-python-managed")] fn python_list_downloads_installed() { use assert_cmd::assert::OutputAssertExt; diff --git a/crates/uv/tests/it/python_module.rs b/crates/uv/tests/it/python_module.rs index 3fc0eec32..713a803ba 100644 --- a/crates/uv/tests/it/python_module.rs +++ b/crates/uv/tests/it/python_module.rs @@ -472,7 +472,7 @@ fn find_uv_bin_error_message() { ); } -#[cfg(feature = "python-eol")] +#[cfg(feature = "test-python-eol")] #[test] fn find_uv_bin_py38() { let context = TestContext::new("3.8") diff --git a/crates/uv/tests/it/python_pin.rs b/crates/uv/tests/it/python_pin.rs index 2f0c0d21e..aa06662f8 100644 --- a/crates/uv/tests/it/python_pin.rs +++ b/crates/uv/tests/it/python_pin.rs @@ -782,7 +782,7 @@ fn python_pin_with_comments() -> Result<()> { } #[test] -#[cfg(feature = "python-managed")] +#[cfg(feature = "test-python-managed")] fn python_pin_install() { let context: TestContext = TestContext::new_with_versions(&[]).with_filtered_python_sources(); diff --git a/crates/uv/tests/it/run.rs b/crates/uv/tests/it/run.rs index bdbeecbd9..f6f29e75a 100644 --- a/crates/uv/tests/it/run.rs +++ b/crates/uv/tests/it/run.rs @@ -578,7 +578,7 @@ fn run_pythonw_script() -> Result<()> { /// Run a PEP 723-compatible script with `tool.uv` metadata. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn run_pep723_script_metadata() -> Result<()> { let context = TestContext::new("3.12"); diff --git a/crates/uv/tests/it/sync.rs b/crates/uv/tests/it/sync.rs index 21633b4ac..1f5f5f150 100644 --- a/crates/uv/tests/it/sync.rs +++ b/crates/uv/tests/it/sync.rs @@ -754,7 +754,7 @@ fn mixed_requires_python() -> Result<()> { /// Ensure that group requires-python solves an actual problem #[test] #[cfg(not(windows))] -#[cfg(feature = "python-eol")] +#[cfg(feature = "test-python-eol")] fn group_requires_python_useful_defaults() -> Result<()> { let context = TestContext::new_with_versions(&["3.8", "3.9"]); @@ -899,7 +899,7 @@ fn group_requires_python_useful_defaults() -> Result<()> { /// Ensure that group requires-python solves an actual problem #[test] #[cfg(not(windows))] -#[cfg(feature = "python-eol")] +#[cfg(feature = "test-python-eol")] fn group_requires_python_useful_non_defaults() -> Result<()> { let context = TestContext::new_with_versions(&["3.8", "3.9"]); @@ -7033,7 +7033,7 @@ fn sync_active_script_environment_json() -> Result<()> { } #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn sync_workspace_custom_environment_path() -> Result<()> { let context = TestContext::new("3.12"); @@ -8833,7 +8833,7 @@ fn sync_no_sources_missing_member() -> Result<()> { /// Test `--no-sources-package` with sync to selectively disable sources. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn sync_no_sources_package() -> Result<()> { let context = TestContext::new("3.12"); @@ -9855,7 +9855,7 @@ fn sync_derivation_chain_group() -> Result<()> { /// See: #[test] -#[cfg(all(feature = "slow-tests", feature = "git"))] +#[cfg(all(feature = "test-slow", feature = "test-git"))] fn sync_stale_egg_info() -> Result<()> { let context = TestContext::new("3.13"); @@ -9961,7 +9961,7 @@ fn sync_stale_egg_info() -> Result<()> { /// See: #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn sync_git_repeated_member_static_metadata() -> Result<()> { let context = TestContext::new("3.13"); @@ -10055,7 +10055,7 @@ fn sync_git_repeated_member_static_metadata() -> Result<()> { /// See: #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn sync_git_repeated_member_dynamic_metadata() -> Result<()> { let context = TestContext::new("3.13"); @@ -10173,7 +10173,7 @@ fn sync_git_repeated_member_dynamic_metadata() -> Result<()> { /// See: #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn sync_git_repeated_member_backwards_path() -> Result<()> { let context = TestContext::new("3.13"); @@ -10356,7 +10356,7 @@ fn mismatched_name_cached_wheel() -> Result<()> { /// /// See: #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn sync_git_path_dependency() -> Result<()> { let context = TestContext::new("3.13"); @@ -14033,7 +14033,7 @@ fn reject_unmatched_runtime() -> Result<()> { /// Test Git LFS configuration. #[test] -#[cfg(feature = "git-lfs")] +#[cfg(feature = "test-git-lfs")] fn sync_git_lfs() -> Result<()> { let context = TestContext::new("3.13").with_git_lfs_config(); let pyproject_toml = context.temp_dir.child("pyproject.toml"); diff --git a/crates/uv/tests/it/tool_install.rs b/crates/uv/tests/it/tool_install.rs index 6de4c6115..5d1fd487b 100644 --- a/crates/uv/tests/it/tool_install.rs +++ b/crates/uv/tests/it/tool_install.rs @@ -1,4 +1,4 @@ -#[cfg(any(feature = "git", feature = "git-lfs"))] +#[cfg(any(feature = "test-git", feature = "test-git-lfs"))] use std::collections::BTreeSet; use std::process::Command; @@ -1945,7 +1945,7 @@ fn tool_install_unnamed_package() { /// Test installing a tool with a Git requirement. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn tool_install_git() { let context = TestContext::new("3.12").with_filtered_exe_suffix(); let tool_dir = context.temp_dir.child("tools"); @@ -2040,7 +2040,7 @@ fn tool_install_git() { /// Test installing a tool with a Git LFS enabled requirement. #[test] -#[cfg(feature = "git-lfs")] +#[cfg(feature = "test-git-lfs")] fn tool_install_git_lfs() { let context = TestContext::new("3.13") .with_filtered_exe_suffix() diff --git a/crates/uv/tests/it/tool_run.rs b/crates/uv/tests/it/tool_run.rs index e5f0ce24f..298d6eca6 100644 --- a/crates/uv/tests/it/tool_run.rs +++ b/crates/uv/tests/it/tool_run.rs @@ -933,7 +933,7 @@ fn tool_run_url() { /// Test running a tool with a Git requirement. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn tool_run_git() { let context = TestContext::new("3.12").with_filtered_counts(); let tool_dir = context.temp_dir.child("tools"); @@ -1025,7 +1025,7 @@ fn tool_run_git() { /// Test running a tool with a Git LFS enabled requirement. #[test] -#[cfg(feature = "git-lfs")] +#[cfg(feature = "test-git-lfs")] fn tool_run_git_lfs() { let context = TestContext::new("3.13") .with_filtered_counts() diff --git a/crates/uv/tests/it/venv.rs b/crates/uv/tests/it/venv.rs index 09e4aaa32..89ef4e75a 100644 --- a/crates/uv/tests/it/venv.rs +++ b/crates/uv/tests/it/venv.rs @@ -831,7 +831,7 @@ fn create_venv_explicit_request_takes_priority_over_python_version_file() { } #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn seed() { let context = TestContext::new_with_versions(&["3.12"]); uv_snapshot!(context.filters(), context.venv() @@ -855,7 +855,7 @@ fn seed() { } #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn seed_older_python_version() { let context = TestContext::new_with_versions(&["3.11"]); uv_snapshot!(context.filters(), context.venv() @@ -964,7 +964,7 @@ fn create_venv_unknown_python_patch() { context.venv.assert(predicates::path::missing()); } -#[cfg(feature = "python-patch")] +#[cfg(feature = "test-python-patch")] #[test] fn create_venv_python_patch() { let context = TestContext::new_with_versions(&["3.12.9"]); diff --git a/crates/uv/tests/it/version.rs b/crates/uv/tests/it/version.rs index 4f6c70d9f..91a5d86d5 100644 --- a/crates/uv/tests/it/version.rs +++ b/crates/uv/tests/it/version.rs @@ -2489,7 +2489,7 @@ fn version_get_workspace() -> Result<()> { /// /// Also check that --locked/--frozen/--no-sync do what they say #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn version_set_workspace() -> Result<()> { let context = TestContext::new("3.12"); @@ -2831,7 +2831,7 @@ fn version_set_workspace() -> Result<()> { /// It would be nice to have a case where we still get a package dependency, but /// this still demonstrates the non-trivial "hazard" of a version change. #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn version_set_evil_constraints() -> Result<()> { let context = TestContext::new("3.12"); @@ -3208,7 +3208,7 @@ fn add_virtual_dependency_group() -> Result<()> { /// Bump the version with conflicting extras, to ensure we're activating the correct subset of /// extras during the resolve. #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn version_extras() -> Result<()> { let context = TestContext::new("3.12"); diff --git a/crates/uv/tests/it/workspace.rs b/crates/uv/tests/it/workspace.rs index 1eb293ed5..5ce47767a 100644 --- a/crates/uv/tests/it/workspace.rs +++ b/crates/uv/tests/it/workspace.rs @@ -24,7 +24,7 @@ fn workspaces_dir() -> PathBuf { } #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn test_albatross_in_examples_bird_feeder() { let context = TestContext::new("3.12"); let workspace = context.temp_dir.child("workspace"); @@ -68,7 +68,7 @@ fn test_albatross_in_examples_bird_feeder() { } #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn test_albatross_in_examples() { let context = TestContext::new("3.12"); let workspace = context.temp_dir.child("workspace"); @@ -109,7 +109,7 @@ fn test_albatross_in_examples() { } #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn test_albatross_just_project() { let context = TestContext::new("3.12"); let workspace = context.temp_dir.child("workspace"); @@ -150,7 +150,7 @@ fn test_albatross_just_project() { } #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn test_albatross_project_in_excluded() { let context = TestContext::new("3.12"); let workspace = context.temp_dir.child("workspace"); @@ -226,7 +226,7 @@ fn test_albatross_project_in_excluded() { } #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn test_albatross_root_workspace() { let context = TestContext::new("3.12"); let workspace = context.temp_dir.child("workspace"); @@ -270,7 +270,7 @@ fn test_albatross_root_workspace() { } #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn test_albatross_root_workspace_bird_feeder() { let context = TestContext::new("3.12"); let workspace = context.temp_dir.child("workspace"); @@ -316,7 +316,7 @@ fn test_albatross_root_workspace_bird_feeder() { } #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn test_albatross_root_workspace_albatross() { let context = TestContext::new("3.12"); let workspace = context.temp_dir.child("workspace"); @@ -362,7 +362,7 @@ fn test_albatross_root_workspace_albatross() { } #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn test_albatross_virtual_workspace() { let context = TestContext::new("3.12"); let workspace = context.temp_dir.child("workspace"); @@ -410,7 +410,7 @@ fn test_albatross_virtual_workspace() { /// Check that `uv run --package` works in a virtual workspace. #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn test_uv_run_with_package_virtual_workspace() -> Result<()> { let context = TestContext::new("3.12"); let work_dir = context.temp_dir.join("albatross-virtual-workspace"); @@ -480,7 +480,7 @@ fn test_uv_run_with_package_virtual_workspace() -> Result<()> { /// Check that `uv run` works from a virtual workspace root, which should sync all packages in the /// workspace. #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn test_uv_run_virtual_workspace_root() -> Result<()> { let context = TestContext::new("3.12"); let work_dir = context.temp_dir.join("albatross-virtual-workspace"); @@ -521,7 +521,7 @@ fn test_uv_run_virtual_workspace_root() -> Result<()> { /// Check that `uv run --package` works in a root workspace. #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn test_uv_run_with_package_root_workspace() -> Result<()> { let context = TestContext::new("3.12"); let work_dir = context.temp_dir.join("albatross-root-workspace"); @@ -584,7 +584,7 @@ fn test_uv_run_with_package_root_workspace() -> Result<()> { /// Check that `uv run --isolated` creates isolated virtual environments. #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn test_uv_run_isolate() -> Result<()> { let context = TestContext::new("3.12"); let work_dir = context.temp_dir.join("albatross-root-workspace"); @@ -706,7 +706,7 @@ fn workspace_lock_idempotence(workspace: &str, subdirectories: &[&str]) -> Resul /// Check that the resolution is the same no matter where in the workspace we are. #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn workspace_lock_idempotence_root_workspace() -> Result<()> { workspace_lock_idempotence( "albatross-root-workspace", @@ -718,7 +718,7 @@ fn workspace_lock_idempotence_root_workspace() -> Result<()> { /// Check that the resolution is the same no matter where in the workspace we are, and that locking /// works even if there is no root project. #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn workspace_lock_idempotence_virtual_workspace() -> Result<()> { workspace_lock_idempotence( "albatross-virtual-workspace", @@ -1314,7 +1314,7 @@ fn workspace_inherit_sources() -> Result<()> { /// Tests error messages when a workspace member's dependencies cannot be resolved. #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn workspace_unsatisfiable_member_dependencies() -> Result<()> { let context = TestContext::new("3.12"); @@ -1370,7 +1370,7 @@ fn workspace_unsatisfiable_member_dependencies() -> Result<()> { /// Tests error messages when a workspace member's dependencies conflict with /// another member's. #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn workspace_unsatisfiable_member_dependencies_conflicting() -> Result<()> { let context = TestContext::new("3.12"); @@ -1438,7 +1438,7 @@ fn workspace_unsatisfiable_member_dependencies_conflicting() -> Result<()> { /// Tests error messages when a workspace member's dependencies conflict with /// two other member's. #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn workspace_unsatisfiable_member_dependencies_conflicting_threeway() -> Result<()> { let context = TestContext::new("3.12"); @@ -1521,7 +1521,7 @@ fn workspace_unsatisfiable_member_dependencies_conflicting_threeway() -> Result< /// Tests error messages when a workspace member's dependencies conflict with /// another member's optional dependencies. #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn workspace_unsatisfiable_member_dependencies_conflicting_extra() -> Result<()> { let context = TestContext::new("3.12"); @@ -1591,7 +1591,7 @@ fn workspace_unsatisfiable_member_dependencies_conflicting_extra() -> Result<()> /// Tests error messages when a workspace member's dependencies conflict with /// another member's development dependencies. #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn workspace_unsatisfiable_member_dependencies_conflicting_dev() -> Result<()> { let context = TestContext::new("3.12"); @@ -1662,7 +1662,7 @@ fn workspace_unsatisfiable_member_dependencies_conflicting_dev() -> Result<()> { /// Tests error messages when a workspace member's name shadows a dependency of /// another member. #[test] -#[cfg(feature = "pypi")] +#[cfg(feature = "test-pypi")] fn workspace_member_name_shadows_dependencies() -> Result<()> { let context = TestContext::new("3.12"); @@ -1792,7 +1792,7 @@ fn test_path_hopping() -> Result<()> { /// are correctly resolving `d` to a git dependency with a subdirectory and not relative to the /// checkout directory. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn transitive_dep_in_git_workspace_no_root() -> Result<()> { let context = TestContext::new("3.12"); @@ -1867,7 +1867,7 @@ fn transitive_dep_in_git_workspace_no_root() -> Result<()> { /// to `uv-git-workspace-in-root`. Check that we are correctly resolving `uv-git-workspace-in-root` /// to a git dependency without a subdirectory and not relative to the checkout directory. #[test] -#[cfg(feature = "git")] +#[cfg(feature = "test-git")] fn transitive_dep_in_git_workspace_with_root() -> Result<()> { let context = TestContext::new("3.12"); diff --git a/scripts/scenarios/templates/compile.mustache b/scripts/scenarios/templates/compile.mustache index 2a3202662..20be5f85f 100644 --- a/scripts/scenarios/templates/compile.mustache +++ b/scripts/scenarios/templates/compile.mustache @@ -3,7 +3,7 @@ //! Generated with `{{generated_with}}` //! Scenarios from <{{generated_from}}> //! -#![cfg(all(feature = "python", feature = "pypi", unix))] +#![cfg(all(feature = "test-python", feature = "test-pypi", unix))] use std::env; use std::process::Command; @@ -51,7 +51,7 @@ fn command(context: &TestContext, python_versions: &[&str]) -> Command { {{/tree}} /// ``` {{#python_patch}} -#[cfg(feature = "python-patch")] +#[cfg(feature = "test-python-patch")] {{/python_patch}} #[test] fn {{module_name}}() -> Result<()> { diff --git a/scripts/scenarios/templates/install.mustache b/scripts/scenarios/templates/install.mustache index 8f1c477b2..249f82065 100644 --- a/scripts/scenarios/templates/install.mustache +++ b/scripts/scenarios/templates/install.mustache @@ -3,7 +3,7 @@ //! Generated with `{{generated_with}}` //! Scenarios from <{{generated_from}}> //! -#![cfg(all(feature = "python", feature = "pypi", unix))] +#![cfg(all(feature = "test-python", feature = "test-pypi", unix))] use std::process::Command; @@ -34,7 +34,7 @@ fn command(context: &TestContext) -> Command { {{/tree}} /// ``` {{#python_patch}} -#[cfg(feature = "python-patch")] +#[cfg(feature = "test-python-patch")] {{/python_patch}} #[test] fn {{module_name}}() { diff --git a/scripts/scenarios/templates/lock.mustache b/scripts/scenarios/templates/lock.mustache index 95804432c..67cc3738b 100644 --- a/scripts/scenarios/templates/lock.mustache +++ b/scripts/scenarios/templates/lock.mustache @@ -3,7 +3,7 @@ //! Generated with `{{generated_with}}` //! Scenarios from <{{generated_from}}> //! -#![cfg(all(feature = "python", feature = "pypi"))] +#![cfg(all(feature = "test-python", feature = "test-pypi"))] #![allow(clippy::needless_raw_string_hashes)] #![allow(clippy::doc_markdown)] #![allow(clippy::doc_lazy_continuation)]