Move pip commands into their own module (#3565)

## Summary

Matching the structure of the `project` module and API.
This commit is contained in:
Charlie Marsh 2024-05-13 21:34:14 -04:00 committed by GitHub
parent c22c7cad4c
commit 325265ec16
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 20 additions and 21 deletions

View file

@ -8,14 +8,14 @@ pub(crate) use cache_clean::cache_clean;
pub(crate) use cache_dir::cache_dir;
pub(crate) use cache_prune::cache_prune;
use distribution_types::InstalledMetadata;
pub(crate) use pip_check::pip_check;
pub(crate) use pip_compile::{extra_name_with_clap_error, pip_compile};
pub(crate) use pip_freeze::pip_freeze;
pub(crate) use pip_install::pip_install;
pub(crate) use pip_list::pip_list;
pub(crate) use pip_show::pip_show;
pub(crate) use pip_sync::pip_sync;
pub(crate) use pip_uninstall::pip_uninstall;
pub(crate) use pip::check::pip_check;
pub(crate) use pip::compile::{extra_name_with_clap_error, pip_compile};
pub(crate) use pip::freeze::pip_freeze;
pub(crate) use pip::install::pip_install;
pub(crate) use pip::list::pip_list;
pub(crate) use pip::show::pip_show;
pub(crate) use pip::sync::pip_sync;
pub(crate) use pip::uninstall::pip_uninstall;
pub(crate) use project::lock::lock;
pub(crate) use project::run::run;
pub(crate) use project::sync::sync;
@ -34,14 +34,7 @@ use crate::printer::Printer;
mod cache_clean;
mod cache_dir;
mod cache_prune;
mod pip_check;
mod pip_compile;
mod pip_freeze;
mod pip_install;
mod pip_list;
mod pip_show;
mod pip_sync;
mod pip_uninstall;
mod pip;
mod project;
mod reporters;
#[cfg(feature = "self-update")]

View file

@ -5,6 +5,7 @@ use std::path::Path;
use anstream::eprint;
use anyhow::{anyhow, Context, Result};
use fs_err as fs;
use indexmap::IndexMap;
use itertools::Itertools;
use owo_colors::OwoColorize;
use tempfile::tempdir_in;
@ -15,7 +16,6 @@ use distribution_types::{
LocalEditable, LocalEditables, Name, ParsedUrl, ParsedUrlError, RequirementSource, Resolution,
};
use distribution_types::{Requirement, Requirements};
use indexmap::IndexMap;
use install_wheel_rs::linker::LinkMode;
use pep440_rs::{VersionSpecifier, VersionSpecifiers};
use pep508_rs::{MarkerEnvironment, VerbatimUrl};
@ -53,11 +53,10 @@ use uv_types::{BuildIsolation, HashStrategy, InFlight};
use uv_warnings::warn_user;
use crate::commands::reporters::{DownloadReporter, InstallReporter, ResolverReporter};
use crate::commands::DryRunEvent;
use crate::commands::{compile_bytecode, elapsed, ChangeEvent, ChangeEventKind, ExitStatus};
use crate::printer::Printer;
use super::DryRunEvent;
/// Install packages into the current environment.
#[allow(clippy::too_many_arguments, clippy::fn_params_excessive_bools)]
pub(crate) async fn pip_install(

View file

@ -16,10 +16,9 @@ use uv_interpreter::PythonEnvironment;
use uv_normalize::PackageName;
use crate::commands::ExitStatus;
use crate::commands::ListFormat;
use crate::printer::Printer;
use super::ListFormat;
/// Enumerate the installed packages in the current environment.
#[allow(clippy::too_many_arguments, clippy::fn_params_excessive_bools)]
pub(crate) fn pip_list(

View 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;