Skip to content

Commit

Permalink
Fix sdist with local path dependencies on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
messense committed Jun 26, 2021
1 parent 3e2b8b0 commit c8233ac
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Support Aarch64 on OpenBSD in [#570](https://github.com/PyO3/maturin/pull/570)
* Support Aarch64 on FreeBSD in [#571](https://github.com/PyO3/maturin/pull/571)
* `Cargo.toml`'s `authors` field is now optional per Rust [RFC 3052](https://github.com/rust-lang/rfcs/blob/master/text/3052-optional-authors-field.md) in [#573](https://github.com/PyO3/maturin/pull/573)
* Fix source distribution with local path dependencies on Windows in [#580](https://github.com/PyO3/maturin/pull/580)

## 0.10.6 - 2021-05-21

Expand Down
9 changes: 7 additions & 2 deletions src/source_distribution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,14 @@ pub fn source_distribution(
sdist_include: Option<&Vec<String>>,
) -> Result<PathBuf> {
// Parse ids in the format:
// some_path_dep 0.1.0 (path+file:///home/konsti/maturin/test-crates/some_path_dep)
// on unix: some_path_dep 0.1.0 (path+file:///home/konsti/maturin/test-crates/some_path_dep)
// on windows: some_path_dep 0.1.0 (path+file:///C:/konsti/maturin/test-crates/some_path_dep)
// This is not a good way to identify path dependencies, but I don't know a better one
let matcher = Regex::new(r"^(.*) .* \(path\+file://(.*)\)$").unwrap();
let matcher = if cfg!(windows) {
Regex::new(r"^(.*) .* \(path\+file:///(.*)\)$").unwrap()
} else {
Regex::new(r"^(.*) .* \(path\+file://(.*)\)$").unwrap()
};
let resolve = cargo_metadata
.resolve
.as_ref()
Expand Down

0 comments on commit c8233ac

Please sign in to comment.