The Python Packaging Authority recommends placing the tests folder outside the main package, on the root level of the repository. This way the tests are not shipped with the distribution, which are normally not needed for normal installs.
There is an open discussion on what the recommended default should be, because there are pro's and con's for each.
That being said, it is typically a good idea to not have the tests installed in the site-packages, which currently is being done. This can cause problems, for example as is the case for the build of the Conda distribution: https://github.com/conda-forge/circus-feedstock/pull/26
What happens there is that it will import all Python packages in the distribution (including circus.tests) but that includes an import papa statement. However, this is only part of the test extra requirements and not of the main installation requirements, and so an ImportError is hit.
The Python Packaging Authority recommends placing the
tests
folder outside the main package, on the root level of the repository. This way the tests are not shipped with the distribution, which are normally not needed for normal installs.There is an open discussion on what the recommended default should be, because there are pro's and con's for each.
That being said, it is typically a good idea to not have the tests installed in the site-packages, which currently is being done. This can cause problems, for example as is the case for the build of the Conda distribution: https://github.com/conda-forge/circus-feedstock/pull/26 What happens there is that it will import all Python packages in the distribution (including
circus.tests
) but that includes animport papa
statement. However, this is only part of thetest
extra requirements and not of the main installation requirements, and so anImportError
is hit.