Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated config options #1335

Merged
merged 4 commits into from
Dec 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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