From d09be146793e2f1414e05f5ce0de992e0861e82e Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Wed, 22 Jan 2025 14:16:38 -0600 Subject: [PATCH] Add missing `git` feature flag to various tests (#10873) --- crates/uv/tests/it/init.rs | 2 ++ crates/uv/tests/it/lock.rs | 6 ++++++ crates/uv/tests/it/pip_compile.rs | 3 +++ crates/uv/tests/it/pip_install.rs | 1 + crates/uv/tests/it/pip_list.rs | 1 + crates/uv/tests/it/sync.rs | 4 ++++ crates/uv/tests/it/workspace.rs | 2 ++ 7 files changed, 19 insertions(+) diff --git a/crates/uv/tests/it/init.rs b/crates/uv/tests/it/init.rs index 9157d2f671a8..215fae5c3a5b 100644 --- a/crates/uv/tests/it/init.rs +++ b/crates/uv/tests/it/init.rs @@ -2254,6 +2254,7 @@ fn init_failure() -> Result<()> { } #[test] +#[cfg(feature = "git")] fn init_git() -> Result<()> { let context = TestContext::new("3.12"); @@ -2314,6 +2315,7 @@ fn init_vcs_none() { /// Run `uv init` from within a Git repository. Do not try to reinitialize one. #[test] +#[cfg(feature = "git")] fn init_inside_git_repo() { let context = TestContext::new("3.12"); diff --git a/crates/uv/tests/it/lock.rs b/crates/uv/tests/it/lock.rs index fa68c22945d9..da799f6cf4d9 100644 --- a/crates/uv/tests/it/lock.rs +++ b/crates/uv/tests/it/lock.rs @@ -7765,6 +7765,7 @@ fn lock_redact_https() -> Result<()> { } #[test] +#[cfg(feature = "git")] fn lock_redact_git_pep508() -> Result<()> { let context = TestContext::new("3.12").with_filtered_link_mode_warning(); let token = decode_token(common::READ_ONLY_GITHUB_TOKEN); @@ -7853,6 +7854,7 @@ fn lock_redact_git_pep508() -> Result<()> { } #[test] +#[cfg(feature = "git")] fn lock_redact_git_sources() -> Result<()> { let context = TestContext::new("3.12").with_filtered_link_mode_warning(); let token = decode_token(common::READ_ONLY_GITHUB_TOKEN); @@ -7944,6 +7946,7 @@ fn lock_redact_git_sources() -> Result<()> { } #[test] +#[cfg(feature = "git")] fn lock_redact_git_pep508_non_project() -> Result<()> { let context = TestContext::new("3.12").with_filtered_link_mode_warning(); let token = decode_token(common::READ_ONLY_GITHUB_TOKEN); @@ -16597,6 +16600,7 @@ fn lock_dependency_metadata() -> Result<()> { } #[test] +#[cfg(feature = "git")] fn lock_dependency_metadata_git() -> Result<()> { let context = TestContext::new("3.12"); @@ -19363,6 +19367,7 @@ fn lock_group_workspace() -> Result<()> { } #[test] +#[cfg(feature = "git")] fn lock_transitive_git() -> Result<()> { let context = TestContext::new("3.12"); @@ -22095,6 +22100,7 @@ fn lock_split_on_windows() -> Result<()> { } #[test] +#[cfg(feature = "git")] fn lock_missing_git_prefix() -> Result<()> { 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 b4deda2566f7..d4e41efc21c5 100644 --- a/crates/uv/tests/it/pip_compile.rs +++ b/crates/uv/tests/it/pip_compile.rs @@ -1949,6 +1949,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")] fn compile_git_subdirectory_static_metadata() -> Result<()> { let context = TestContext::new("3.12"); @@ -4534,6 +4535,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")] fn generate_hashes_git() -> Result<()> { let context = TestContext::new("3.12"); let requirements_in = context.temp_dir.child("requirements.in"); @@ -11032,6 +11034,7 @@ fn unnamed_path_requirement() -> Result<()> { /// Detect the package name from an unnamed Git requirement. #[test] +#[cfg(feature = "git")] fn unnamed_git_requirement() -> Result<()> { let context = TestContext::new("3.12"); let requirements_in = context.temp_dir.child("requirements.in"); diff --git a/crates/uv/tests/it/pip_install.rs b/crates/uv/tests/it/pip_install.rs index 167e959025f9..30eb11c39c21 100644 --- a/crates/uv/tests/it/pip_install.rs +++ b/crates/uv/tests/it/pip_install.rs @@ -8032,6 +8032,7 @@ fn missing_git_prefix() -> Result<()> { } #[test] +#[cfg(feature = "git")] fn missing_subdirectory_git() -> Result<()> { let context = TestContext::new("3.12"); let requirements_txt = context.temp_dir.child("requirements.txt"); diff --git a/crates/uv/tests/it/pip_list.rs b/crates/uv/tests/it/pip_list.rs index 5025fda295ed..a47283daa378 100644 --- a/crates/uv/tests/it/pip_list.rs +++ b/crates/uv/tests/it/pip_list.rs @@ -189,6 +189,7 @@ fn list_outdated_freeze() { } #[test] +#[cfg(feature = "git")] fn list_outdated_git() -> Result<()> { let context = TestContext::new("3.12"); diff --git a/crates/uv/tests/it/sync.rs b/crates/uv/tests/it/sync.rs index 5fa32c8d67c0..46ab4cf5fe38 100644 --- a/crates/uv/tests/it/sync.rs +++ b/crates/uv/tests/it/sync.rs @@ -5380,6 +5380,7 @@ fn sync_stale_egg_info() -> Result<()> { /// See: #[test] +#[cfg(feature = "git")] fn sync_git_repeated_member_static_metadata() -> Result<()> { let context = TestContext::new("3.13"); @@ -5472,6 +5473,7 @@ fn sync_git_repeated_member_static_metadata() -> Result<()> { /// See: #[test] +#[cfg(feature = "git")] fn sync_git_repeated_member_dynamic_metadata() -> Result<()> { let context = TestContext::new("3.13"); @@ -5589,6 +5591,7 @@ fn sync_git_repeated_member_dynamic_metadata() -> Result<()> { /// See: #[test] +#[cfg(feature = "git")] fn sync_git_repeated_member_backwards_path() -> Result<()> { let context = TestContext::new("3.13"); @@ -5770,6 +5773,7 @@ fn mismatched_name_cached_wheel() -> Result<()> { /// /// See: #[test] +#[cfg(feature = "git")] fn sync_git_path_dependency() -> Result<()> { let context = TestContext::new("3.13"); diff --git a/crates/uv/tests/it/workspace.rs b/crates/uv/tests/it/workspace.rs index 4ef357929c66..432c3216a6a5 100644 --- a/crates/uv/tests/it/workspace.rs +++ b/crates/uv/tests/it/workspace.rs @@ -1765,6 +1765,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")] fn transitive_dep_in_git_workspace_no_root() -> Result<()> { let context = TestContext::new("3.12"); @@ -1839,6 +1840,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")] fn transitive_dep_in_git_workspace_with_root() -> Result<()> { let context = TestContext::new("3.12");