Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions crates/uv-resolver/src/lock/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,6 @@ impl Lock {
overrides: &[Requirement],
dependency_metadata: &DependencyMetadata,
indexes: Option<&IndexLocations>,
build_options: &BuildOptions,
tags: &Tags,
hasher: &HashStrategy,
index: &InMemoryIndex,
Expand Down Expand Up @@ -1183,8 +1182,13 @@ impl Lock {
// Get the metadata for the distribution.
let dist = package.to_dist(
workspace.install_path(),
// When validating, it's okay to use wheels that don't match the current platform.
TagPolicy::Preferred(tags),
build_options,
// When validating, it's okay to use (e.g.) a source distribution with `--no-build`.
// We're just trying to determine whether the lockfile is up-to-date. If we end
// up needing to build a source distribution in order to do so, below, we'll error
// there.
&BuildOptions::default(),
)?;

// Fetch the metadata for the distribution.
Expand Down
6 changes: 1 addition & 5 deletions crates/uv/src/commands/project/lock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ use tracing::debug;
use uv_cache::Cache;
use uv_client::{Connectivity, FlatIndexClient, RegistryClientBuilder};
use uv_configuration::{
BuildOptions, Concurrency, Constraints, ExtrasSpecification, LowerBound, Reinstall,
TrustedHost, Upgrade,
Concurrency, Constraints, ExtrasSpecification, LowerBound, Reinstall, TrustedHost, Upgrade,
};
use uv_dispatch::BuildDispatch;
use uv_distribution::DistributionDatabase;
Expand Down Expand Up @@ -531,7 +530,6 @@ async fn do_lock(
interpreter,
&requires_python,
index_locations,
build_options,
upgrade,
&options,
&hasher,
Expand Down Expand Up @@ -714,7 +712,6 @@ impl ValidatedLock {
interpreter: &Interpreter,
requires_python: &RequiresPython,
index_locations: &IndexLocations,
build_options: &BuildOptions,
upgrade: &Upgrade,
options: &Options,
hasher: &HashStrategy,
Expand Down Expand Up @@ -841,7 +838,6 @@ impl ValidatedLock {
overrides,
dependency_metadata,
indexes,
build_options,
interpreter.tags()?,
hasher,
index,
Expand Down
4 changes: 1 addition & 3 deletions crates/uv/tests/it/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1997,20 +1997,18 @@ fn no_install_project_no_build() -> Result<()> {
----- stdout -----

----- stderr -----
warning: Failed to validate existing lockfile: Distribution `project==0.1.0 @ editable+.` can't be installed because it is marked as `--no-build` but has no binary distribution
Resolved 4 packages in [TIME]
error: Distribution `project==0.1.0 @ editable+.` can't be installed because it is marked as `--no-build` but has no binary distribution
"###);

// But it's fine to combine `--no-install-project` with `--no-build`. We shouldn't error, since
// we aren't building the project.
uv_snapshot!(context.filters(), context.sync().arg("--no-install-project").arg("--no-build"), @r###"
uv_snapshot!(context.filters(), context.sync().arg("--no-install-project").arg("--no-build").arg("--locked"), @r###"
success: true
exit_code: 0
----- stdout -----

----- stderr -----
warning: Failed to validate existing lockfile: Distribution `project==0.1.0 @ editable+.` can't be installed because it is marked as `--no-build` but has no binary distribution
Resolved 4 packages in [TIME]
Prepared 3 packages in [TIME]
Installed 3 packages in [TIME]
Expand Down
Loading