-
-
Notifications
You must be signed in to change notification settings - Fork 284
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove
workspace.members
in Cargo.toml
from sdist if there isn't …
…any path dependency
- Loading branch information
Showing
9 changed files
with
123 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[package] | ||
name = "local-test" | ||
version = "0.1.0" | ||
edition = "2018" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
pub fn add(left: usize, right: usize) -> usize { | ||
left + right | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use super::*; | ||
|
||
#[test] | ||
fn it_works() { | ||
let result = add(2, 2); | ||
assert_eq!(result, 4); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,9 @@ use common::{ | |
develop, editable, errors, get_python_implementation, handle_result, integration, other, | ||
test_python_path, | ||
}; | ||
use indoc::indoc; | ||
use maturin::Target; | ||
use std::path::PathBuf; | ||
use std::path::{Path, PathBuf}; | ||
|
||
mod common; | ||
|
||
|
@@ -375,6 +376,47 @@ fn workspace_cargo_lock() { | |
handle_result(other::test_workspace_cargo_lock()) | ||
} | ||
|
||
#[test] | ||
fn workspace_members_non_local_dep_sdist() { | ||
let cargo_toml = indoc!( | ||
r#" | ||
[package] | ||
authors = ["konstin <[email protected]>"] | ||
name = "pyo3-pure" | ||
version = "2.1.2" | ||
edition = "2018" | ||
description = "Implements a dummy function (get_fortytwo.DummyClass.get_42()) in rust" | ||
license = "MIT" | ||
[dependencies] | ||
pyo3 = { version = "0.17.2", features = ["abi3-py37", "extension-module", "generate-import-lib"] } | ||
[lib] | ||
name = "pyo3_pure" | ||
crate-type = ["cdylib"] | ||
"# | ||
); | ||
handle_result(other::test_source_distribution( | ||
"test-crates/pyo3-pure", | ||
vec![ | ||
"pyo3_pure-0.1.0+abc123de/Cargo.lock", | ||
"pyo3_pure-0.1.0+abc123de/Cargo.toml", | ||
"pyo3_pure-0.1.0+abc123de/LICENSE", | ||
"pyo3_pure-0.1.0+abc123de/PKG-INFO", | ||
"pyo3_pure-0.1.0+abc123de/README.md", | ||
"pyo3_pure-0.1.0+abc123de/Readme.md", | ||
"pyo3_pure-0.1.0+abc123de/check_installed/check_installed.py", | ||
"pyo3_pure-0.1.0+abc123de/pyo3_pure.pyi", | ||
"pyo3_pure-0.1.0+abc123de/pyproject.toml", | ||
"pyo3_pure-0.1.0+abc123de/src/lib.rs", | ||
"pyo3_pure-0.1.0+abc123de/tests/test_pyo3_pure.py", | ||
"pyo3_pure-0.1.0+abc123de/tox.ini", | ||
], | ||
Some((Path::new("pyo3_pure-0.1.0+abc123de/Cargo.toml"), cargo_toml)), | ||
"sdist-workspace-members-non-local-dep", | ||
)) | ||
} | ||
|
||
#[test] | ||
fn lib_with_path_dep_sdist() { | ||
handle_result(other::test_source_distribution( | ||
|
@@ -390,6 +432,7 @@ fn lib_with_path_dep_sdist() { | |
"sdist_with_path_dep-0.1.0/src/lib.rs", | ||
"sdist_with_path_dep-0.1.0/PKG-INFO", | ||
], | ||
None, | ||
"sdist-lib-with-path-dep", | ||
)) | ||
} | ||
|
@@ -408,6 +451,7 @@ fn pyo3_mixed_src_layout_sdist() { | |
"pyo3_mixed_src-2.1.3/rust/src/lib.rs", | ||
"pyo3_mixed_src-2.1.3/PKG-INFO", | ||
], | ||
None, | ||
"sdist-pyo3-mixed-src-layout", | ||
)) | ||
} | ||
|
@@ -426,6 +470,7 @@ fn workspace_with_path_dep_sdist() { | |
"workspace_with_path_dep-0.1.0/src/lib.rs", | ||
"workspace_with_path_dep-0.1.0/PKG-INFO", | ||
], | ||
None, | ||
"sdist-workspace-with-path-dep", | ||
)) | ||
} | ||
|
@@ -443,6 +488,7 @@ fn workspace_inheritance_sdist() { | |
"workspace_inheritance-0.1.0/src/lib.rs", | ||
"workspace_inheritance-0.1.0/PKG-INFO", | ||
], | ||
None, | ||
"sdist-workspace-inheritance", | ||
)) | ||
} | ||
|