mirror of https://github.com/astral-sh/uv
Add missing "git" feature to various tests (#5910)
This commit is contained in:
parent
ae6b59365f
commit
4fd9b115d5
|
|
@ -131,6 +131,7 @@ fn add_registry() -> Result<()> {
|
||||||
|
|
||||||
/// Add a Git requirement.
|
/// Add a Git requirement.
|
||||||
#[test]
|
#[test]
|
||||||
|
#[cfg(feature = "git")]
|
||||||
fn add_git() -> Result<()> {
|
fn add_git() -> Result<()> {
|
||||||
let context = TestContext::new("3.12");
|
let context = TestContext::new("3.12");
|
||||||
|
|
||||||
|
|
@ -291,6 +292,7 @@ fn add_git() -> Result<()> {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
#[cfg(feature = "git")]
|
||||||
fn add_git_error() -> Result<()> {
|
fn add_git_error() -> Result<()> {
|
||||||
let context = TestContext::new("3.12");
|
let context = TestContext::new("3.12");
|
||||||
|
|
||||||
|
|
@ -350,6 +352,7 @@ fn add_git_error() -> Result<()> {
|
||||||
|
|
||||||
/// Add a Git requirement using the `--raw-sources` API.
|
/// Add a Git requirement using the `--raw-sources` API.
|
||||||
#[test]
|
#[test]
|
||||||
|
#[cfg(feature = "git")]
|
||||||
fn add_git_raw() -> Result<()> {
|
fn add_git_raw() -> Result<()> {
|
||||||
let context = TestContext::new("3.12");
|
let context = TestContext::new("3.12");
|
||||||
|
|
||||||
|
|
@ -499,6 +502,7 @@ fn add_git_raw() -> Result<()> {
|
||||||
|
|
||||||
/// Add a Git requirement without the `git+` prefix.
|
/// Add a Git requirement without the `git+` prefix.
|
||||||
#[test]
|
#[test]
|
||||||
|
#[cfg(feature = "git")]
|
||||||
fn add_git_implicit() -> Result<()> {
|
fn add_git_implicit() -> Result<()> {
|
||||||
let context = TestContext::new("3.12");
|
let context = TestContext::new("3.12");
|
||||||
|
|
||||||
|
|
@ -557,6 +561,7 @@ fn add_git_implicit() -> Result<()> {
|
||||||
|
|
||||||
/// `--raw-sources` should be considered conflicting with sources-specific arguments, like `--tag`.
|
/// `--raw-sources` should be considered conflicting with sources-specific arguments, like `--tag`.
|
||||||
#[test]
|
#[test]
|
||||||
|
#[cfg(feature = "git")]
|
||||||
fn add_raw_error() -> Result<()> {
|
fn add_raw_error() -> Result<()> {
|
||||||
let context = TestContext::new("3.12");
|
let context = TestContext::new("3.12");
|
||||||
|
|
||||||
|
|
@ -588,6 +593,7 @@ fn add_raw_error() -> Result<()> {
|
||||||
|
|
||||||
/// Add an unnamed requirement.
|
/// Add an unnamed requirement.
|
||||||
#[test]
|
#[test]
|
||||||
|
#[cfg(feature = "git")]
|
||||||
fn add_unnamed() -> Result<()> {
|
fn add_unnamed() -> Result<()> {
|
||||||
let context = TestContext::new("3.12");
|
let context = TestContext::new("3.12");
|
||||||
|
|
||||||
|
|
@ -1412,6 +1418,7 @@ fn add_workspace_editable() -> Result<()> {
|
||||||
|
|
||||||
/// Update a requirement, modifying the source and extras.
|
/// Update a requirement, modifying the source and extras.
|
||||||
#[test]
|
#[test]
|
||||||
|
#[cfg(feature = "git")]
|
||||||
fn update() -> Result<()> {
|
fn update() -> Result<()> {
|
||||||
let context = TestContext::new("3.12");
|
let context = TestContext::new("3.12");
|
||||||
|
|
||||||
|
|
@ -1691,6 +1698,7 @@ fn update() -> Result<()> {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
#[cfg(feature = "git")]
|
||||||
fn update_source_replace_url() -> Result<()> {
|
fn update_source_replace_url() -> Result<()> {
|
||||||
let context = TestContext::new("3.12");
|
let context = TestContext::new("3.12");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -228,6 +228,7 @@ fn lock_sdist_registry() -> Result<()> {
|
||||||
|
|
||||||
/// Lock a Git requirement using `tool.uv.sources`.
|
/// Lock a Git requirement using `tool.uv.sources`.
|
||||||
#[test]
|
#[test]
|
||||||
|
#[cfg(feature = "git")]
|
||||||
fn lock_sdist_git() -> Result<()> {
|
fn lock_sdist_git() -> Result<()> {
|
||||||
let context = TestContext::new("3.12");
|
let context = TestContext::new("3.12");
|
||||||
|
|
||||||
|
|
@ -501,6 +502,7 @@ fn lock_sdist_git() -> Result<()> {
|
||||||
|
|
||||||
/// Lock a Git requirement using PEP 508.
|
/// Lock a Git requirement using PEP 508.
|
||||||
#[test]
|
#[test]
|
||||||
|
#[cfg(feature = "git")]
|
||||||
fn lock_sdist_git_pep508() -> Result<()> {
|
fn lock_sdist_git_pep508() -> Result<()> {
|
||||||
let context = TestContext::new("3.12");
|
let context = TestContext::new("3.12");
|
||||||
|
|
||||||
|
|
@ -2327,6 +2329,7 @@ fn lock_preference() -> Result<()> {
|
||||||
|
|
||||||
/// Respect locked versions with `uv lock`, unless `--upgrade` is passed.
|
/// Respect locked versions with `uv lock`, unless `--upgrade` is passed.
|
||||||
#[test]
|
#[test]
|
||||||
|
#[cfg(feature = "git")]
|
||||||
fn lock_git_sha() -> Result<()> {
|
fn lock_git_sha() -> Result<()> {
|
||||||
let context = TestContext::new("3.12");
|
let context = TestContext::new("3.12");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1894,6 +1894,7 @@ fn conflicting_transitive_url_dependency() -> Result<()> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Request `uv-public-pypackage` via two different URLs which resolve to the same canonical version.
|
/// Request `uv-public-pypackage` via two different URLs which resolve to the same canonical version.
|
||||||
|
#[cfg(feature = "git")]
|
||||||
#[test]
|
#[test]
|
||||||
fn compatible_repeated_url_dependency() -> Result<()> {
|
fn compatible_repeated_url_dependency() -> Result<()> {
|
||||||
let context = TestContext::new("3.12");
|
let context = TestContext::new("3.12");
|
||||||
|
|
@ -1923,6 +1924,7 @@ fn compatible_repeated_url_dependency() -> Result<()> {
|
||||||
|
|
||||||
/// Request `uv-public-pypackage` via two different URLs which resolve to the same repository, but
|
/// Request `uv-public-pypackage` via two different URLs which resolve to the same repository, but
|
||||||
/// different commits.
|
/// different commits.
|
||||||
|
#[cfg(feature = "git")]
|
||||||
#[test]
|
#[test]
|
||||||
fn conflicting_repeated_url_dependency() -> Result<()> {
|
fn conflicting_repeated_url_dependency() -> Result<()> {
|
||||||
let context = TestContext::new("3.12");
|
let context = TestContext::new("3.12");
|
||||||
|
|
@ -1950,6 +1952,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.
|
/// 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.
|
/// All three are compatible, since they resolve to the same canonical version.
|
||||||
|
#[cfg(feature = "git")]
|
||||||
#[test]
|
#[test]
|
||||||
fn compatible_narrowed_url_dependency() -> Result<()> {
|
fn compatible_narrowed_url_dependency() -> Result<()> {
|
||||||
let context = TestContext::new("3.12");
|
let context = TestContext::new("3.12");
|
||||||
|
|
@ -1980,6 +1983,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`.
|
/// 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.
|
/// All three are compatible, since they resolve to the same canonical version.
|
||||||
|
#[cfg(feature = "git")]
|
||||||
#[test]
|
#[test]
|
||||||
fn compatible_broader_url_dependency() -> Result<()> {
|
fn compatible_broader_url_dependency() -> Result<()> {
|
||||||
let context = TestContext::new("3.12");
|
let context = TestContext::new("3.12");
|
||||||
|
|
@ -2043,6 +2047,7 @@ fn compatible_repeated_narrowed_url_dependency() -> Result<()> {
|
||||||
///
|
///
|
||||||
/// Although `0.0.2` and the precise SHA resolve to the same canonical version, `test-branch`
|
/// 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.
|
/// resolves to a different version, so there should be a conflict.
|
||||||
|
#[cfg(feature = "git")]
|
||||||
#[test]
|
#[test]
|
||||||
fn incompatible_narrowed_url_dependency() -> Result<()> {
|
fn incompatible_narrowed_url_dependency() -> Result<()> {
|
||||||
let context = TestContext::new("3.12");
|
let context = TestContext::new("3.12");
|
||||||
|
|
@ -3890,6 +3895,7 @@ fn recursive_extras_direct_url() -> Result<()> {
|
||||||
|
|
||||||
/// Compile an editable package with a direct URL requirement.
|
/// Compile an editable package with a direct URL requirement.
|
||||||
#[test]
|
#[test]
|
||||||
|
#[cfg(feature = "git")]
|
||||||
fn compile_editable_url_requirement() -> Result<()> {
|
fn compile_editable_url_requirement() -> Result<()> {
|
||||||
let context = TestContext::new("3.12");
|
let context = TestContext::new("3.12");
|
||||||
let requirements_in = context.temp_dir.child("requirements.in");
|
let requirements_in = context.temp_dir.child("requirements.in");
|
||||||
|
|
@ -11454,6 +11460,7 @@ fn dont_warn_missing_constraint_without_sources() -> Result<()> {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
#[cfg(feature = "git")]
|
||||||
fn tool_uv_sources() -> Result<()> {
|
fn tool_uv_sources() -> Result<()> {
|
||||||
let context = TestContext::new("3.12");
|
let context = TestContext::new("3.12");
|
||||||
// Use a subdir to test path normalization.
|
// Use a subdir to test path normalization.
|
||||||
|
|
|
||||||
|
|
@ -3999,6 +3999,7 @@ fn require_hashes_wheel_url_mismatch() -> Result<()> {
|
||||||
|
|
||||||
/// Reject Git dependencies when `--require-hashes` is provided.
|
/// Reject Git dependencies when `--require-hashes` is provided.
|
||||||
#[test]
|
#[test]
|
||||||
|
#[cfg(feature = "git")]
|
||||||
fn require_hashes_git() -> Result<()> {
|
fn require_hashes_git() -> Result<()> {
|
||||||
let context = TestContext::new("3.12");
|
let context = TestContext::new("3.12");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1311,6 +1311,7 @@ fn no_dedupe() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
#[cfg(feature = "git")]
|
||||||
fn with_editable() {
|
fn with_editable() {
|
||||||
let context = TestContext::new("3.12");
|
let context = TestContext::new("3.12");
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue