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

uv_build Error when the folder name is capitalized #12187

Open
NourEldin-Osama opened this issue Mar 15, 2025 · 3 comments · May be fixed by #12240
Open

uv_build Error when the folder name is capitalized #12187

NourEldin-Osama opened this issue Mar 15, 2025 · 3 comments · May be fixed by #12240
Assignees
Labels
bug Something isn't working

Comments

@NourEldin-Osama
Copy link

Summary

when i run

uv build

and the

build-backend = "uv_build"

pyproject.toml

[project]
name = "Transcriber"
version = "0.1.5"
description = "A simple tool to transcribe audio files"
readme = "README.md"
authors = [
    { name = "NourEldin", email = "[email protected]" }
]
requires-python = ">=3.11"
dependencies = [
    "faster-whisper>=1.1.1",
    "openai-whisper>=20240930",
    "pydantic-settings>=2.7.1",
    "python-docx>=1.1.2",
    "rich>=13.9.4",
    "stable-ts>=2.18.3",
    "yt-dlp==2025.1.15",
]

[project.scripts]
transcribe = "Transcriber.transcriber:transcribe"

[build-system]
requires = ["uv_build"]
build-backend = "uv_build"

the code for the package is in in src\Transcriber

terminal output

N:\Transcriber> uv build
Building source distribution...
Building wheel from source distribution...
Error: Expected a Python module with an `__init__.py` at: `src\transcriber`
  × Failed to build `N:\Transcriber`
  ├─▶ The build backend returned an error
  ╰─▶ Call to `uv_build.build_wheel` failed (exit code: 1)
      hint: This usually indicates a problem with the package or the build environment.

but if i changed the package folder to src\transcriber it works

also this is works when and folder = src\Transcriber

build-backend = "hatchling.build"

Platform

Microsoft Windows 11 Pro x86_64

Version

uv 0.6.5 (bcbcd0a 2025-03-06)

Python version

Python 3.11.10

@NourEldin-Osama NourEldin-Osama added the bug Something isn't working label Mar 15, 2025
@charliermarsh
Copy link
Member

It looks like we expect you to use the normalized name here. You could set:

[tool.uv.build-backend]
module-name = "Transcriber"

Somewhat undecided on whether this should work out of the box -- I think it probably should? What do you think @konstin?

@NourEldin-Osama
Copy link
Author

It looks like we expect you to use the normalized name here. You could set:

[tool.uv.build-backend]
module-name = "Transcriber"
Somewhat undecided on whether this should work out of the box -- I think it probably should? What do you think @konstin?

your solution worked, but isn't the expected to work without adding it like when using hatchling?

@charliermarsh
Copy link
Member

It probably should, yeah.

@konstin konstin self-assigned this Mar 17, 2025
konstin added a commit that referenced this issue Mar 17, 2025
Match the module name to its module directory with potentially different casing.

We want to support all sorts of normalization, e.g., a package may have the dist-info-normalized
package name `pil_util`, but the module name `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 added a commit that referenced this issue 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 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
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 a pull request may close this issue.

3 participants