ppannuto / python-titlecase

Python library to capitalize strings as specified by the New York Times Manual of Style
MIT License
254 stars 38 forks source link

Add Manifest.in and include license file in source distribution #71

Closed synapticarbors closed 4 years ago

synapticarbors commented 4 years ago

It would be helpful to include the license file in the source distribution

coveralls commented 4 years ago

Coverage Status

Coverage remained the same at 81.773% when pulling 6995ae07f7bcf2d5140b169ef0c3b691a4d4138b on synapticarbors:patch-1 into ad696e62ed3ccdd11b4f02716a4f36581ce513f9 on ppannuto:main.

ppannuto commented 4 years ago

Is it really that necessary / useful to add a new file to the root with a single line in it?

Python has a standard for license management, it's the license key in setup.py, and MIT is a valid SPDX identifier. My instinct is that this is just bloat/cruft, but if there's a compelling reason to add it I suppose I don't really care that much either way.

synapticarbors commented 4 years ago

It is indeed a single file with a single line, but it serves a functional purpose in that it tells the packaging process to include the license file in the source distribution so that it's in the tarball on pypi. Specifying the license in the setup.py as you mentioned only provides metadata about what the license is, but doesn't actually distribute the license. There are several ways to do this, but using a MANIFEST.in is the currently suggested way https://packaging.python.org/guides/using-manifest-in/#using-manifest-in. Other ways include adding a setup.cfg.

I submitted this PR since your package was recently packaged for conda-forge, and there we try to make sure that the license file is included in the source that we distribute to keep with the terms of the license. In the case of the MIT, it states:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.