mirror of
https://github.com/astral-sh/uv.git
synced 2025-10-01 22:41:16 +00:00
Move pip
commands into their own module (#3565)
## Summary Matching the structure of the `project` module and API.
This commit is contained in:
parent
c22c7cad4c
commit
325265ec16
10 changed files with 20 additions and 21 deletions
|
@ -8,14 +8,14 @@ pub(crate) use cache_clean::cache_clean;
|
||||||
pub(crate) use cache_dir::cache_dir;
|
pub(crate) use cache_dir::cache_dir;
|
||||||
pub(crate) use cache_prune::cache_prune;
|
pub(crate) use cache_prune::cache_prune;
|
||||||
use distribution_types::InstalledMetadata;
|
use distribution_types::InstalledMetadata;
|
||||||
pub(crate) use pip_check::pip_check;
|
pub(crate) use pip::check::pip_check;
|
||||||
pub(crate) use pip_compile::{extra_name_with_clap_error, pip_compile};
|
pub(crate) use pip::compile::{extra_name_with_clap_error, pip_compile};
|
||||||
pub(crate) use pip_freeze::pip_freeze;
|
pub(crate) use pip::freeze::pip_freeze;
|
||||||
pub(crate) use pip_install::pip_install;
|
pub(crate) use pip::install::pip_install;
|
||||||
pub(crate) use pip_list::pip_list;
|
pub(crate) use pip::list::pip_list;
|
||||||
pub(crate) use pip_show::pip_show;
|
pub(crate) use pip::show::pip_show;
|
||||||
pub(crate) use pip_sync::pip_sync;
|
pub(crate) use pip::sync::pip_sync;
|
||||||
pub(crate) use pip_uninstall::pip_uninstall;
|
pub(crate) use pip::uninstall::pip_uninstall;
|
||||||
pub(crate) use project::lock::lock;
|
pub(crate) use project::lock::lock;
|
||||||
pub(crate) use project::run::run;
|
pub(crate) use project::run::run;
|
||||||
pub(crate) use project::sync::sync;
|
pub(crate) use project::sync::sync;
|
||||||
|
@ -34,14 +34,7 @@ use crate::printer::Printer;
|
||||||
mod cache_clean;
|
mod cache_clean;
|
||||||
mod cache_dir;
|
mod cache_dir;
|
||||||
mod cache_prune;
|
mod cache_prune;
|
||||||
mod pip_check;
|
mod pip;
|
||||||
mod pip_compile;
|
|
||||||
mod pip_freeze;
|
|
||||||
mod pip_install;
|
|
||||||
mod pip_list;
|
|
||||||
mod pip_show;
|
|
||||||
mod pip_sync;
|
|
||||||
mod pip_uninstall;
|
|
||||||
mod project;
|
mod project;
|
||||||
mod reporters;
|
mod reporters;
|
||||||
#[cfg(feature = "self-update")]
|
#[cfg(feature = "self-update")]
|
||||||
|
|
|
@ -5,6 +5,7 @@ use std::path::Path;
|
||||||
use anstream::eprint;
|
use anstream::eprint;
|
||||||
use anyhow::{anyhow, Context, Result};
|
use anyhow::{anyhow, Context, Result};
|
||||||
use fs_err as fs;
|
use fs_err as fs;
|
||||||
|
use indexmap::IndexMap;
|
||||||
use itertools::Itertools;
|
use itertools::Itertools;
|
||||||
use owo_colors::OwoColorize;
|
use owo_colors::OwoColorize;
|
||||||
use tempfile::tempdir_in;
|
use tempfile::tempdir_in;
|
||||||
|
@ -15,7 +16,6 @@ use distribution_types::{
|
||||||
LocalEditable, LocalEditables, Name, ParsedUrl, ParsedUrlError, RequirementSource, Resolution,
|
LocalEditable, LocalEditables, Name, ParsedUrl, ParsedUrlError, RequirementSource, Resolution,
|
||||||
};
|
};
|
||||||
use distribution_types::{Requirement, Requirements};
|
use distribution_types::{Requirement, Requirements};
|
||||||
use indexmap::IndexMap;
|
|
||||||
use install_wheel_rs::linker::LinkMode;
|
use install_wheel_rs::linker::LinkMode;
|
||||||
use pep440_rs::{VersionSpecifier, VersionSpecifiers};
|
use pep440_rs::{VersionSpecifier, VersionSpecifiers};
|
||||||
use pep508_rs::{MarkerEnvironment, VerbatimUrl};
|
use pep508_rs::{MarkerEnvironment, VerbatimUrl};
|
||||||
|
@ -53,11 +53,10 @@ use uv_types::{BuildIsolation, HashStrategy, InFlight};
|
||||||
use uv_warnings::warn_user;
|
use uv_warnings::warn_user;
|
||||||
|
|
||||||
use crate::commands::reporters::{DownloadReporter, InstallReporter, ResolverReporter};
|
use crate::commands::reporters::{DownloadReporter, InstallReporter, ResolverReporter};
|
||||||
|
use crate::commands::DryRunEvent;
|
||||||
use crate::commands::{compile_bytecode, elapsed, ChangeEvent, ChangeEventKind, ExitStatus};
|
use crate::commands::{compile_bytecode, elapsed, ChangeEvent, ChangeEventKind, ExitStatus};
|
||||||
use crate::printer::Printer;
|
use crate::printer::Printer;
|
||||||
|
|
||||||
use super::DryRunEvent;
|
|
||||||
|
|
||||||
/// Install packages into the current environment.
|
/// Install packages into the current environment.
|
||||||
#[allow(clippy::too_many_arguments, clippy::fn_params_excessive_bools)]
|
#[allow(clippy::too_many_arguments, clippy::fn_params_excessive_bools)]
|
||||||
pub(crate) async fn pip_install(
|
pub(crate) async fn pip_install(
|
|
@ -16,10 +16,9 @@ use uv_interpreter::PythonEnvironment;
|
||||||
use uv_normalize::PackageName;
|
use uv_normalize::PackageName;
|
||||||
|
|
||||||
use crate::commands::ExitStatus;
|
use crate::commands::ExitStatus;
|
||||||
|
use crate::commands::ListFormat;
|
||||||
use crate::printer::Printer;
|
use crate::printer::Printer;
|
||||||
|
|
||||||
use super::ListFormat;
|
|
||||||
|
|
||||||
/// Enumerate the installed packages in the current environment.
|
/// Enumerate the installed packages in the current environment.
|
||||||
#[allow(clippy::too_many_arguments, clippy::fn_params_excessive_bools)]
|
#[allow(clippy::too_many_arguments, clippy::fn_params_excessive_bools)]
|
||||||
pub(crate) fn pip_list(
|
pub(crate) fn pip_list(
|
8
crates/uv/src/commands/pip/mod.rs
Normal file
8
crates/uv/src/commands/pip/mod.rs
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
pub(crate) mod check;
|
||||||
|
pub(crate) mod compile;
|
||||||
|
pub(crate) mod freeze;
|
||||||
|
pub(crate) mod install;
|
||||||
|
pub(crate) mod list;
|
||||||
|
pub(crate) mod show;
|
||||||
|
pub(crate) mod sync;
|
||||||
|
pub(crate) mod uninstall;
|
Loading…
Add table
Add a link
Reference in a new issue