Skip to content

[Improvement] License-File is marked as dynamic even when it isn't #4960

Open
@SpecLad

Description

@SpecLad

setuptools version

setuptools==79.0.1

Python version

Python 3.12.10

OS

Windows 11

Additional environment information

No response

Description

It seems that when setuptools generates distribution package metadata, it always adds Dynamic: license-file, even when the license file(s) are specified statically via pyproject.toml.

Expected behavior

Dynamic: license-file should only be added when the license files are configured via setup.py.

How to Reproduce

Create pyproject.toml:

[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "setuptools-repro"
version = "0"
license-files = ["LICENSE"]

Create LICENSE (any content will do).

Run pyproject-build and examine the PKG-INFO file in the sdist, and METADATA in the wheel.

Output

> pyproject-build
* Creating isolated environment: venv+pip...
* Installing packages in isolated environment:
  - setuptools
* Getting build dependencies for sdist...
running egg_info
writing setuptools_repro.egg-info\PKG-INFO
writing dependency_links to setuptools_repro.egg-info\dependency_links.txt
writing top-level names to setuptools_repro.egg-info\top_level.txt
reading manifest file 'setuptools_repro.egg-info\SOURCES.txt'
adding license file 'LICENSE'
writing manifest file 'setuptools_repro.egg-info\SOURCES.txt'
* Building sdist...
running sdist
running egg_info
writing setuptools_repro.egg-info\PKG-INFO
writing dependency_links to setuptools_repro.egg-info\dependency_links.txt
writing top-level names to setuptools_repro.egg-info\top_level.txt
reading manifest file 'setuptools_repro.egg-info\SOURCES.txt'
adding license file 'LICENSE'
writing manifest file 'setuptools_repro.egg-info\SOURCES.txt'
warning: sdist: standard file not found: should have one of README, README.rst, README.txt, README.md

running check
creating setuptools_repro-0
creating setuptools_repro-0\setuptools_repro.egg-info
copying files to setuptools_repro-0...
copying LICENSE -> setuptools_repro-0
copying pyproject.toml -> setuptools_repro-0
copying setuptools_repro.egg-info\PKG-INFO -> setuptools_repro-0\setuptools_repro.egg-info
copying setuptools_repro.egg-info\SOURCES.txt -> setuptools_repro-0\setuptools_repro.egg-info
copying setuptools_repro.egg-info\dependency_links.txt -> setuptools_repro-0\setuptools_repro.egg-info
copying setuptools_repro.egg-info\top_level.txt -> setuptools_repro-0\setuptools_repro.egg-info
copying setuptools_repro.egg-info\SOURCES.txt -> setuptools_repro-0\setuptools_repro.egg-info
Writing setuptools_repro-0\setup.cfg
Creating tar archive
removing 'setuptools_repro-0' (and everything under it)
* Building wheel from sdist
* Creating isolated environment: venv+pip...
* Installing packages in isolated environment:
  - setuptools
* Getting build dependencies for wheel...
running egg_info
writing setuptools_repro.egg-info\PKG-INFO
writing dependency_links to setuptools_repro.egg-info\dependency_links.txt
writing top-level names to setuptools_repro.egg-info\top_level.txt
reading manifest file 'setuptools_repro.egg-info\SOURCES.txt'
adding license file 'LICENSE'
writing manifest file 'setuptools_repro.egg-info\SOURCES.txt'
* Building wheel...
running bdist_wheel
running build
installing to build\bdist.win-amd64\wheel
running install
running install_egg_info
running egg_info
writing setuptools_repro.egg-info\PKG-INFO
writing dependency_links to setuptools_repro.egg-info\dependency_links.txt
writing top-level names to setuptools_repro.egg-info\top_level.txt
reading manifest file 'setuptools_repro.egg-info\SOURCES.txt'
adding license file 'LICENSE'
writing manifest file 'setuptools_repro.egg-info\SOURCES.txt'
Copying setuptools_repro.egg-info to build\bdist.win-amd64\wheel\.\setuptools_repro-0-py3.12.egg-info
running install_scripts
creating build\bdist.win-amd64\wheel\setuptools_repro-0.dist-info\WHEEL
creating '[redacted]\dist\.tmp-6in6k3ny\setuptools_repro-0-py3-none-any.whl' and adding 'build\bdist.win-amd64\wheel' to it
adding 'setuptools_repro-0.dist-info/licenses/LICENSE'
adding 'setuptools_repro-0.dist-info/METADATA'
adding 'setuptools_repro-0.dist-info/WHEEL'
adding 'setuptools_repro-0.dist-info/top_level.txt'
adding 'setuptools_repro-0.dist-info/RECORD'
removing build\bdist.win-amd64\wheel
Successfully built setuptools_repro-0.tar.gz and setuptools_repro-0-py3-none-any.whl
> tar -xOf .\dist\setuptools_repro-0.tar.gz setuptools_repro-0/PKG-INFO
Metadata-Version: 2.4
Name: setuptools-repro
Version: 0
License-File: LICENSE
Dynamic: license-file
> tar -xOf .\dist\setuptools_repro-0-py3-none-any.whl setuptools_repro-0.dist-info/METADATA
Metadata-Version: 2.4
Name: setuptools-repro
Version: 0
License-File: LICENSE
Dynamic: license-file

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions