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 3f0958d commit 16ea3cf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Add Cargo compile targets configuration for filtering multiple bin targets in [#1339](https://github.com/PyO3/maturin/pull/1339)
* Respect `rustflags` settings in cargo configuration file in [#1405](https://github.com/PyO3/maturin/pull/1405)
* Bump MSRV to 1.63.0 in [#1407](https://github.com/PyO3/maturin/pull/1407)
* Use module name specified by `[package.metadata.maturin]` in [#1409](https://github.com/PyO3/maturin/pull/1409)

## [0.14.9] - 2023-01-10

Expand Down
5 changes: 3 additions & 2 deletions src/build_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -503,8 +503,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 16ea3cf

Please sign in to comment.