mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-07 13:25:00 +00:00
Rename PartitionedRequirements
to InstallPlan
(#340)
@konstin named this file at some point and I like it, it feels appropriate for the struct itself too.
This commit is contained in:
parent
d9bcfafa16
commit
1f447892f3
4 changed files with 10 additions and 10 deletions
|
@ -14,7 +14,7 @@ use platform_tags::Tags;
|
|||
use puffin_client::RegistryClientBuilder;
|
||||
use puffin_dispatch::BuildDispatch;
|
||||
use puffin_distribution::Distribution;
|
||||
use puffin_installer::{Builder, PartitionedRequirements};
|
||||
use puffin_installer::{Builder, InstallPlan};
|
||||
use puffin_interpreter::Virtualenv;
|
||||
|
||||
use crate::commands::reporters::{
|
||||
|
@ -69,11 +69,11 @@ pub(crate) async fn sync_requirements(
|
|||
|
||||
// Partition into those that should be linked from the cache (`local`), those that need to be
|
||||
// downloaded (`remote`), and those that should be removed (`extraneous`).
|
||||
let PartitionedRequirements {
|
||||
let InstallPlan {
|
||||
local,
|
||||
remote,
|
||||
extraneous,
|
||||
} = PartitionedRequirements::try_from_requirements(requirements, cache, &venv)?;
|
||||
} = InstallPlan::try_from_requirements(requirements, cache, &venv)?;
|
||||
|
||||
// Nothing to do.
|
||||
if remote.is_empty() && local.is_empty() && extraneous.is_empty() {
|
||||
|
|
|
@ -15,7 +15,7 @@ use pep508_rs::Requirement;
|
|||
use platform_tags::Tags;
|
||||
use puffin_build::{SourceDistributionBuild, SourceDistributionBuildContext};
|
||||
use puffin_client::RegistryClient;
|
||||
use puffin_installer::{Builder, Downloader, Installer, PartitionedRequirements, Unzipper};
|
||||
use puffin_installer::{Builder, Downloader, InstallPlan, Installer, Unzipper};
|
||||
use puffin_interpreter::{InterpreterInfo, Virtualenv};
|
||||
use puffin_resolver::{DistributionFinder, Manifest, PreReleaseMode, ResolutionMode, Resolver};
|
||||
use puffin_traits::BuildContext;
|
||||
|
@ -104,11 +104,11 @@ impl BuildContext for BuildDispatch {
|
|||
venv.root().display(),
|
||||
);
|
||||
|
||||
let PartitionedRequirements {
|
||||
let InstallPlan {
|
||||
local,
|
||||
remote,
|
||||
extraneous,
|
||||
} = PartitionedRequirements::try_from_requirements(requirements, &self.cache, venv)?;
|
||||
} = InstallPlan::try_from_requirements(requirements, &self.cache, venv)?;
|
||||
|
||||
let tags = Tags::from_env(
|
||||
self.interpreter_info.platform(),
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
pub use builder::{Builder, Reporter as BuildReporter};
|
||||
pub use downloader::{Download, Downloader, Reporter as DownloadReporter};
|
||||
pub use installer::{Installer, Reporter as InstallReporter};
|
||||
pub use plan::PartitionedRequirements;
|
||||
pub use plan::InstallPlan;
|
||||
pub use registry_index::RegistryIndex;
|
||||
pub use site_packages::SitePackages;
|
||||
pub use uninstall::uninstall;
|
||||
|
|
|
@ -11,7 +11,7 @@ use crate::url_index::UrlIndex;
|
|||
use crate::{RegistryIndex, SitePackages};
|
||||
|
||||
#[derive(Debug, Default)]
|
||||
pub struct PartitionedRequirements {
|
||||
pub struct InstallPlan {
|
||||
/// The distributions that are not already installed in the current environment, but are
|
||||
/// available in the local cache.
|
||||
pub local: Vec<CachedDistribution>,
|
||||
|
@ -25,7 +25,7 @@ pub struct PartitionedRequirements {
|
|||
pub extraneous: Vec<InstalledDistribution>,
|
||||
}
|
||||
|
||||
impl PartitionedRequirements {
|
||||
impl InstallPlan {
|
||||
/// Partition a set of requirements into those that should be linked from the cache, those that
|
||||
/// need to be downloaded, and those that should be removed.
|
||||
pub fn try_from_requirements(
|
||||
|
@ -93,7 +93,7 @@ impl PartitionedRequirements {
|
|||
extraneous.push(dist_info);
|
||||
}
|
||||
|
||||
Ok(PartitionedRequirements {
|
||||
Ok(InstallPlan {
|
||||
local,
|
||||
remote,
|
||||
extraneous,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue