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

Support modules with different casing in build backend #12240

Merged
merged 7 commits into from
Mar 23, 2025

Conversation

konstin
Copy link
Member

@konstin konstin commented Mar 17, 2025

Match the module name to its module directory with potentially different casing.

For example, a package may have the dist-info-normalized package name pil_util, but the importable module is named PIL_util.

We get the module name either as dist-info-normalized package name, or explicitly from the user. For dist-info-normalizing a package name, the rules are lowercasing, replacing . with _ and replace - with _. Since . and - are not allowed in module names, we can check whether a directory name matches our expected module name by lowercasing it.

Fixes #12187

@konstin konstin added the bug Something isn't working label Mar 17, 2025
@NourEldin-Osama
Copy link

May I ask when this pull request will get merged?

konstin added 5 commits March 21, 2025 18:10
Match the module name to its module directory with potentially different casing.

For example, a package may have the dist-info-normalized package name `pil_util`, but the importable module is named `PIL_util`.

We get the module either as dist-info-normalized package name, or explicitly from the user.
For dist-info-normalizing a package name, the rules are lowercasing, replacing `.` with `_` and
replace `-` with `_`. Since `.` and `-` are not allowed in module names, we can check whether a
directory name matches our expected module name by lowercasing it.

Fixes #12187
@konstin konstin force-pushed the konsti/build-backend-normalize-module-name branch from 454f3de to a4a350a Compare March 22, 2025 01:10
@konstin konstin requested a review from charliermarsh March 22, 2025 01:17
@charliermarsh charliermarsh force-pushed the konsti/build-backend-normalize-module-name branch from fe77ee9 to 2db6c32 Compare March 23, 2025 13:19
@charliermarsh charliermarsh enabled auto-merge (squash) March 23, 2025 13:19
@charliermarsh charliermarsh merged commit fb1b323 into main Mar 23, 2025
76 checks passed
@charliermarsh charliermarsh deleted the konsti/build-backend-normalize-module-name branch March 23, 2025 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

uv_build Error when the folder name is capitalized
3 participants