Skip to content

Commit

Permalink
Use module name specified by [package.metadata.maturin]
Browse files Browse the repository at this point in the history
  • Loading branch information
messense committed Jan 13, 2023
1 parent 0bccbf7 commit f2d6718
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
2 changes: 2 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

* Use module name specified by `[package.metadata.maturin]` in [#1409](https://github.com/PyO3/maturin/pull/1409)

## [0.14.9] - 2023-01-10

* Don't pass `MACOSX_DEPLOYMENT_TARGET` when query default value from rustc in [#1395](https://github.com/PyO3/maturin/pull/1395)
Expand Down
5 changes: 3 additions & 2 deletions src/build_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -501,8 +501,9 @@ impl BuildOptions {

if !bridge.is_bin() && module_name.contains('-') {
bail!(
"The module name must not contains a minus \
(Make sure you have set an appropriate [lib] name in your Cargo.toml)"
"The module name must not contain a minus `-` \
(Make sure you have set an appropriate [lib] name or \
[package.metadata.maturin] name in your Cargo.toml)"
);
}

Expand Down
7 changes: 1 addition & 6 deletions src/project_layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,7 @@ impl ProjectResolver {
.unwrap_or(crate_name)
.to_owned();

// Only use extension name from extra metadata if it contains dot
let extension_name = extra_metadata
.name
.as_ref()
.filter(|name| name.contains('.'))
.unwrap_or(&module_name);
let extension_name = extra_metadata.name.as_ref().unwrap_or(&module_name);

let project_root = if pyproject_file.is_file() {
pyproject_file.parent().unwrap_or(manifest_dir)
Expand Down

0 comments on commit f2d6718

Please sign in to comment.