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

Only use extension name from extra metadata if it contains dot #536

Merged
merged 1 commit into from
May 14, 2021

Conversation

messense
Copy link
Member

@messense messense commented May 9, 2021

Previously the following example would work because maturin will use lib.name instead of package.metadata.maturin.name

[package]
name = "py-abc-def"

[lib]
name = "abc_def"
crate-type = ["cdylib"]

[package.metadata.maturin]
name = "abc-def"

With #489 it's broken (example) and it will use package.metadata.maturin.name for the extension filename which results in ImportError at runtime.

This PR restore the previous behavior.

@konstin
Copy link
Member

konstin commented May 14, 2021

LGTM

@konstin konstin merged commit 0afd208 into PyO3:main May 14, 2021
@messense messense deleted the normalize-extension-name branch May 14, 2021 16:38
bors bot added a commit that referenced this pull request Jan 13, 2023
1409: Use module name specified by `[package.metadata.maturin]` r=messense a=messense

Reverts #536

It's counterintuitive and cause trouble when user needs to customize the name, we now emit a better error message when the name isn't appropriate for `lib`.

Helps with astral-sh/ruff#1816 (comment)

Co-authored-by: messense <[email protected]>
bors bot added a commit that referenced this pull request Jan 13, 2023
1409: Use module name specified by `[package.metadata.maturin]` r=messense a=messense

Reverts #536

It's counterintuitive and cause trouble when user needs to customize the name, we now emit a better error message when the name isn't appropriate for `lib`.

Helps with astral-sh/ruff#1816 (comment)

Co-authored-by: messense <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants