Skip to content

Commit

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



Co-authored-by: messense <messense@icloud.com>
  • Loading branch information
bors[bot] and messense authored Dec 5, 2022
2 parents 1e09e2f + cc721e0 commit 9992301
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 52 deletions.
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)

## [0.14.4] - 2022-12-05

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 9992301

Please sign in to comment.