repo
stringlengths
6
65
file_url
stringlengths
81
311
file_path
stringlengths
6
227
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:31:58
2026-01-04 20:25:31
truncated
bool
2 classes
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-pypi-types/src/dependency_groups.rs
crates/uv-pypi-types/src/dependency_groups.rs
use serde::{Deserialize, Deserializer, Serialize}; use std::collections::BTreeMap; use std::str::FromStr; use uv_normalize::GroupName; #[derive(Debug, Clone, PartialEq, Serialize)] pub struct DependencyGroups(BTreeMap<GroupName, Vec<DependencyGroupSpecifier>>); impl DependencyGroups { /// Returns the names of th...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-pypi-types/src/marker_environment.rs
crates/uv-pypi-types/src/marker_environment.rs
use tracing::debug; use uv_pep508::MarkerEnvironment; /// A wrapper type around [`MarkerEnvironment`] that ensures the Python version markers are /// release-only, to match the resolver's semantics. #[derive(Debug, Clone, Eq, PartialEq)] pub struct ResolverMarkerEnvironment(MarkerEnvironment); impl ResolverMarkerEnv...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-pypi-types/src/scheme.rs
crates/uv-pypi-types/src/scheme.rs
use std::path::PathBuf; use serde::{Deserialize, Serialize}; /// The paths associated with an installation scheme, typically returned by `sysconfig.get_paths()`. /// /// See: <https://github.com/pypa/pip/blob/ae5fff36b0aad6e5e0037884927eaa29163c0611/src/pip/_internal/models/scheme.py#L12> /// /// See: <https://docs.p...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-pypi-types/src/metadata/build_requires.rs
crates/uv-pypi-types/src/metadata/build_requires.rs
use uv_normalize::PackageName; use uv_pep508::Requirement; use crate::VerbatimParsedUrl; /// The `build-system.requires` field in a `pyproject.toml` file. /// /// See: <https://peps.python.org/pep-0518/> #[derive(Debug, Clone)] pub struct BuildRequires { pub name: Option<PackageName>, pub requires_dist: Vec<R...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-pypi-types/src/metadata/metadata10.rs
crates/uv-pypi-types/src/metadata/metadata10.rs
use serde::Deserialize; use uv_normalize::PackageName; use crate::MetadataError; use crate::metadata::Headers; /// A subset of the full core metadata specification, including only the /// fields that have been consistent across all versions of the specification. /// /// Core Metadata 1.0 is specified in <https://pep...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-pypi-types/src/metadata/mod.rs
crates/uv-pypi-types/src/metadata/mod.rs
mod build_requires; mod metadata10; mod metadata23; mod metadata_resolver; mod pyproject_toml; mod requires_dist; mod requires_txt; use std::str::Utf8Error; use mailparse::{MailHeaderMap, MailParseError}; use thiserror::Error; use uv_normalize::InvalidNameError; use uv_pep440::{VersionParseError, VersionSpecifiersPa...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-pypi-types/src/metadata/metadata_resolver.rs
crates/uv-pypi-types/src/metadata/metadata_resolver.rs
//! Derived from `pypi_types_crate`. use std::str::FromStr; use itertools::Itertools; use serde::{Deserialize, Serialize}; use tracing::warn; use uv_normalize::{ExtraName, PackageName}; use uv_pep440::{Version, VersionSpecifiers}; use uv_pep508::Requirement; use crate::lenient_requirement::LenientRequirement; use c...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-pypi-types/src/metadata/pyproject_toml.rs
crates/uv-pypi-types/src/metadata/pyproject_toml.rs
use std::str::FromStr; use indexmap::IndexMap; use serde::Deserialize; use serde::de::IntoDeserializer; use uv_normalize::{ExtraName, PackageName}; use uv_pep440::Version; use crate::MetadataError; /// A `pyproject.toml` as specified in PEP 517. #[derive(Deserialize, Debug, Clone)] #[serde(rename_all = "kebab-case"...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-pypi-types/src/metadata/requires_txt.rs
crates/uv-pypi-types/src/metadata/requires_txt.rs
use std::io::BufRead; use std::str::FromStr; use uv_normalize::ExtraName; use uv_pep508::{ExtraOperator, MarkerExpression, MarkerTree, MarkerValueExtra, Requirement}; use crate::{LenientRequirement, MetadataError, VerbatimParsedUrl}; /// `requires.txt` metadata as defined in <https://setuptools.pypa.io/en/latest/dep...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-pypi-types/src/metadata/metadata23.rs
crates/uv-pypi-types/src/metadata/metadata23.rs
//! Vendored from <https://github.com/PyO3/python-pkginfo-rs> use std::fmt::Display; use std::fmt::Write; use std::str; use std::str::FromStr; use crate::MetadataError; use crate::metadata::Headers; /// Code Metadata 2.3 as specified in /// <https://packaging.python.org/specifications/core-metadata/>. #[derive(Debug...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-pypi-types/src/metadata/requires_dist.rs
crates/uv-pypi-types/src/metadata/requires_dist.rs
use std::str::FromStr; use itertools::Itertools; use uv_normalize::{ExtraName, PackageName}; use uv_pep508::Requirement; use crate::metadata::pyproject_toml::PyProjectToml; use crate::{LenientRequirement, MetadataError, VerbatimParsedUrl}; /// Python Package Metadata 2.3 as specified in /// <https://packaging.pytho...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-fs/src/cachedir.rs
crates/uv-fs/src/cachedir.rs
//! Vendored from cachedir 0.3.1 to replace `std::fs` with `fs_err`. use std::io::Write; use std::{io, path}; /// The `CACHEDIR.TAG` file header as defined by the [specification](https://bford.info/cachedir/). const HEADER: &[u8; 43] = b"Signature: 8a477f597d28d172789f06886806bc55"; /// Adds a tag to the specified `...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-fs/src/path.rs
crates/uv-fs/src/path.rs
use std::borrow::Cow; use std::path::{Component, Path, PathBuf}; use std::sync::LazyLock; use either::Either; use path_slash::PathExt; /// The current working directory. #[allow(clippy::exit, clippy::print_stderr)] pub static CWD: LazyLock<PathBuf> = LazyLock::new(|| { std::env::current_dir().unwrap_or_else(|_e| ...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-fs/src/lib.rs
crates/uv-fs/src/lib.rs
use std::borrow::Cow; use std::path::{Path, PathBuf}; use tempfile::NamedTempFile; use tracing::warn; pub use crate::locked_file::*; pub use crate::path::*; pub mod cachedir; mod locked_file; mod path; pub mod which; /// Append an extension to a [`PathBuf`]. /// /// Unlike [`Path::with_extension`], this function do...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-fs/src/which.rs
crates/uv-fs/src/which.rs
use std::path::Path; #[cfg(windows)] #[allow(unsafe_code)] // We need to do an FFI call through the windows-* crates. fn get_binary_type(path: &Path) -> windows::core::Result<u32> { use std::os::windows::ffi::OsStrExt; use windows::Win32::Storage::FileSystem::GetBinaryTypeW; use windows::core::PCWSTR; ...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-fs/src/locked_file.rs
crates/uv-fs/src/locked_file.rs
use std::convert::Into; use std::fmt::Display; use std::path::{Path, PathBuf}; use std::sync::LazyLock; use std::time::Duration; use std::{env, io}; use thiserror::Error; use tracing::{debug, error, info, trace, warn}; use uv_static::EnvVars; use crate::{Simplified, is_known_already_locked_error}; /// Parsed value ...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-torch/src/lib.rs
crates/uv-torch/src/lib.rs
mod accelerator; mod backend; pub use accelerator::*; pub use backend::*;
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-torch/src/backend.rs
crates/uv-torch/src/backend.rs
//! `uv-torch` is a library for determining the appropriate PyTorch index based on the operating //! system and CUDA driver version. //! //! This library is derived from `light-the-torch` by Philipp Meier, which is available under the //! following BSD-3 Clause license: //! //! ```text //! BSD 3-Clause License //! //! ...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
true
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-torch/src/accelerator.rs
crates/uv-torch/src/accelerator.rs
use std::path::Path; use std::str::FromStr; use tracing::debug; use uv_pep440::Version; use uv_static::EnvVars; #[cfg(windows)] use serde::Deserialize; #[cfg(windows)] use wmi::{COMLibrary, WMIConnection}; #[derive(Debug, thiserror::Error)] pub enum AcceleratorError { #[error(transparent)] Io(#[from] std::i...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-small-str/src/lib.rs
crates/uv-small-str/src/lib.rs
use std::borrow::Cow; use std::cmp::PartialEq; use std::ops::Deref; /// An optimized type for immutable identifiers. Represented as an [`arcstr::ArcStr`] internally. #[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct SmallString(arcstr::ArcStr); impl From<arcstr::ArcStr> for SmallString { #[inline]...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-types/src/downloads.rs
crates/uv-types/src/downloads.rs
use std::sync::Arc; use uv_distribution_types::{CachedDist, DistributionId}; use uv_once_map::OnceMap; #[derive(Default, Clone)] pub struct InFlight { /// The in-flight distribution downloads. pub downloads: Arc<OnceMap<DistributionId, Result<CachedDist, String>>>, }
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-types/src/lib.rs
crates/uv-types/src/lib.rs
//! Fundamental types shared across uv crates. pub use builds::*; pub use downloads::*; pub use hash::*; pub use requirements::*; pub use traits::*; mod builds; mod downloads; mod hash; mod requirements; mod traits;
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-types/src/requirements.rs
crates/uv-types/src/requirements.rs
use uv_distribution_types::Requirement; use uv_normalize::ExtraName; /// A set of requirements as requested by a parent requirement. /// /// For example, given `flask[dotenv]`, the `RequestedRequirements` would include the `dotenv` /// extra, along with all of the requirements that are included in the `flask` distribu...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-types/src/builds.rs
crates/uv-types/src/builds.rs
use std::path::Path; use std::sync::Arc; use dashmap::DashMap; use uv_configuration::{BuildKind, SourceStrategy}; use uv_normalize::PackageName; use uv_python::PythonEnvironment; /// Whether to enforce build isolation when building source distributions. #[derive(Debug, Default, Copy, Clone)] pub enum BuildIsolation<...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-types/src/hash.rs
crates/uv-types/src/hash.rs
use std::str::FromStr; use std::sync::Arc; use rustc_hash::FxHashMap; use uv_configuration::HashCheckingMode; use uv_distribution_types::{ DistributionMetadata, HashGeneration, HashPolicy, Name, Requirement, RequirementSource, Resolution, UnresolvedRequirement, VersionId, }; use uv_normalize::PackageName; use...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-types/src/traits.rs
crates/uv-types/src/traits.rs
use std::fmt::{Debug, Display, Formatter}; use std::future::Future; use std::ops::Deref; use std::path::{Path, PathBuf}; use anyhow::Result; use rustc_hash::FxHashSet; use uv_cache::Cache; use uv_configuration::{BuildKind, BuildOptions, BuildOutput, SourceStrategy}; use uv_distribution_filename::DistFilename; use uv_...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-distribution-types/src/build_requires.rs
crates/uv-distribution-types/src/build_requires.rs
use std::collections::BTreeMap; use serde::{Deserialize, Serialize}; use uv_cache_key::{CacheKey, CacheKeyHasher}; use uv_normalize::PackageName; use crate::{Name, Requirement, RequirementSource, Resolution}; #[derive(Debug, thiserror::Error)] pub enum ExtraBuildRequiresError { #[error( "`{0}` was decla...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-distribution-types/src/cached.rs
crates/uv-distribution-types/src/cached.rs
use std::path::Path; use uv_cache_info::CacheInfo; use uv_distribution_filename::WheelFilename; use uv_normalize::PackageName; use uv_pypi_types::{HashDigest, HashDigests, VerbatimParsedUrl}; use crate::{ BuildInfo, BuiltDist, Dist, DistributionMetadata, Hashed, InstalledMetadata, InstalledVersion, Name, Pars...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-distribution-types/src/index_name.rs
crates/uv-distribution-types/src/index_name.rs
use std::borrow::Cow; use std::ops::Deref; use std::str::FromStr; use thiserror::Error; use uv_small_str::SmallString; /// The normalized name of an index. /// /// Index names may contain letters, digits, hyphens, underscores, and periods, and must be ASCII. #[derive(Debug, Clone, Hash, Eq, PartialEq, Ord, PartialOr...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-distribution-types/src/dist_error.rs
crates/uv-distribution-types/src/dist_error.rs
use std::collections::VecDeque; use std::fmt::{Debug, Display, Formatter}; use petgraph::Direction; use petgraph::prelude::EdgeRef; use rustc_hash::FxHashSet; use version_ranges::Ranges; use uv_normalize::{ExtraName, GroupName, PackageName}; use uv_pep440::Version; use crate::{ BuiltDist, Dist, DistRef, Edge, Na...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-distribution-types/src/lib.rs
crates/uv-distribution-types/src/lib.rs
//! ## Type hierarchy //! //! When we receive the requirements from `pip sync`, we check which requirements already fulfilled //! in the users environment ([`InstalledDist`]), whether the matching package is in our wheel cache //! ([`CachedDist`]) or whether we need to download, (potentially build) and install it ([`Di...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
true
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-distribution-types/src/index.rs
crates/uv-distribution-types/src/index.rs
use std::path::Path; use std::str::FromStr; use serde::{Deserialize, Serialize}; use thiserror::Error; use url::Url; use uv_auth::{AuthPolicy, Credentials}; use uv_redacted::DisplaySafeUrl; use uv_small_str::SmallString; use crate::index_name::{IndexName, IndexNameError}; use crate::origin::Origin; use crate::{Index...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-distribution-types/src/id.rs
crates/uv-distribution-types/src/id.rs
use std::fmt::{Display, Formatter}; use std::path::PathBuf; use uv_cache_key::{CanonicalUrl, RepositoryUrl}; use uv_normalize::PackageName; use uv_pep440::Version; use uv_pypi_types::HashDigest; use uv_redacted::DisplaySafeUrl; /// A unique identifier for a package. A package can either be identified by a name (e.g....
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-distribution-types/src/buildable.rs
crates/uv-distribution-types/src/buildable.rs
use std::borrow::Cow; use std::path::Path; use uv_distribution_filename::SourceDistExtension; use uv_git_types::GitUrl; use uv_pep440::{Version, VersionSpecifiers}; use uv_pep508::VerbatimUrl; use uv_normalize::PackageName; use uv_redacted::DisplaySafeUrl; use crate::{DirectorySourceDist, GitSourceDist, Name, PathSo...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-distribution-types/src/build_info.rs
crates/uv-distribution-types/src/build_info.rs
use uv_cache_key::{CacheKey, CacheKeyHasher, cache_digest}; use crate::{BuildVariables, ConfigSettings, ExtraBuildRequirement}; /// A digest representing the build settings, such as build dependencies or other build-time /// configuration. #[derive(Default, Debug, Clone, Hash, PartialEq, Eq, serde::Deserialize, serde...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-distribution-types/src/pip_index.rs
crates/uv-distribution-types/src/pip_index.rs
//! Compatibility structs for converting between [`IndexUrl`] and [`Index`]. These structs are //! parsed and deserialized as [`IndexUrl`], but are stored as [`Index`] with the appropriate //! flags set. use serde::{Deserialize, Deserializer, Serialize}; #[cfg(feature = "schemars")] use std::borrow::Cow; use std::path...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-distribution-types/src/config_settings.rs
crates/uv-distribution-types/src/config_settings.rs
use std::{ collections::{BTreeMap, btree_map::Entry}, str::FromStr, }; use uv_cache_key::CacheKeyHasher; use uv_normalize::PackageName; #[derive(Debug, Clone)] pub struct ConfigSettingEntry { /// The key of the setting. For example, given `key=value`, this would be `key`. key: String, /// The value...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-distribution-types/src/specified_requirement.rs
crates/uv-distribution-types/src/specified_requirement.rs
use std::borrow::Cow; use std::fmt::{Display, Formatter}; use uv_git_types::{GitLfs, GitReference}; use uv_normalize::ExtraName; use uv_pep508::{MarkerEnvironment, MarkerTree, UnnamedRequirement}; use uv_pypi_types::{Hashes, ParsedUrl}; use crate::{Requirement, RequirementSource, VerbatimParsedUrl}; /// An [`Unresol...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-distribution-types/src/resolution.rs
crates/uv-distribution-types/src/resolution.rs
use uv_distribution_filename::DistExtension; use uv_normalize::{ExtraName, GroupName, PackageName}; use uv_pypi_types::{HashDigest, HashDigests}; use crate::{ BuiltDist, Diagnostic, Dist, IndexMetadata, Name, RequirementSource, ResolvedDist, SourceDist, }; /// A set of packages pinned at specific versions. /// //...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-distribution-types/src/requested.rs
crates/uv-distribution-types/src/requested.rs
use std::fmt::{Display, Formatter}; use crate::{ Dist, DistributionId, DistributionMetadata, Identifier, InstalledDist, Name, ResourceId, VersionOrUrlRef, }; use uv_normalize::PackageName; use uv_pep440::Version; /// A distribution that can be requested during resolution. /// /// Either an already-installed d...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-distribution-types/src/annotation.rs
crates/uv-distribution-types/src/annotation.rs
use std::collections::{BTreeMap, BTreeSet}; use uv_fs::Simplified; use uv_normalize::PackageName; use uv_pep508::RequirementOrigin; /// Source of a dependency, e.g., a `-r requirements.txt` file. #[derive(Debug, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] pub enum SourceAnnotation { /// A `-c constraints.txt` f...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-distribution-types/src/error.rs
crates/uv-distribution-types/src/error.rs
use uv_normalize::PackageName; use uv_redacted::DisplaySafeUrl; #[derive(thiserror::Error, Debug)] pub enum Error { #[error(transparent)] Io(#[from] std::io::Error), #[error(transparent)] Utf8(#[from] std::str::Utf8Error), #[error(transparent)] WheelFilename(#[from] uv_distribution_filename::...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-distribution-types/src/file.rs
crates/uv-distribution-types/src/file.rs
use std::borrow::Cow; use std::fmt::{self, Display, Formatter}; use std::str::FromStr; use jiff::Timestamp; use serde::{Deserialize, Serialize}; use uv_pep440::{VersionSpecifiers, VersionSpecifiersParseError}; use uv_pep508::split_scheme; use uv_pypi_types::{CoreMetadata, HashDigests, Yanked}; use uv_redacted::{Displ...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-distribution-types/src/known_platform.rs
crates/uv-distribution-types/src/known_platform.rs
use std::fmt::{Display, Formatter}; use uv_pep508::{MarkerExpression, MarkerOperator, MarkerTree, MarkerValueString}; /// A platform for which the resolver is solving. #[derive(Debug, Clone, Copy)] pub enum KnownPlatform { Linux, Windows, MacOS, } impl KnownPlatform { /// Return the platform's `sys.p...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-distribution-types/src/index_url.rs
crates/uv-distribution-types/src/index_url.rs
use std::borrow::Cow; use std::fmt::{Display, Formatter}; use std::ops::Deref; use std::path::Path; use std::str::FromStr; use std::sync::{Arc, LazyLock, RwLock}; use itertools::Either; use rustc_hash::{FxHashMap, FxHashSet}; use thiserror::Error; use url::{ParseError, Url}; use uv_auth::RealmRef; use uv_cache_key::Ca...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-distribution-types/src/any.rs
crates/uv-distribution-types/src/any.rs
use std::hash::Hash; use uv_cache_key::CanonicalUrl; use uv_normalize::PackageName; use uv_pep440::Version; use crate::cached::CachedDist; use crate::installed::InstalledDist; use crate::{InstalledMetadata, InstalledVersion, Name}; /// A distribution which is either installable, is a wheel in our cache or is already...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-distribution-types/src/prioritized_distribution.rs
crates/uv-distribution-types/src/prioritized_distribution.rs
use std::fmt::{Display, Formatter}; use arcstr::ArcStr; use owo_colors::OwoColorize; use tracing::debug; use uv_distribution_filename::{BuildTag, WheelFilename}; use uv_pep440::{Version, VersionSpecifier, VersionSpecifiers}; use uv_pep508::{MarkerExpression, MarkerOperator, MarkerTree, MarkerValueString}; use uv_plat...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
true
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-distribution-types/src/origin.rs
crates/uv-distribution-types/src/origin.rs
/// The origin of a piece of configuration. #[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Ord, PartialOrd)] pub enum Origin { /// The setting was provided via the CLI. Cli, /// The setting was provided via a user-level configuration file. User, /// The setting was provided via a project-level co...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-distribution-types/src/hash.rs
crates/uv-distribution-types/src/hash.rs
use uv_pypi_types::{HashAlgorithm, HashDigest}; #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum HashPolicy<'a> { /// No hash policy is specified. None, /// Hashes should be generated (specifically, a SHA-256 hash), but not validated. Generate(HashGeneration), /// Hashes should be validated ag...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-distribution-types/src/status_code_strategy.rs
crates/uv-distribution-types/src/status_code_strategy.rs
#[cfg(feature = "schemars")] use std::borrow::Cow; use std::ops::Deref; use http::StatusCode; use rustc_hash::FxHashSet; use serde::{Deserialize, Deserializer, Serialize, Serializer}; use url::Url; use crate::{IndexCapabilities, IndexUrl}; #[derive(Debug, Clone, Default, Eq, PartialEq)] pub enum IndexStatusCodeStrat...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-distribution-types/src/requires_python.rs
crates/uv-distribution-types/src/requires_python.rs
use std::collections::Bound; use version_ranges::Ranges; use uv_distribution_filename::WheelFilename; use uv_pep440::{ LowerBound, UpperBound, Version, VersionSpecifier, VersionSpecifiers, release_specifiers_to_ranges, }; use uv_pep508::{MarkerExpression, MarkerTree, MarkerValueVersion}; use uv_platform_tags:...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
true
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-distribution-types/src/dependency_metadata.rs
crates/uv-distribution-types/src/dependency_metadata.rs
use rustc_hash::FxHashMap; use serde::{Deserialize, Serialize}; use tracing::{debug, warn}; use uv_normalize::{ExtraName, PackageName}; use uv_pep440::{Version, VersionSpecifiers}; use uv_pep508::Requirement; use uv_pypi_types::{ResolutionMetadata, VerbatimParsedUrl}; /// Pre-defined [`StaticMetadata`] entries, indexe...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-distribution-types/src/traits.rs
crates/uv-distribution-types/src/traits.rs
use std::borrow::Cow; use uv_normalize::PackageName; use uv_pep508::VerbatimUrl; use crate::error::Error; use crate::{ BuiltDist, CachedDirectUrlDist, CachedDist, CachedRegistryDist, DirectUrlBuiltDist, DirectUrlSourceDist, DirectorySourceDist, Dist, DistributionId, GitSourceDist, InstalledDirectUrlDist, ...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-distribution-types/src/requirement.rs
crates/uv-distribution-types/src/requirement.rs
use std::fmt::{Display, Formatter}; use std::io; use std::path::Path; use std::str::FromStr; use thiserror::Error; use uv_cache_key::{CacheKey, CacheKeyHasher}; use uv_distribution_filename::DistExtension; use uv_fs::{CWD, PortablePath, PortablePathBuf, relative_to}; use uv_git_types::{GitLfs, GitOid, GitReference, Gi...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
true
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-distribution-types/src/installed.rs
crates/uv-distribution-types/src/installed.rs
use std::borrow::Cow; use std::io::BufReader; use std::path::{Path, PathBuf}; use std::str::FromStr; use std::sync::OnceLock; use fs_err as fs; use thiserror::Error; use tracing::warn; use url::Url; use uv_cache_info::CacheInfo; use uv_distribution_filename::{EggInfoFilename, ExpandedTags}; use uv_fs::Simplified; use...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-distribution-types/src/resolved.rs
crates/uv-distribution-types/src/resolved.rs
use std::fmt::{Display, Formatter}; use std::path::Path; use std::sync::Arc; use uv_normalize::PackageName; use uv_pep440::Version; use uv_pypi_types::Yanked; use crate::{ BuiltDist, Dist, DistributionId, DistributionMetadata, Identifier, IndexUrl, InstalledDist, Name, PrioritizedDist, RegistryBuiltWheel, Reg...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-distribution-types/src/diagnostic.rs
crates/uv-distribution-types/src/diagnostic.rs
use uv_normalize::PackageName; pub trait Diagnostic { /// Convert the diagnostic into a user-facing message. fn message(&self) -> String; /// Returns `true` if the [`PackageName`] is involved in this diagnostic. fn includes(&self, name: &PackageName) -> bool; }
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-warnings/src/lib.rs
crates/uv-warnings/src/lib.rs
use std::error::Error; use std::iter; use std::sync::atomic::AtomicBool; use std::sync::{LazyLock, Mutex}; // macro hygiene: The user might not have direct dependencies on those crates #[doc(hidden)] pub use anstream; #[doc(hidden)] pub use owo_colors; use owo_colors::{DynColor, OwoColorize}; use rustc_hash::FxHashSet...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-trampoline-builder/src/lib.rs
crates/uv-trampoline-builder/src/lib.rs
use std::io; use std::path::{Path, PathBuf}; use std::str::Utf8Error; use fs_err::File; use thiserror::Error; #[cfg(all(windows, target_arch = "x86"))] const LAUNCHER_I686_GUI: &[u8] = include_bytes!("../trampolines/uv-trampoline-i686-gui.exe"); #[cfg(all(windows, target_arch = "x86"))] const LAUNCHER_I686_CONSOLE: ...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-options-metadata/src/lib.rs
crates/uv-options-metadata/src/lib.rs
//! Taken directly from Ruff. //! //! See: <https://github.com/astral-sh/ruff/blob/dc8db1afb08704ad6a788c497068b01edf8b460d/crates/ruff_workspace/sr.rs> use serde::{Serialize, Serializer}; use std::collections::BTreeMap; use std::fmt::{Debug, Display, Formatter}; /// Visits [`OptionsMetadata`]. /// /// An instance o...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-metadata/src/lib.rs
crates/uv-metadata/src/lib.rs
//! Read metadata from wheels and source distributions. //! //! This module reads all fields exhaustively. The fields are defined in the [Core metadata //! specification](https://packaging.python.org/en/latest/specifications/core-metadata/). use std::io; use std::io::{Read, Seek}; use std::path::Path; use thiserror::E...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-requirements-txt/src/shquote.rs
crates/uv-requirements-txt/src/shquote.rs
//! POSIX Shell Compatible Argument Parser //! //! This implementation is vendored from the [`r-shquote`](https://github.com/r-util/r-shquote) //! crate under the Apache 2.0 license: //! //! ```text //! Licensed under the Apache License, Version 2.0 (the "License"); //! you may not use this file except in compliance wi...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-requirements-txt/src/lib.rs
crates/uv-requirements-txt/src/lib.rs
//! Parses a subset of requirement.txt syntax //! //! <https://pip.pypa.io/en/stable/reference/requirements-file-format/> //! //! Supported: //! * [PEP 508 requirements](https://packaging.python.org/en/latest/specifications/dependency-specifiers/) //! * `-r` //! * `-c` //! * `--hash` (postfix) //! * `-e` //! //! U...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
true
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-requirements-txt/src/requirement.rs
crates/uv-requirements-txt/src/requirement.rs
use std::fmt::Display; use std::path::Path; use uv_normalize::PackageName; use uv_pep508::{ Pep508Error, Pep508ErrorSource, RequirementOrigin, TracingReporter, UnnamedRequirement, }; use uv_pypi_types::{ParsedDirectoryUrl, ParsedUrl, VerbatimParsedUrl}; #[derive(Debug, thiserror::Error)] pub enum EditableError { ...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-bin-install/src/lib.rs
crates/uv-bin-install/src/lib.rs
//! Binary download and installation utilities for uv. //! //! These utilities are specifically for consuming distributions that are _not_ Python packages, //! e.g., `ruff` (which does have a Python package, but also has standalone binaries on GitHub). use std::path::PathBuf; use std::pin::Pin; use std::task::{Context...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-python/build.rs
crates/uv-python/build.rs
#[allow(clippy::disallowed_types)] use std::fs::{File, FileTimes}; use std::io::Write; use std::path::PathBuf; use std::{env, fs}; use uv_static::EnvVars; fn process_json(data: &serde_json::Value) -> serde_json::Value { let mut out_data = serde_json::Map::new(); if let Some(obj) = data.as_object() { ...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-python/src/discovery.rs
crates/uv-python/src/discovery.rs
use itertools::{Either, Itertools}; use regex::Regex; use rustc_hash::{FxBuildHasher, FxHashSet}; use same_file::is_same_file; use std::borrow::Cow; use std::env::consts::EXE_SUFFIX; use std::fmt::{self, Debug, Formatter}; use std::{env, io, iter}; use std::{path::Path, path::PathBuf, str::FromStr}; use thiserror::Erro...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
true
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-python/src/downloads.rs
crates/uv-python/src/downloads.rs
use std::borrow::Cow; use std::collections::HashMap; use std::fmt::Display; use std::path::{Path, PathBuf}; use std::pin::Pin; use std::str::FromStr; use std::task::{Context, Poll}; use std::{env, io}; use futures::TryStreamExt; use itertools::Itertools; use owo_colors::OwoColorize; use reqwest_retry::RetryError; use ...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
true
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-python/src/lib.rs
crates/uv-python/src/lib.rs
//! Find requested Python interpreters and query interpreters for information. use owo_colors::OwoColorize; use thiserror::Error; #[cfg(test)] use uv_static::EnvVars; pub use crate::discovery::{ EnvironmentPreference, Error as DiscoveryError, PythonDownloads, PythonNotFound, PythonPreference, PythonRequest, P...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
true
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-python/src/implementation.rs
crates/uv-python/src/implementation.rs
use std::{ fmt::{self, Display}, str::FromStr, }; use thiserror::Error; use crate::Interpreter; #[derive(Error, Debug)] pub enum Error { #[error("Unknown Python implementation `{0}`")] UnknownImplementation(String), } #[derive(Debug, Eq, PartialEq, Clone, Copy, Default, PartialOrd, Ord, Hash)] pub en...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-python/src/pointer_size.rs
crates/uv-python/src/pointer_size.rs
use serde::{Deserialize, Serialize}; #[derive(Debug, Copy, Clone, Serialize, Deserialize)] pub enum PointerSize { /// 32-bit architecture. #[serde(rename = "32")] _32, /// 64-bit architecture. #[serde(rename = "64")] _64, } impl PointerSize { pub const fn is_32(self) -> bool { matc...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-python/src/prefix.rs
crates/uv-python/src/prefix.rs
use std::path::{Path, PathBuf}; use uv_pypi_types::Scheme; /// A `--prefix` directory into which packages can be installed, separate from a virtual environment /// or system Python interpreter. #[derive(Debug, Clone)] pub struct Prefix(PathBuf); impl Prefix { /// Return the [`Scheme`] for the `--prefix` director...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-python/src/environment.rs
crates/uv-python/src/environment.rs
use std::borrow::Cow; use std::fmt; use std::path::{Path, PathBuf}; use std::sync::Arc; use owo_colors::OwoColorize; use tracing::debug; use uv_cache::Cache; use uv_fs::{LockedFile, LockedFileError, Simplified}; use uv_pep440::Version; use uv_preview::Preview; use crate::discovery::find_python_installation; use crat...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-python/src/python_version.rs
crates/uv-python/src/python_version.rs
#[cfg(feature = "schemars")] use std::borrow::Cow; use std::collections::BTreeMap; use std::env; use std::ffi::OsString; use std::fmt::{Display, Formatter}; use std::ops::Deref; use std::str::FromStr; use thiserror::Error; use uv_pep440::Version; use uv_pep508::{MarkerEnvironment, StringVersion}; use uv_static::EnvVar...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-python/src/installation.rs
crates/uv-python/src/installation.rs
use std::borrow::Cow; use std::fmt; use std::hash::{Hash, Hasher}; use std::str::FromStr; use indexmap::IndexMap; use ref_cast::RefCast; use reqwest_retry::policies::ExponentialBackoff; use tracing::{debug, info}; use uv_warnings::warn_user; use uv_cache::Cache; use uv_client::{BaseClient, BaseClientBuilder}; use uv_...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-python/src/target.rs
crates/uv-python/src/target.rs
use std::path::{Path, PathBuf}; use uv_pypi_types::Scheme; /// A `--target` directory into which packages can be installed, separate from a virtual environment /// or system Python interpreter. #[derive(Debug, Clone)] pub struct Target(PathBuf); impl Target { /// Return the [`Scheme`] for the `--target` director...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-python/src/version_files.rs
crates/uv-python/src/version_files.rs
use std::ops::Add; use std::path::{Path, PathBuf}; use fs_err as fs; use itertools::Itertools; use tracing::debug; use uv_dirs::user_uv_config_dir; use uv_fs::Simplified; use uv_warnings::warn_user_once; use crate::PythonRequest; /// The file name for Python version pins. pub static PYTHON_VERSION_FILENAME: &str = "...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-python/src/windows_registry.rs
crates/uv-python/src/windows_registry.rs
//! PEP 514 interactions with the Windows registry. use crate::managed::ManagedPythonInstallation; use crate::{COMPANY_DISPLAY_NAME, COMPANY_KEY, PythonInstallationKey, PythonVersion}; use anyhow::anyhow; use std::cmp::Ordering; use std::collections::HashSet; use std::path::PathBuf; use std::str::FromStr; use target_l...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-python/src/interpreter.rs
crates/uv-python/src/interpreter.rs
use std::borrow::Cow; use std::env::consts::ARCH; use std::fmt::{Display, Formatter}; use std::path::{Path, PathBuf}; use std::process::{Command, ExitStatus}; use std::str::FromStr; use std::sync::OnceLock; use std::{env, io}; use configparser::ini::Ini; use fs_err as fs; use owo_colors::OwoColorize; use same_file::is...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
true
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-python/src/microsoft_store.rs
crates/uv-python/src/microsoft_store.rs
//! Microsoft Store Pythons don't register themselves in the registry, so we have to look for them //! in known locations. //! //! Effectively a port of <https://github.com/python/cpython/blob/58ce131037ecb34d506a613f21993cde2056f628/PC/launcher2.c#L1744> use crate::PythonVersion; use crate::windows_registry::WindowsP...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-python/src/managed.rs
crates/uv-python/src/managed.rs
use core::fmt; use std::borrow::Cow; use std::cmp::Reverse; use std::ffi::OsStr; use std::io::{self, Write}; #[cfg(windows)] use std::os::windows::fs::MetadataExt; use std::path::{Path, PathBuf}; use std::str::FromStr; use fs_err as fs; use itertools::Itertools; use thiserror::Error; use tracing::{debug, warn}; use uv...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
true
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-python/src/macos_dylib.rs
crates/uv-python/src/macos_dylib.rs
use std::{io::ErrorKind, path::PathBuf}; use uv_fs::Simplified as _; use uv_warnings::warn_user; use crate::managed::ManagedPythonInstallation; pub fn patch_dylib_install_name(dylib: PathBuf) -> Result<(), Error> { let output = match std::process::Command::new("install_name_tool") .arg("-id") .ar...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-python/src/virtualenv.rs
crates/uv-python/src/virtualenv.rs
use std::borrow::Cow; use std::str::FromStr; use std::{ env, io, path::{Path, PathBuf}, }; use fs_err as fs; use thiserror::Error; use uv_pypi_types::Scheme; use uv_static::EnvVars; use crate::PythonVersion; /// The layout of a virtual environment. #[derive(Debug)] pub struct VirtualEnvironment { /// Th...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-python/src/sysconfig/cursor.rs
crates/uv-python/src/sysconfig/cursor.rs
#![allow(dead_code)] use std::str::Chars; pub(super) const EOF_CHAR: char = '\0'; /// A cursor represents a pointer in the source code. /// /// Based on [`rustc`'s `Cursor`](https://github.com/rust-lang/rust/blob/d1b7355d3d7b4ead564dbecb1d240fcc74fff21b/compiler/rustc_lexer/src/cursor.rs) #[derive(Clone, Debug)] pub...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-python/src/sysconfig/replacements.rs
crates/uv-python/src/sysconfig/replacements.rs
/// Replacement mode for sysconfig values. #[derive(Debug)] pub(crate) enum ReplacementMode { Partial { from: String }, Full, } /// A replacement entry to patch in sysconfig data. #[derive(Debug)] pub(crate) struct ReplacementEntry { pub(crate) mode: ReplacementMode, pub(crate) to: String, } impl Repl...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-python/src/sysconfig/parser.rs
crates/uv-python/src/sysconfig/parser.rs
use std::collections::BTreeMap; use std::str::FromStr; use serde::Serialize; use serde_json::ser::PrettyFormatter; use crate::sysconfig::cursor::Cursor; /// A value in the [`SysconfigData`] map. /// /// Values are assumed to be either strings or integers. #[derive(Debug, Clone, Eq, PartialEq, serde::Serialize)] #[se...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-python/src/sysconfig/generated_mappings.rs
crates/uv-python/src/sysconfig/generated_mappings.rs
//! DO NOT EDIT //! //! Generated with `cargo run dev generate-sysconfig-metadata` //! Targets from <https://github.com/astral-sh/python-build-standalone/blob/20251217/cpython-unix/targets.yml> //! #![allow(clippy::all)] #![cfg_attr(any(), rustfmt::skip)] use std::collections::BTreeMap; use std::sync::LazyLock; use c...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-python/src/sysconfig/mod.rs
crates/uv-python/src/sysconfig/mod.rs
//! Patch `sysconfig` data in a Python installation. //! //! Inspired by: <https://github.com/bluss/sysconfigpatcher/blob/c1ebf8ab9274dcde255484d93ce0f1fd1f76a248/src/sysconfigpatcher.py#L137C1-L140C100>, //! available under the MIT license: //! //! ```text //! Copyright 2024 Ulrik Sverdrup "bluss" //! //! Permission i...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-dispatch/src/lib.rs
crates/uv-dispatch/src/lib.rs
//! Avoid cyclic crate dependencies between [resolver][`uv_resolver`], //! [installer][`uv_installer`] and [build][`uv_build`] through [`BuildDispatch`] //! implementing [`BuildContext`]. use std::ffi::{OsStr, OsString}; use std::path::Path; use anyhow::{Context, Result}; use futures::FutureExt; use itertools::Iterto...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-flags/src/lib.rs
crates/uv-flags/src/lib.rs
use std::sync::OnceLock; static FLAGS: OnceLock<EnvironmentFlags> = OnceLock::new(); bitflags::bitflags! { #[derive(Debug, Clone, Copy, PartialEq, Eq, Default)] pub struct EnvironmentFlags: u32 { const SKIP_WHEEL_FILENAME_CHECK = 1 << 0; const HIDE_BUILD_OUTPUT = 1 << 1; } } /// Initializ...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-redacted/src/lib.rs
crates/uv-redacted/src/lib.rs
use ref_cast::RefCast; use serde::{Deserialize, Serialize}; use std::borrow::Cow; use std::fmt::{Debug, Display}; use std::ops::{Deref, DerefMut}; use std::str::FromStr; use thiserror::Error; use url::Url; #[derive(Error, Debug, Clone, PartialEq, Eq)] pub enum DisplaySafeUrlError { /// Failed to parse a URL. #...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-publish/src/trusted_publishing.rs
crates/uv-publish/src/trusted_publishing.rs
//! Trusted publishing (via OIDC) with GitHub Actions and GitLab CI. use base64::Engine; use base64::prelude::BASE64_URL_SAFE_NO_PAD; use reqwest::StatusCode; use reqwest_middleware::ClientWithMiddleware; use serde::{Deserialize, Serialize}; use std::env; use std::fmt::Display; use thiserror::Error; use tracing::{debu...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-publish/src/lib.rs
crates/uv-publish/src/lib.rs
mod trusted_publishing; use std::collections::BTreeSet; use std::path::{Path, PathBuf}; use std::sync::Arc; use std::{fmt, io}; use fs_err::tokio::File; use futures::TryStreamExt; use glob::{GlobError, PatternError, glob}; use itertools::Itertools; use reqwest::header::{AUTHORIZATION, LOCATION, ToStrError}; use reqwe...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
true
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-static/src/lib.rs
crates/uv-static/src/lib.rs
pub use env_vars::*; mod env_vars;
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-static/src/env_vars.rs
crates/uv-static/src/env_vars.rs
//! Environment variables used or supported by uv. //! Used to generate `docs/reference/environment.md`. use uv_macros::{attr_added_in, attr_env_var_pattern, attr_hidden, attribute_env_vars_metadata}; /// Declares all environment variable used throughout `uv` and its crates. pub struct EnvVars; #[attribute_env_vars_m...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
true
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-git-types/src/reference.rs
crates/uv-git-types/src/reference.rs
use std::fmt::Display; use std::str; /// A reference to commit or commit-ish. #[derive(Debug, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] pub enum GitReference { /// A specific branch. Branch(String), /// A specific tag. Tag(String), /// From a reference that's ambiguously a branch or tag. Br...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-git-types/src/lib.rs
crates/uv-git-types/src/lib.rs
pub use crate::github::GitHubRepository; pub use crate::oid::{GitOid, OidParseError}; pub use crate::reference::GitReference; use std::sync::LazyLock; use thiserror::Error; use uv_redacted::DisplaySafeUrl; use uv_static::EnvVars; mod github; mod oid; mod reference; /// Initialize [`GitLfs`] mode from `UV_GIT_LFS` en...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-git-types/src/oid.rs
crates/uv-git-types/src/oid.rs
use std::fmt::{Display, Formatter}; use std::str::{self, FromStr}; use thiserror::Error; /// Unique identity of any Git object (commit, tree, blob, tag). /// /// This type's `FromStr` implementation validates that it's exactly 40 hex characters, i.e. a /// full-length git commit. /// /// If Git's SHA-256 support beco...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-git-types/src/github.rs
crates/uv-git-types/src/github.rs
use tracing::debug; use url::Url; /// A reference to a repository on GitHub. #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct GitHubRepository<'a> { /// The `owner` field for the repository, i.e., the user or organization that owns the /// repository, like `astral-sh`. pub owner: &'a str, /// Th...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
false
astral-sh/uv
https://github.com/astral-sh/uv/blob/2318e48e819080f37a002551035c2b1880a81a70/crates/uv-cache/src/lib.rs
crates/uv-cache/src/lib.rs
use std::fmt::{Display, Formatter}; use std::io; use std::io::Write; use std::ops::Deref; use std::path::{Path, PathBuf}; use std::str::FromStr; use std::sync::Arc; use rustc_hash::FxHashMap; use tracing::{debug, trace, warn}; use uv_cache_info::Timestamp; use uv_fs::{LockedFile, LockedFileError, LockedFileMode, Simp...
rust
Apache-2.0
2318e48e819080f37a002551035c2b1880a81a70
2026-01-04T15:31:58.679374Z
true