Skip to content

Commit

Permalink
Merge #1335 #1336
Browse files Browse the repository at this point in the history
1335: Remove deprecated config options r=messense a=messense



1336: cargo deny multiple crate versions r=messense a=messense

To avoid pulling in more of them in the future, part of #1306 

Co-authored-by: messense <messense@icloud.com>
  • Loading branch information
bors[bot] and messense authored Dec 6, 2022
3 parents 37c62f6 + 84ee0ff + a896c46 commit ccb02d1
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 56 deletions.
8 changes: 5 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ base64 = "0.13.0"
glob = "0.3.0"
cargo_metadata = "0.15.2"
cargo-options = "0.5.2"
cargo-zigbuild = { version = "0.14.1", optional = true }
cargo-xwin = { version = "0.13.0", default-features = false, optional = true }
cbindgen = { version = "0.24.2", default-features = false }
uniffi_bindgen = "0.21.0"
flate2 = "1.0.18"
Expand Down Expand Up @@ -58,11 +56,16 @@ cc = "1.0.72"
dunce = "1.0.2"
normpath = "0.3.2"
pep440 = "0.2.0"
time = "0.3.17"

# cli
clap = { version = "4.0.0", features = ["derive", "env", "wrap_help"] }
clap_complete_command = "0.4.0"

# cross compile
cargo-zigbuild = { version = "0.14.1", optional = true }
cargo-xwin = { version = "0.13.0", default-features = false, optional = true }

# log
tracing = "0.1.36"
tracing-subscriber = { version = "0.3.15", features = ["env-filter"], optional = true }
Expand All @@ -80,7 +83,6 @@ rpassword = { version = "7.0.0", optional = true }
ureq = { version = "2.3.1", features = ["gzip", "socks-proxy"], default-features = false, optional = true }
native-tls-crate = { package = "native-tls", version = "0.2.8", optional = true }
keyring = { version = "1.1.1", optional = true }
time = "0.3.17"

[dev-dependencies]
indoc = "1.0.3"
Expand Down
3 changes: 3 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]

