diff --git a/Changelog.md b/Changelog.md index e39a39789..503a2e8f3 100644 --- a/Changelog.md +++ b/Changelog.md @@ -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) ## [0.14.4] - 2022-12-05 diff --git a/guide/src/metadata.md b/guide/src/metadata.md index f0ed3ff24..eb61cb9be 100644 --- a/guide/src/metadata.md +++ b/guide/src/metadata.md @@ -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 diff --git a/src/auditwheel/patchelf.rs b/src/auditwheel/patchelf.rs index 69924a163..7681c6e63 100644 --- a/src/auditwheel/patchelf.rs +++ b/src/auditwheel/patchelf.rs @@ -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 ); } diff --git a/src/cargo_toml.rs b/src/cargo_toml.rs index c3df43e16..10c69b2b1 100644 --- a/src/cargo_toml.rs +++ b/src/cargo_toml.rs @@ -104,8 +104,6 @@ struct CargoTomlMetadata { #[serde(rename_all = "kebab-case")] pub struct RemainingCoreMetadata { pub name: Option, - /// The directory with python module, contains `/__init__.py` - pub python_source: Option, /// The directory containing the wheel data pub data: Option, #[serde(flatten)] diff --git a/src/project_layout.rs b/src/project_layout.rs index 8f915d7c5..858df08d3 100644 --- a/src/project_layout.rs +++ b/src/project_layout.rs @@ -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()) { diff --git a/src/pyproject_toml.rs b/src/pyproject_toml.rs index 60cd5f3b5..7ff2087e6 100644 --- a/src/pyproject_toml.rs +++ b/src/pyproject_toml.rs @@ -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>, include: Option>, exclude: Option>, bindings: Option, @@ -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` ()" - )] - pub fn sdist_include(&self) -> Option<&Vec> { - 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) diff --git a/src/source_distribution.rs b/src/source_distribution.rs index 351ba5fd4..e285cf66f 100644 --- a/src/source_distribution.rs +++ b/src/source_distribution.rs @@ -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()