Skip to content

build backend - issue with license metadata element #9947

@cthoyt

Description

@cthoyt

I'm on uv 0.5.8 (80d4167 2024-12-11). Update: I also tried this on uv 0.5.9 (0652800 2024-12-13) and got the same results.

I created an example project and added a dummy license file to it with:

$ uv --preview init xyz --build-backend uv
$ touch xyz/LICENSE

I'm not sure if there's an interface through uv to add metadata to pyproject.toml, but I added the following license declaration under the [project] section:

license = { file = "LICENSE" }

Then, I got the following error with builds:

$ uv --preview build
Building source distribution (uv build backend)...
Building wheel from source distribution (uv build backend)...
  × Failed to build `/Users/cthoyt/Desktop/xyz`
  ╰─▶ failed to open file
      `/Users/cthoyt/Library/Caches/uv/sdists-v6/.tmp5tXXVU/xyz-0.1.0/LICENSE`: No such
      file or directory (os error 2)

Interestingly, the following works, which doesn't try building the wheel from the sdist:

$ uv --preview build --sdist --wheel
Building source distribution (uv build backend)...
Building wheel (uv build backend)...
Successfully built dist/xyz-0.1.0.tar.gz
Successfully built dist/xyz-0.1.0-py3-none-any.whl

If I trade the license declaration for the following, it works.

license-files = [
    "LICENSE"
]

However, it's not clear if this is because the license element of the metadata is deprecated, or if there's a bug in handling it. I am aware that the metadata versions and the license declarations are currently a sore spot, so thanks for any advice :)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions