On 04/21/2016 04:10 PM, Edward Betts wrote: > Recently I've come across some Python libraries that have a test suite in > their github repo but don't include it in the tarball they upload to pypi. > > Debian binary packages don't normally include the test suite.
Why? It's my view that it's a good idea to include it, if it is located within the lib itself. > Some Python > library developers are treating the pypi releases in a similar way, as if > they're just for deployment. They think anybody who needs the test suite is > doing development and will clone from the github repo. > > It is very useful to run the test suite when building a Debian package. It > would be better if upstream would include the test suite in their release > tarballs. > > It is often just a one line change to MANIFEST.in to have the test suite > included. If the tests are in a directory called 'tests', then this is the > line that needs to added: > > recursive-include tests *.py It's best that the test suite goes within the project. So if project is called foo, then best is to get the test folder in foo/tests. This way, you don't even need to fix the MANIFEST.in. Then you can even use it as an autopkgtest thing. > I've been sending github pull requests to encourage library authors to make > this change. > > https://github.com/RPi-Distro/python-gpiozero/pull/284 > https://github.com/john-kurkowski/tldextract/pull/97 > > You might want to take a few minutes to check any Python packages you've > worked on, see if there is a test suite in the github repo that hasn't made it > to the release tarball and send a pull request to fix it. IMO, don't bother, and just re-generate a tarball from git, using "git archive", which is my preferred way to use upstream sources. Cheers, Thomas Goirand (zigo)