How to include license file in setup.py script?

前端 未结 5 1804
陌清茗
陌清茗 2021-02-01 14:55

I have written a Python extension module in C++. I plan to distribute the module with setuptools. There will be binary distributions for 32- and 64-bit Windows (built with

5条回答
  •  孤街浪徒
    2021-02-01 15:19

    Write a setup.cfg file and in there specify:

    [metadata]
    license_files = LICENSE.txt
    

    For this to work it seems like wheel is required to be installed. That is:

    pip install wheel
    

    If you have wheel already installed and it doesn't work, try to update it:

    pip install --upgrade wheel
    

    Then when installing the package via pip install the LICENSE file gets included.

提交回复
热议问题