2

I am building a wheel using python setup.py bdist_wheel Basically setuptools library.

My project contains LICENSE.txt file in root directory of the repository.

Aim:

Properly include this particular license file in the wheel

Relevant Code:

setup(
...,
license_files='LICENSE.txt',
...
)

Error:

warning: Failed to find the configured license file 'L'
warning: Failed to find the configured license file 'C'
warning: Failed to find the configured license file 'N'
warning: Failed to find the configured license file 't
Chaitanya Bapat
  • 3,381
  • 6
  • 34
  • 59
  • 1
    Perhaps this post answers your question: https://stackoverflow.com/questions/9977889/how-to-include-license-file-in-setup-py-script – bicarlsen Jan 07 '21 at 21:49

1 Answers1

2

https://setuptools.readthedocs.io/en/latest/userguide/declarative_config.html#metadata

Setuptools official doc states the datatype of license_file to be "str" and license_files to be list-comma

Solution 1: Use license_file with str

setup(
...,
license_file='LICENSE.txt',
...
)

Solution 2a: Use license_files with comma separated list

setup(
...,
license_file=LICENSE.txt,
...
)

Solution 2b setup.cfg with license_files

I instead created a new file setup.cfg and upgraded my setuptools to allow it to pick up metadata from setup.cfg

[metadata]
license_files = <name-of-license-file>

Thanks to: https://stackoverflow.com/a/48691876/5157515 enter image description here

Chaitanya Bapat
  • 3,381
  • 6
  • 34
  • 59
  • 3
    `license_file` should indeed be a string, but you are using `license_files` in your question. This should be a list of strings, thus the error. – hoefling Jan 09 '21 at 16:05
  • Using `license_file` as a `setup` argument will fail with message: `UserWarning: Unknown distribution option: 'license_file'`. `license_files` is ok. – EvgenKo423 Mar 02 '21 at 15:14