mirror of
https://github.com/astral-sh/uv.git
synced 2025-10-02 15:01:16 +00:00
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:
parent
e31604e38b
commit
d7e10bb4a2
2 changed files with 5 additions and 4 deletions
|
@ -91,7 +91,7 @@ pub(crate) async fn run(
|
||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
project::sync::do_sync(
|
project::sync::do_sync(
|
||||||
&project,
|
project.project_name(),
|
||||||
&venv,
|
&venv,
|
||||||
&lock,
|
&lock,
|
||||||
&index_locations,
|
&index_locations,
|
||||||
|
|
|
@ -12,6 +12,7 @@ use uv_dispatch::BuildDispatch;
|
||||||
use uv_distribution::{ProjectWorkspace, DEV_DEPENDENCIES};
|
use uv_distribution::{ProjectWorkspace, DEV_DEPENDENCIES};
|
||||||
use uv_git::GitResolver;
|
use uv_git::GitResolver;
|
||||||
use uv_installer::SitePackages;
|
use uv_installer::SitePackages;
|
||||||
|
use uv_normalize::PackageName;
|
||||||
use uv_resolver::{FlatIndex, InMemoryIndex, Lock};
|
use uv_resolver::{FlatIndex, InMemoryIndex, Lock};
|
||||||
use uv_toolchain::PythonEnvironment;
|
use uv_toolchain::PythonEnvironment;
|
||||||
use uv_types::{BuildIsolation, HashStrategy, InFlight};
|
use uv_types::{BuildIsolation, HashStrategy, InFlight};
|
||||||
|
@ -58,7 +59,7 @@ pub(crate) async fn sync(
|
||||||
|
|
||||||
// Perform the sync operation.
|
// Perform the sync operation.
|
||||||
do_sync(
|
do_sync(
|
||||||
&project,
|
project.project_name(),
|
||||||
&venv,
|
&venv,
|
||||||
&lock,
|
&lock,
|
||||||
&index_locations,
|
&index_locations,
|
||||||
|
@ -76,7 +77,7 @@ pub(crate) async fn sync(
|
||||||
/// Sync a lockfile with an environment.
|
/// Sync a lockfile with an environment.
|
||||||
#[allow(clippy::too_many_arguments)]
|
#[allow(clippy::too_many_arguments)]
|
||||||
pub(super) async fn do_sync(
|
pub(super) async fn do_sync(
|
||||||
project: &ProjectWorkspace,
|
project: &PackageName,
|
||||||
venv: &PythonEnvironment,
|
venv: &PythonEnvironment,
|
||||||
lock: &Lock,
|
lock: &Lock,
|
||||||
index_locations: &IndexLocations,
|
index_locations: &IndexLocations,
|
||||||
|
@ -107,7 +108,7 @@ pub(super) async fn do_sync(
|
||||||
let tags = venv.interpreter().tags()?;
|
let tags = venv.interpreter().tags()?;
|
||||||
|
|
||||||
// Read the lockfile.
|
// 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.
|
// Initialize the registry client.
|
||||||
// TODO(zanieb): Support client options e.g. offline, tls, etc.
|
// TODO(zanieb): Support client options e.g. offline, tls, etc.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue