Skip to content

[BUG] Unusually named license_files not included in dist-info #2739

@hroncok

Description

@hroncok

setuptools version

setuptools===57.4.0

Python version

3.9.6

OS

Fedora Linux 33, x86_64

Additional environment information

wheel===0.36.2

Description

I've tried to test out #2645 but including license files not named according to this pattern:

patterns = ('LICEN[CS]E*', 'COPYING*', 'NOTICE*', 'AUTHORS*')

Are not included in dist info.

Expected behavior

I expected that files explicitly listed in license_files will always be listed in METADATA under License-File: and will always be included in the dist-info directory regardless of their filename.

How to Reproduce

Consider this setup.py:

from setuptools import setup

setup(
    name='nested_dist',
    version='666',
    license_files=['LICENSE'],
)

And an empty LICENSE file.

Run:

$ python -c 'import setuptools.build_meta; setuptools.build_meta.__legacy__.prepare_metadata_for_build_wheel(".")'

Or:

$ python setup.py bdist_wheel

Or:

$ pip wheel .

You'll see something like:

running dist_info
...
adding license file 'LICENSE'
...
adding license file "LICENSE" (matched pattern "LICEN[CS]E*")
...

The LICENSE file will be listed in METADATA under License-File: and it will be included in the dist-info directory.

Now rename LICENSE to DIFFERENT and adapt license_files accordingly:

from setuptools import setup

setup(
    name='nested_dist',
    version='666',
    license_files=['DIFFERENT'],
)

You'll get:

...
adding license file 'DIFFERENT'
...

The DIFFERENT file will be listed in METADATA under License-File: and it will not be included in the dist-info directory.

Output

See above.

Code of Conduct

  • I agree to follow the PSF Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions