This article does not aim to cover best practices for Python project development as a whole. For example, it does not provide guidance or tool recommendations for version control, documentation, or testing. This is more about showing how to include license file in setup.py when you plan to distribute with license.
Example: Assume I’m planning to license the xyz module under the BSD license. In my source tree, the file LICENSE.txt is in the top folder along with setup.py.
Fix: Write a setup.cfg file and in there specify:
For this to work it seems like wheel is required to be installed. That is:
If you have wheel already installed and it doesn't work, try to update it:
Then when installing the package via pip install <path> the LICENSE file gets included.
Fix: Write a setup.cfg file and in there specify:
[metadata]
license_files = LICENSE.txt{codeBox}
For this to work it seems like wheel is required to be installed. That is:
pip install wheel{codeBox}
If you have wheel already installed and it doesn't work, try to update it:
pip install --upgrade wheel{codeBox}
Then when installing the package via pip install <path> the LICENSE file gets included.
0 Comments