-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[BUG] Unusually named license_files not included in dist-info #2739
Comments
Agreed that looks like a bug. Thanks for the report. |
@cdce8p Would you be willing to work on a fix? |
@hroncok Thanks for the report, but this isn't a As for the |
I kinda expected that setuptools supports PEP 639 before it is accepted, as a "preview". I understand that the PEP is still a draft. I don't understand what is the point of listing missing files as |
With setup.cfg, it kinda works. However, when the licenses are in nested directories, as listed in the given example: https://wheel.readthedocs.io/en/stable/user_guide.html#including-license-files-in-the-generated-wheel-file
The license files are included directly in the dist-info directory (e.g. as |
If you're referring to the
That is still a point that needs to be addressed. IMO
In that case -- |
Also, what happens if someone names the license file Raise an error if an existing file in dist-info would be overwritten? That'd allow adding better solutions in the future. |
The original problem seems to be already solved with the latest versions of setuptools and wheel: > docker run --rm -it python:3.11 /bin/bash
mkdir /tmp/myproj
cd /tmp/myproj
cat <<EOF > setup.py
from setuptools import setup
setup(
name='myproj',
version='666',
license_files=['DIFFERENT'],
)
EOF
touch DIFFERENT
python -m pip install 'setuptools==66.0.0' 'wheel==0.38.4'
python -c 'import setuptools.build_meta; setuptools.build_meta.__legacy__.prepare_metadata_for_build_wheel(".")'
ls myproj-666.dist-info # => DIFFERENT METADATA top_level.txt
rm -rf myproj-666.dist-info
python -c 'import setuptools.build_meta; setuptools.build_meta.prepare_metadata_for_build_wheel(".")'
ls myproj-666.dist-info # => DIFFERENT METADATA top_level.txt
python -m pip install -U build
python -m build
unzip -l dist/*.whl
# Archive: dist/myproj-666-py3-none-any.whl
# Length Date Time Name
# --------- ---------- ----- ----
# 0 2023-01-20 10:48 myproj-666.dist-info/DIFFERENT
# 73 2023-01-20 10:48 myproj-666.dist-info/METADATA
# 92 2023-01-20 10:48 myproj-666.dist-info/WHEEL
# 1 2023-01-20 10:48 myproj-666.dist-info/top_level.txt
# 367 2023-01-20 10:48 myproj-666.dist-info/RECORD
# --------- -------
# 533 5 files I think that for the problems regarding name clashes and etc we should wait for PEP 639 implementation. |
Seems like we had duplicate licenses from pypa/setuptools#2739 (resolved by changing Cargo.TOML to refer to Apache 2.0 license directly) and issues with the underlying sequence_align._sequence_align import from Maturin updating. Fixed both here and will republish new versions of wheels as the current 0.1.1 ones are DOA. Co-authored-by: Andrew (Drew) Titus <[email protected]>
setuptools version
setuptools===57.4.0
Python version
3.9.6
OS
Fedora Linux 33, x86_64
Additional environment information
Description
I've tried to test out #2645 but including license files not named according to this pattern:
setuptools/setuptools/dist.py
Line 596 in 0c302d2
Are not included in dist info.
Expected behavior
I expected that files explicitly listed in
license_files
will always be listed inMETADATA
underLicense-File:
and will always be included in the dist-info directory regardless of their filename.How to Reproduce
Consider this
setup.py
:And an empty
LICENSE
file.Run:
Or:
Or:
You'll see something like:
The
LICENSE
file will be listed inMETADATA
underLicense-File:
and it will be included in the dist-info directory.Now rename
LICENSE
toDIFFERENT
and adaptlicense_files
accordingly:You'll get:
The
DIFFERENT
file will be listed inMETADATA
underLicense-File:
and it will not be included in the dist-info directory.Output
See above.
Code of Conduct
The text was updated successfully, but these errors were encountered: