You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Should tests live in directory test or tests? The guide seems inconsistent to me, but I'm new to contemporary Python packaging, so I may have missed something.
I think you're right, using the plural tests/ is more common. The name is not restricted programmatically, but it is nicer to have a unified convention. So far, I've only seen one project using a singular test/ folder, but they are moving toward tests/ where possible, too.
This convention can be discovered by people looking at existing projects. Build backend config is another thing entirely (setuptools defaults, include all files, explicit list…), we don’t want to duplicate their doc.
Activity
webknjaz commentedon Nov 19, 2022
I think you're right, using the plural
tests/is more common. The name is not restricted programmatically, but it is nicer to have a unified convention. So far, I've only seen one project using a singulartest/folder, but they are moving towardtests/where possible, too.DimitriPapadopoulos commentedon Nov 20, 2022
The name has to be matched/restricted at some point:
I cannot find the relevant code in the pypa repositories, as I don't know which package would do the matching.
The pypa repositories seem to be commonly using
test/.DimitriPapadopoulos commentedon Nov 20, 2022
I think I have found the relevant source code in setuptools:
setuptools/_distutils/command/sdist.py
Lines 295 to 296 in 59ee498
copied over from distutils:
distutils/command/sdist.py
Lines 295 to 296 in e0787fa
DimitriPapadopoulos commentedon Nov 20, 2022
I have created pypa/distutils#187 to investigate directly in distutils.
merwok commentedon Aug 6, 2026
Not sure the guide should be changed here.
This convention can be discovered by people looking at existing projects. Build backend config is another thing entirely (setuptools defaults, include all files, explicit list…), we don’t want to duplicate their doc.
rgommers commentedon Nov 11, 2026
I agree with @merwok, I suggest we close this issue.
merwok commentedon Nov 11, 2026
The inconsistency is gone as the guide about manifest.in is removed.
Note that setuptools was changed to also include
tests/test*.pyby default.