Skip to content

Commit f2d6718

Browse files
committed
Use module name specified by [package.metadata.maturin]
1 parent 0bccbf7 commit f2d6718

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

Changelog.md

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
* Use module name specified by `[package.metadata.maturin]` in [#1409](https://github.com/PyO3/maturin/pull/1409)
11+
1012
## [0.14.9] - 2023-01-10
1113

1214
* Don't pass `MACOSX_DEPLOYMENT_TARGET` when query default value from rustc in [#1395](https://github.com/PyO3/maturin/pull/1395)

src/build_options.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -501,8 +501,9 @@ impl BuildOptions {
501501

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

src/project_layout.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,7 @@ impl ProjectResolver {
128128
.unwrap_or(crate_name)
129129
.to_owned();
130130

131-
// Only use extension name from extra metadata if it contains dot
132-
let extension_name = extra_metadata
133-
.name
134-
.as_ref()
135-
.filter(|name| name.contains('.'))
136-
.unwrap_or(&module_name);
131+
let extension_name = extra_metadata.name.as_ref().unwrap_or(&module_name);
137132

138133
let project_root = if pyproject_file.is_file() {
139134
pyproject_file.parent().unwrap_or(manifest_dir)

0 commit comments

Comments
 (0)