You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[build-system]
requires = ["setuptools >= 78.1.0"]
build-backend = "setuptools.build_meta"
[project]
name = "repro"
version = "0.1"
license-files = ["BadLicense.*"]
Now I have two files BadLicense.doc and BadLicense.pdf in my project directory.
Setuptools copies both files into the dist-info/licenses directory, without warning or error.
This also happens, if a pyproject.toml has no 'license-files' declared and the default regexp patterns are applied, so you might even end up to include 'license.py', 'license.exe' or similar files that are clearly not text files.
Expected behavior
This should result in an error.
PEP639 clearly states, that the license files MUST be UTF-8 encoded. This is obviously not the case for a binary Word doc file and probably not for a PDF. So i would expect setuptools validate this and to raise an Exception if it is not a valid UTF-8 encoded text file.
Tools MUST assume that license file content is valid UTF-8 encoded text, and SHOULD validate this and raise an error if it is not.
How to Reproduce
mkdir repro
Unpack pyproject.zip into the folder
cd repro
python -m venv .venv
./venv/Scripts/pip install -e .
dir ..venv\Lib\site-packages\repro-0.1.dist-info\licenses\
setuptools version
78.1.0
Python version
3.11
OS
Windows
Additional environment information
No response
Description
Using a pyproject.toml like this:
Now I have two files
BadLicense.doc
andBadLicense.pdf
in my project directory.Setuptools copies both files into the dist-info/licenses directory, without warning or error.
This also happens, if a pyproject.toml has no 'license-files' declared and the default regexp patterns are applied, so you might even end up to include 'license.py', 'license.exe' or similar files that are clearly not text files.
Expected behavior
This should result in an error.
PEP639 clearly states, that the license files MUST be UTF-8 encoded. This is obviously not the case for a binary Word doc file and probably not for a PDF. So i would expect setuptools validate this and to raise an Exception if it is not a valid UTF-8 encoded text file.
How to Reproduce
pyproject.zip
Output
The text was updated successfully, but these errors were encountered: