Remove project dependency from sync (#4211)

## Summary

This is architecturally desirable because it means syncing is
independent from the project (e.g., the `pyproject.toml` and friends).
This commit is contained in:
Charlie Marsh 2024-06-10 12:23:37 -07:00 committed by GitHub
parent e31604e38b
commit d7e10bb4a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 4 deletions

View file

@ -91,7 +91,7 @@ pub(crate) async fn run(
)
.await?;
project::sync::do_sync(
&project,
project.project_name(),
&venv,
&lock,
&index_locations,

View file

@ -12,6 +12,7 @@ use uv_dispatch::BuildDispatch;
use uv_distribution::{ProjectWorkspace, DEV_DEPENDENCIES};
use uv_git::GitResolver;
use uv_installer::SitePackages;
use uv_normalize::PackageName;
use uv_resolver::{FlatIndex, InMemoryIndex, Lock};
use uv_toolchain::PythonEnvironment;
use uv_types::{BuildIsolation, HashStrategy, InFlight};
@ -58,7 +59,7 @@ pub(crate) async fn sync(
// Perform the sync operation.
do_sync(
&project,
project.project_name(),
&venv,
&lock,
&index_locations,
@ -76,7 +77,7 @@ pub(crate) async fn sync(
/// Sync a lockfile with an environment.
#[allow(clippy::too_many_arguments)]
pub(super) async fn do_sync(
project: &ProjectWorkspace,
project: &PackageName,
venv: &PythonEnvironment,
lock: &Lock,
index_locations: &IndexLocations,
@ -107,7 +108,7 @@ pub(super) async fn do_sync(
let tags = venv.interpreter().tags()?;
// Read the lockfile.
let resolution = lock.to_resolution(markers, tags, project.project_name(), &extras, &dev)?;
let resolution = lock.to_resolution(markers, tags, project, &extras, &dev)?;
// Initialize the registry client.
// TODO(zanieb): Support client options e.g. offline, tls, etc.