Skip to content

Commit

Permalink
Move OnceMap into its own crate
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh committed Jan 17, 2024
1 parent 5051b2c commit b5e4eb7
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 11 deletions.
12 changes: 10 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions crates/once-map/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[package]
name = "once-map"
version = "0.0.1"
edition = { workspace = true }
rust-version = { workspace = true }
homepage = { workspace = true }
documentation = { workspace = true }
repository = { workspace = true }
authors = { workspace = true }
license = { workspace = true }

[lints]
workspace = true

[dependencies]
rustc-hash = { workspace = true }
waitmap = { workspace = true }
File renamed without changes.
3 changes: 2 additions & 1 deletion crates/puffin-resolver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ cache-key = { path = "../cache-key" }
distribution-filename = { path = "../distribution-filename", features = ["serde"] }
distribution-types = { path = "../distribution-types" }
install-wheel-rs = { path = "../install-wheel-rs" }
once-map = { path = "../once-map" }
pep440_rs = { path = "../pep440-rs", features = ["pubgrub"] }
pep508_rs = { path = "../pep508-rs" }
platform-host = { path = "../platform-host" }
Expand All @@ -26,9 +27,9 @@ puffin-client = { path = "../puffin-client" }
puffin-distribution = { path = "../puffin-distribution" }
puffin-git = { path = "../puffin-git" }
puffin-interpreter = { path = "../puffin-interpreter" }
puffin-warnings = { path = "../puffin-warnings" }
puffin-normalize = { path = "../puffin-normalize" }
puffin-traits = { path = "../puffin-traits" }
puffin-warnings = { path = "../puffin-warnings" }
pypi-types = { path = "../pypi-types" }
requirements-txt = { path = "../requirements-txt" }

Expand Down
2 changes: 1 addition & 1 deletion crates/puffin-resolver/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ use thiserror::Error;
use url::Url;

use distribution_types::{BuiltDist, PathBuiltDist, PathSourceDist, SourceDist};
use once_map::OnceMap;
use pep440_rs::Version;
use pep508_rs::Requirement;
use puffin_distribution::DistributionDatabaseError;
use puffin_normalize::PackageName;
use puffin_traits::OnceMap;

use crate::candidate_selector::CandidateSelector;
use crate::pubgrub::{PubGrubPackage, PubGrubPython, PubGrubReportFormatter};
Expand Down
2 changes: 1 addition & 1 deletion crates/puffin-resolver/src/resolution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ use rustc_hash::FxHashMap;
use url::Url;

use distribution_types::{Dist, DistributionMetadata, LocalEditable, Name, PackageId, Verbatim};
use once_map::OnceMap;
use pep440_rs::Version;
use pep508_rs::VerbatimUrl;
use puffin_normalize::{ExtraName, PackageName};
use puffin_traits::OnceMap;
use pypi_types::{Hashes, Metadata21};

use crate::pins::FilePins;
Expand Down
2 changes: 1 addition & 1 deletion crates/puffin-resolver/src/resolver/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use dashmap::DashMap;
use url::Url;

use distribution_types::PackageId;
use once_map::OnceMap;
use puffin_normalize::PackageName;
use puffin_traits::OnceMap;
use pypi_types::Metadata21;

use crate::version_map::VersionMap;
Expand Down
3 changes: 1 addition & 2 deletions crates/puffin-traits/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@ workspace = true

[dependencies]
distribution-types = { path = "../distribution-types" }
once-map = { path = "../once-map" }
pep508_rs = { path = "../pep508-rs" }
puffin-cache = { path = "../puffin-cache" }
puffin-interpreter = { path = "../puffin-interpreter" }

anyhow = { workspace = true }
rustc-hash = { workspace = true }
tokio = { workspace = true, features = ["sync"] }
waitmap = { workspace = true }
4 changes: 1 addition & 3 deletions crates/puffin-traits/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ use std::path::{Path, PathBuf};
use anyhow::Result;

use distribution_types::{CachedDist, DistributionId, Resolution};
pub use once_map::OnceMap;
use once_map::OnceMap;
use pep508_rs::Requirement;
use puffin_cache::Cache;
use puffin_interpreter::{Interpreter, Virtualenv};

mod once_map;

/// Avoid cyclic crate dependencies between resolver, installer and builder.
///
/// To resolve the dependencies of a packages, we may need to build one or more source
Expand Down

0 comments on commit b5e4eb7

Please sign in to comment.