* **Breaking Change**: Build with `--no-default-features` by default when bootstrapping from sdist in [#1333](https://github.com/PyO3/maturin/pull/1333)
* **Breaking Change**: Remove deprecated `sdist-include` option in `pyproject.toml` in [#1335](https://github.com/PyO3/maturin/pull/1335)
* **Breaking Change**: Remove deprecated `python-source` option in `Cargo.toml` in [#1335](https://github.com/PyO3/maturin/pull/1335)
* **Breaking Change**: Turn `patchelf` version warning into a hard error in [#1335](https://github.com/PyO3/maturin/pull/1335)
* Support `SOURCE_DATE_EPOCH` when building wheels in [#1334](https://github.com/PyO3/maturin/pull/1334)

## [0.14.4] - 2022-12-05
Expand Down
15 changes: 14 additions & 1 deletion deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ registries = [
# https://embarkstudios.github.io/cargo-deny/checks/bans/cfg.html
[bans]
# Lint level for when multiple versions of the same crate are detected
multiple-versions = "warn"
multiple-versions = "deny"
# Lint level for when a crate version requirement is `*`
wildcards = "allow"
# The graph highlighting used when creating dotgraphs for crates
Expand All @@ -173,13 +173,26 @@ deny = [
# Certain crates/versions that will be skipped when doing duplicate detection.
skip = [
#{ name = "ansi_term", version = "=0.11.0" },

# from uniffi-bindgen
{ name = "goblin", version = "0.5.4" },
# from console
{ name = "terminal_size", version = "0.1.7" },
# from secret-service
{ name = "block-buffer", version = "0.9.0" },
{ name = "digest", version = "0.9.0" },
{ name = "memoffset", version = "0.6.5" },
{ name = "proc-macro-crate", version = "0.1.5" },
{ name = "sha2", version = "0.9.9" },
]
# Similarly to `skip` allows you to skip certain crates during duplicate
# detection. Unlike skip, it also includes the entire tree of transitive
# dependencies starting at the specified crate, up to a certain depth, which is
# by default infinite
skip-tree = [
#{ name = "ansi_term", version = "=0.11.0", depth = 20 },
{ name = "clap", version = "3.2.23" },
{ name = "windows-sys", version = "0.36.1" },
]

# This section is considered when running `cargo deny check sources`.
Expand Down
3 changes: 0 additions & 3 deletions guide/src/metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,6 @@ in the `tool.maturin` section of `pyproject.toml`.

```toml
[tool.maturin]
# Include arbitrary files in the sdist
# NOTE: deprecated, please use `include` with `format="sdist"`
sdist-include = []
# Include additional files
include = []
# Exclude files
Expand Down
5 changes: 2 additions & 3 deletions src/auditwheel/patchelf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ pub fn verify_patchelf() -> Result<()> {
.context("Failed to parse patchelf version")?;
println!("{:?}", semver);
if semver < semver::Version::new(0, 14, 0) {
// TODO: turn it into an error in 1.0
eprintln!(
"⚠️ Warning: patchelf {} found. auditwheel repair requires patchelf >= 0.14.",
bail!(
"patchelf {} found. auditwheel repair requires patchelf >= 0.14.",
version
);
}
Expand Down
2 changes: 0 additions & 2 deletions src/cargo_toml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ struct CargoTomlMetadata {
#[serde(rename_all = "kebab-case")]
pub struct RemainingCoreMetadata {
pub name: Option<String>,
/// The directory with python module, contains `<module_name>/__init__.py`
pub python_source: Option<String>,
/// The directory containing the wheel data
pub data: Option<String>,
#[serde(flatten)]
Expand Down
40 changes: 17 additions & 23 deletions src/project_layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,30 +137,24 @@ impl ProjectResolver {
};
let py_root = match pyproject.and_then(|x| x.python_source()) {
Some(py_src) => project_root.join(py_src),
None => match extra_metadata.python_source.as_ref() {
Some(py_src) => {
println!("⚠️ Warning: specify python-source in Cargo.toml is deprecated, use python-source in [tool.maturin] section in pyproject.toml instead");
manifest_dir.join(py_src)
}
None => match pyproject.and_then(|x| x.project_name()) {
Some(project_name) => {
// Detect src layout
let import_name = project_name.replace('-', "_");
let rust_cargo_toml_found =
project_root.join("rust").join("Cargo.toml").is_file();
let python_src_found = project_root
.join("src")
.join(import_name)
.join("__init__.py")
.is_file();
if rust_cargo_toml_found && python_src_found {
project_root.join("src")
} else {
project_root.to_path_buf()
}
None => match pyproject.and_then(|x| x.project_name()) {
Some(project_name) => {
// Detect src layout
let import_name = project_name.replace('-', "_");
let rust_cargo_toml_found =
project_root.join("rust").join("Cargo.toml").is_file();
let python_src_found = project_root
.join("src")
.join(import_name)
.join("__init__.py")
.is_file();
if rust_cargo_toml_found && python_src_found {
project_root.join("src")
} else {
project_root.to_path_buf()
}
None => project_root.to_path_buf(),
},
}
None => project_root.to_path_buf(),
},
};
let data = match pyproject.and_then(|x| x.data()) {
Expand Down
11 changes: 0 additions & 11 deletions src/pyproject_toml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ impl GlobPattern {
#[serde(rename_all = "kebab-case")]
pub struct ToolMaturin {
// maturin specific options
// TODO(0.15.0): remove deprecated
sdist_include: Option<Vec<String>>,
include: Option<Vec<GlobPattern>>,
exclude: Option<Vec<GlobPattern>>,
bindings: Option<String>,
Expand Down Expand Up @@ -170,15 +168,6 @@ impl PyProjectToml {
self.tool.as_ref()?.maturin.as_ref()
}

/// Returns the value of `[tool.maturin.sdist-include]` in pyproject.toml
#[deprecated(
since = "0.14.0",
note = "please use `PyProjectToml::include` (<https://github.com/PyO3/maturin/pulls/1255>)"
)]
pub fn sdist_include(&self) -> Option<&Vec<String>> {
self.maturin()?.sdist_include.as_ref()
}

/// Returns the value of `[tool.maturin.include]` in pyproject.toml
pub fn include(&self) -> Option<&[GlobPattern]> {
self.maturin()?.include.as_ref().map(AsRef::as_ref)
Expand Down
10 changes: 0 additions & 10 deletions src/source_distribution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -593,16 +593,6 @@ pub fn source_distribution(
Ok(())
};

#[allow(deprecated)]
if let Some(include_targets) = pyproject.sdist_include() {
eprintln!(
"⚠️ Warning: `[tool.maturin.sdist-include]` is deprecated, please use `[tool.maturin.include]`"
);
for pattern in include_targets {
include(pattern.as_str())?;
}
}

if let Some(glob_patterns) = pyproject.include() {
for pattern in glob_patterns
.iter()
Expand Down

0 comments on commit ccb02d1

Please sign in to comment.