diff --git a/crates/pep508-rs/src/lib.rs b/crates/pep508-rs/src/lib.rs index 5f8f17dfb..79135804c 100644 --- a/crates/pep508-rs/src/lib.rs +++ b/crates/pep508-rs/src/lib.rs @@ -551,11 +551,6 @@ impl Extras { pub fn parse(input: &str) -> Result> { Ok(Self(parse_extras_cursor(&mut Cursor::new(input))?)) } - - /// Convert the [`Extras`] into a [`Vec`] of [`ExtraName`]. - pub fn into_vec(self) -> Vec { - self.0 - } } /// The actual version specifier or URL to install. diff --git a/crates/uv-cli/src/options.rs b/crates/uv-cli/src/options.rs index 77cdacf46..bed053794 100644 --- a/crates/uv-cli/src/options.rs +++ b/crates/uv-cli/src/options.rs @@ -1,7 +1,7 @@ use uv_cache::Refresh; use uv_configuration::ConfigSettings; use uv_resolver::PreReleaseMode; -use uv_settings::{InstallerOptions, PipOptions, ResolverInstallerOptions, ResolverOptions}; +use uv_settings::{PipOptions, ResolverInstallerOptions, ResolverOptions}; use crate::{ BuildArgs, IndexArgs, InstallerArgs, Maybe, RefreshArgs, ResolverArgs, ResolverInstallerArgs, @@ -166,61 +166,6 @@ impl From for PipOptions { } } -/// Construct the [`InstallerOptions`] from the [`InstallerArgs`] and [`BuildArgs`]. -pub fn installer_options(installer_args: InstallerArgs, build_args: BuildArgs) -> InstallerOptions { - let InstallerArgs { - index_args, - reinstall, - no_reinstall, - reinstall_package, - index_strategy, - keyring_provider, - config_setting, - exclude_newer, - link_mode, - compile_bytecode, - no_compile_bytecode, - } = installer_args; - - let BuildArgs { - no_build, - build, - no_build_package, - no_binary, - binary, - no_binary_package, - } = build_args; - - InstallerOptions { - index_url: index_args.index_url.and_then(Maybe::into_option), - extra_index_url: index_args.extra_index_url.map(|extra_index_urls| { - extra_index_urls - .into_iter() - .filter_map(Maybe::into_option) - .collect() - }), - no_index: if index_args.no_index { - Some(true) - } else { - None - }, - find_links: index_args.find_links, - reinstall: flag(reinstall, no_reinstall), - reinstall_package: Some(reinstall_package), - index_strategy, - keyring_provider, - config_settings: config_setting - .map(|config_settings| config_settings.into_iter().collect::()), - exclude_newer, - link_mode, - compile_bytecode: flag(compile_bytecode, no_compile_bytecode), - no_build: flag(no_build, build), - no_build_package: Some(no_build_package), - no_binary: flag(no_binary, binary), - no_binary_package: Some(no_binary_package), - } -} - /// Construct the [`ResolverOptions`] from the [`ResolverArgs`] and [`BuildArgs`]. pub fn resolver_options(resolver_args: ResolverArgs, build_args: BuildArgs) -> ResolverOptions { let ResolverArgs { diff --git a/crates/uv-git/src/resolver.rs b/crates/uv-git/src/resolver.rs index 82357c67d..93a7ead98 100644 --- a/crates/uv-git/src/resolver.rs +++ b/crates/uv-git/src/resolver.rs @@ -27,15 +27,6 @@ pub enum GitResolverError { pub struct GitResolver(Arc>); impl GitResolver { - /// Initialize a [`GitResolver`] with a set of resolved references. - pub fn from_refs(refs: Vec) -> Self { - Self(Arc::new( - refs.into_iter() - .map(|ResolvedRepositoryReference { reference, sha }| (reference, sha)) - .collect(), - )) - } - /// Inserts a new [`GitSha`] for the given [`RepositoryReference`]. pub fn insert(&self, reference: RepositoryReference, sha: GitSha) { self.0.insert(reference, sha); diff --git a/crates/uv-installer/src/site_packages.rs b/crates/uv-installer/src/site_packages.rs index 6883bcebe..500d36fe1 100644 --- a/crates/uv-installer/src/site_packages.rs +++ b/crates/uv-installer/src/site_packages.rs @@ -130,13 +130,6 @@ impl SitePackages { .collect() } - /// Returns `true` if there are any installed distributions with the given package name. - pub fn contains_package(&self, name: &PackageName) -> bool { - self.by_name - .get(name) - .is_some_and(|packages| !packages.is_empty()) - } - /// Remove the given packages from the index, returning all installed versions, if any. pub fn remove_packages(&mut self, name: &PackageName) -> Vec { let Some(indexes) = self.by_name.get(name) else { diff --git a/crates/uv-python/src/interpreter.rs b/crates/uv-python/src/interpreter.rs index 55e3ba4a0..f98b0040a 100644 --- a/crates/uv-python/src/interpreter.rs +++ b/crates/uv-python/src/interpreter.rs @@ -78,40 +78,6 @@ impl Interpreter { }) } - // TODO(konstin): Find a better way mocking the fields - pub fn artificial(platform: Platform, markers: MarkerEnvironment) -> Self { - Self { - platform, - markers: Box::new(markers), - scheme: Scheme { - purelib: PathBuf::from("/dev/null"), - platlib: PathBuf::from("/dev/null"), - include: PathBuf::from("/dev/null"), - scripts: PathBuf::from("/dev/null"), - data: PathBuf::from("/dev/null"), - }, - virtualenv: Scheme { - purelib: PathBuf::from("/dev/null"), - platlib: PathBuf::from("/dev/null"), - include: PathBuf::from("/dev/null"), - scripts: PathBuf::from("/dev/null"), - data: PathBuf::from("/dev/null"), - }, - sys_prefix: PathBuf::from("/dev/null"), - sys_base_exec_prefix: PathBuf::from("/dev/null"), - sys_base_prefix: PathBuf::from("/dev/null"), - sys_base_executable: None, - sys_executable: PathBuf::from("/dev/null"), - sys_path: vec![], - stdlib: PathBuf::from("/dev/null"), - tags: OnceLock::new(), - target: None, - prefix: None, - pointer_size: PointerSize::_64, - gil_disabled: false, - } - } - /// Return a new [`Interpreter`] with the given virtual environment root. #[must_use] pub fn with_virtualenv(self, virtualenv: VirtualEnvironment) -> Self { diff --git a/crates/uv-resolver/src/yanks.rs b/crates/uv-resolver/src/yanks.rs index 6525b48bd..c4a3d0986 100644 --- a/crates/uv-resolver/src/yanks.rs +++ b/crates/uv-resolver/src/yanks.rs @@ -57,10 +57,4 @@ impl AllowedYanks { .get(package_name) .map_or(false, |versions| versions.contains(version)) } - - /// Returns versions for the given package which are allowed even if marked as yanked by the - /// relevant index. - pub fn allowed_versions(&self, package_name: &PackageName) -> Option<&FxHashSet> { - self.0.get(package_name) - } }