diff --git a/Cargo.lock b/Cargo.lock index 4a37c8d94..c31020db5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2035,9 +2035,7 @@ name = "pep440_rs" version = "0.3.12" dependencies = [ "indoc", - "once_cell", "pyo3", - "regex", "serde", "tracing", "unicode-width", @@ -2818,7 +2816,6 @@ dependencies = [ "pep440_rs 0.3.12", "pep508_rs", "puffin-normalize", - "puffin-warnings", "regex", "rfc2047-decoder", "serde", diff --git a/crates/distribution-types/src/cached.rs b/crates/distribution-types/src/cached.rs index a37d510d6..b1c08475f 100644 --- a/crates/distribution-types/src/cached.rs +++ b/crates/distribution-types/src/cached.rs @@ -120,7 +120,7 @@ impl CachedDist { } impl CachedDirectUrlDist { - /// Initialize a [`CachedDirectUrlDist`] from a [`WheelFilename`], [`Url`], and [`Path`]. + /// Initialize a [`CachedDirectUrlDist`] from a [`WheelFilename`], [`url::Url`], and [`Path`]. pub fn from_url(filename: WheelFilename, url: VerbatimUrl, path: PathBuf) -> Self { Self { filename, diff --git a/crates/gourgeist/Cargo.toml b/crates/gourgeist/Cargo.toml index 395ee705e..c76ab0458 100644 --- a/crates/gourgeist/Cargo.toml +++ b/crates/gourgeist/Cargo.toml @@ -35,8 +35,8 @@ serde_json = { workspace = true } tempfile = { workspace = true } thiserror = { workspace = true } tracing = { workspace = true } -tracing-subscriber = { workspace = true } +tracing-subscriber = { workspace = true, optional = true } which = { workspace = true } [features] -cli = ["clap"] +cli = ["clap", "tracing-subscriber"] diff --git a/crates/pep440-rs/Cargo.toml b/crates/pep440-rs/Cargo.toml index faa3eedcd..c2f0682d2 100644 --- a/crates/pep440-rs/Cargo.toml +++ b/crates/pep440-rs/Cargo.toml @@ -17,9 +17,7 @@ name = "pep440_rs" crate-type = ["rlib", "cdylib"] [dependencies] -once_cell = { workspace = true } pyo3 = { workspace = true, optional = true, features = ["extension-module", "abi3-py37"] } -regex = { workspace = true } serde = { workspace = true, features = ["derive"], optional = true } tracing = { workspace = true, optional = true } unicode-width = { workspace = true } diff --git a/crates/pep440-rs/src/lib.rs b/crates/pep440-rs/src/lib.rs index 94b3eccb8..0dec2f9dd 100644 --- a/crates/pep440-rs/src/lib.rs +++ b/crates/pep440-rs/src/lib.rs @@ -12,10 +12,6 @@ //! assert!(version_specifiers.iter().all(|specifier| specifier.contains(&version))); //! ``` //! -//! The error handling and diagnostics is a bit overdone because this my parser-and-diagnostics -//! learning project (which kinda failed because the byte based regex crate and char-based -//! diagnostics don't mix well) -//! //! PEP 440 has a lot of unintuitive features, including: //! //! * An epoch that you can prefix the version which, e.g. `1!1.2.3`. Lower epoch always means lower diff --git a/crates/pep440-rs/src/version.rs b/crates/pep440-rs/src/version.rs index ce26dce01..d29724e65 100644 --- a/crates/pep440-rs/src/version.rs +++ b/crates/pep440-rs/src/version.rs @@ -101,7 +101,6 @@ impl FromStr for Operator { "<=" => Self::LessThanEqual, ">" => Self::GreaterThan, ">=" => Self::GreaterThanEqual, - // Should be forbidden by the regex if called from normal parsing other => { return Err(OperatorParseError { got: other.to_string(), @@ -666,8 +665,7 @@ impl FromStr for Version { /// Parses a version such as `1.19`, `1.0a1`,`1.0+abc.5` or `1!2012.2` /// - /// Note that this variant doesn't allow the version to end with a star, see - /// [`Self::from_str_star`] if you want to parse versions for specifiers + /// Note that this doesn't allow wildcard versions. fn from_str(version: &str) -> Result { Parser::new(version.as_bytes()).parse() } @@ -2766,7 +2764,7 @@ mod tests { } #[test] - fn test_regex_mismatch() { + fn test_invalid_word() { let result = Version::from_str("blergh"); assert_eq!(result.unwrap_err(), ErrorKind::NoLeadingNumber.into()); } diff --git a/crates/pep440-rs/src/version_specifier.rs b/crates/pep440-rs/src/version_specifier.rs index 69040735f..1e54d00e9 100644 --- a/crates/pep440-rs/src/version_specifier.rs +++ b/crates/pep440-rs/src/version_specifier.rs @@ -1279,7 +1279,7 @@ mod tests { } #[test] - fn test_regex_mismatch() { + fn test_invalid_word() { let result = VersionSpecifiers::from_str("blergh"); assert_eq!( result.unwrap_err().inner.err, diff --git a/crates/puffin-cache/src/lib.rs b/crates/puffin-cache/src/lib.rs index 12a9b2e89..ba20e08df 100644 --- a/crates/puffin-cache/src/lib.rs +++ b/crates/puffin-cache/src/lib.rs @@ -392,7 +392,7 @@ pub enum CacheBucket { /// * `simple-v0/pypi/.msgpack` /// * `simple-v0//.msgpack` /// - /// The response is parsed into [`puffin_client::SimpleMetadata`] before storage. + /// The response is parsed into `puffin_client::SimpleMetadata` before storage. Simple, } diff --git a/crates/puffin-interpreter/src/lib.rs b/crates/puffin-interpreter/src/lib.rs index cf060f830..8bbd5b2fc 100644 --- a/crates/puffin-interpreter/src/lib.rs +++ b/crates/puffin-interpreter/src/lib.rs @@ -4,6 +4,7 @@ use std::time::SystemTimeError; use thiserror::Error; +pub use crate::cfg::Configuration; pub use crate::interpreter::Interpreter; pub use crate::python_version::PythonVersion; pub use crate::virtual_env::Virtualenv; diff --git a/crates/puffin-resolver/src/lib.rs b/crates/puffin-resolver/src/lib.rs index fba3709bc..bcedbd454 100644 --- a/crates/puffin-resolver/src/lib.rs +++ b/crates/puffin-resolver/src/lib.rs @@ -2,7 +2,7 @@ pub use error::ResolveError; pub use finder::{DistFinder, Reporter as FinderReporter}; pub use manifest::Manifest; pub use prerelease_mode::PreReleaseMode; -pub use resolution::ResolutionGraph; +pub use resolution::{Diagnostic, ResolutionGraph}; pub use resolution_mode::ResolutionMode; pub use resolution_options::ResolutionOptions; pub use resolver::{BuildId, Reporter as ResolverReporter, Resolver, ResolverProvider}; diff --git a/crates/puffin-resolver/src/resolver/provider.rs b/crates/puffin-resolver/src/resolver/provider.rs index a83ea03ec..ae0dd3e09 100644 --- a/crates/puffin-resolver/src/resolver/provider.rs +++ b/crates/puffin-resolver/src/resolver/provider.rs @@ -37,7 +37,7 @@ pub trait ResolverProvider: Send + Sync { dist: &'io Dist, ) -> impl Future + Send + 'io; - /// Set the [`Reporter`] to use for this installer. + /// Set the [`puffin_distribution::Reporter`] to use for this installer. #[must_use] fn with_reporter(self, reporter: impl puffin_distribution::Reporter + 'static) -> Self; } diff --git a/crates/pypi-types/Cargo.toml b/crates/pypi-types/Cargo.toml index 5ed1a4b58..c998935b4 100644 --- a/crates/pypi-types/Cargo.toml +++ b/crates/pypi-types/Cargo.toml @@ -16,7 +16,6 @@ workspace = true pep440_rs = { path = "../pep440-rs", features = ["serde"] } pep508_rs = { path = "../pep508-rs", features = ["serde"] } puffin-normalize = { path = "../puffin-normalize" } -puffin-warnings = { path = "../puffin-warnings" } chrono = { workspace = true, features = ["serde"] } mailparse = { workspace = true }