Skip to content

Commit

Permalink
Integrate source distribution building
Browse files Browse the repository at this point in the history
  • Loading branch information
konstin committed Oct 24, 2023
1 parent d0aeb2a commit 0cc1f52
Show file tree
Hide file tree
Showing 33 changed files with 879 additions and 223 deletions.
123 changes: 90 additions & 33 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion crates/install-wheel-rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ rayon = { version = "1.8.0", optional = true }
reflink-copy = { workspace = true }
regex = { workspace = true }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
sha2 = { workspace = true }
target-lexicon = { workspace = true }
tempfile = { workspace = true }
Expand Down
4 changes: 2 additions & 2 deletions crates/install-wheel-rs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ pub use record::RecordEntry;
pub use script::Script;
pub use uninstall::{uninstall_wheel, Uninstall};
pub use wheel::{
get_script_launcher, install_wheel, parse_key_value_file, read_record_file, relative_to,
SHEBANG_PYTHON,
find_dist_info, get_script_launcher, install_wheel, parse_key_value_file, read_record_file,
relative_to, SHEBANG_PYTHON,
};

mod install_location;
Expand Down
2 changes: 1 addition & 1 deletion crates/install-wheel-rs/src/wheel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1026,7 +1026,7 @@ pub fn install_wheel(
/// Either way, we just search the wheel for the name
///
/// <https://github.com/PyO3/python-pkginfo-rs>
fn find_dist_info(
pub fn find_dist_info(
filename: &WheelFilename,
archive: &mut ZipArchive<impl Read + Seek + Sized>,
) -> Result<String, Error> {
Expand Down
14 changes: 14 additions & 0 deletions crates/pep440-rs/src/version_specifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ impl FromStr for VersionSpecifiers {
}
}

impl From<VersionSpecifier> for VersionSpecifiers {
fn from(specifier: VersionSpecifier) -> Self {
Self(vec![specifier])
}
}

impl Display for VersionSpecifiers {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
for (idx, version_specifier) in self.0.iter().enumerate() {
Expand Down Expand Up @@ -341,6 +347,14 @@ impl VersionSpecifier {
Ok(Self { operator, version })
}

/// `==<version>`
pub fn equals_version(version: Version) -> Self {
Self {
operator: Operator::Equal,
version,
}
}

/// Get the operator, e.g. `>=` in `>= 2.0.0`
pub fn operator(&self) -> &Operator {
&self.operator
Expand Down
6 changes: 6 additions & 0 deletions crates/pep508-rs/src/marker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,12 @@ impl FromStr for StringVersion {
}
}

impl Display for StringVersion {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
self.version.fmt(f)
}
}

#[cfg(feature = "serde")]
impl Serialize for StringVersion {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
Expand Down
2 changes: 2 additions & 0 deletions crates/puffin-build-cli/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
downloads
wheels
Loading

0 comments on commit 0cc1f52

Please sign in to comment.