Skip to content

Commit

Permalink
Merge pull request #711 from messense/warn-missing-cffi
Browse files Browse the repository at this point in the history
Warn missing cffi package dependency
  • Loading branch information
messense authored Nov 28, 2021
2 parents e6529d0 + 145e61c commit 6fc4f9f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Consider current machine architecture when generating platform tags for abi3
wheels on linux in [#709](https://github.com/PyO3/maturin/pull/709)
* Revert back to Rust 2018 edition in [#710](https://github.com/PyO3/maturin/pull/710)
* Warn missing `cffi` package dependency in [#711](https://github.com/PyO3/maturin/pull/711)

## [0.12.2] - 2021-11-26

Expand Down
13 changes: 13 additions & 0 deletions src/build_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,19 @@ impl BuildContext {
let policy = self.auditwheel(None, &artifact, self.platform_tag)?;
let (wheel_path, tag) = self.write_cffi_wheel(&artifact, policy.platform_tag())?;

// Warn if cffi isn't specified in the requirements
if !self
.metadata21
.requires_dist
.iter()
.any(|dep| dep.to_ascii_lowercase().starts_with("cffi"))
{
eprintln!(
"⚠️ Warning: missing cffi package dependency, please add it to pyproject.toml. \
e.g: `dependencies = [\"cffi\"]`. This will become an error."
);
}

println!("📦 Built wheel to {}", wheel_path.display());
wheels.push((wheel_path, tag));

Expand Down

0 comments on commit 6fc4f9f

Please sign in to comment.