Repository navigation
Conversation
| self.warn("standard file '%s' not found" % fn) | ||
|
|
||
| def _add_defaults_optional(self): | ||
| optional = ['test/test*.py', 'setup.cfg'] |
There was a problem hiding this comment.
Unfortunately, it's not allowed to make changes to distutils here. If you wish to make changes to distutils, they need to happen in the pypa/distutils project.
| """Add all the default files to self.filelist: | ||
| - README or README.txt | ||
| - setup.py | ||
| - test/test*.py |
There was a problem hiding this comment.
There's a docstring in this code saying not to change this code.
|
Probably this issue requires more discussion. It's intertwined with the effort to adopt distutils and the copy of distutils functionality in the compat module. Making this change will add more divergence between distutils implementations. I'm inclined to say it would be best to wait for this change until setuptools owns distutils, at which time fine-tuning such a list would be more straightforward. I do agree with you, the default of 'test' versus 'tests' violates my expectations, but this shift in expectations happened in spite of 'test' being included as a default for a very long time. Perhaps the better approach here would be to just remove all special files and simply require the user to use setuptools_scm or maintain a manifest of all the sources. After all, fixing this change still doesn't help users who have a The recommended usage here is for the packager to use Since neither of these code bases are meant to be changed here, I'm going to decline the PR. Thanks anyhow for the effort. |
Summary of changes
By default, all files matching the pattern test/test*.py (not tests/test*.py) are included in the source distribution (sdist). This is documented in Python Packaging User Guide's "Including files in source distributions with MANIFEST.in" page.
But, both pypa/sampleproject and Python Packaging User Guide's "Packaging Python Projects" page suggest the unit test folder be named
tests.I opened the issue pypa/sampleproject#133, it looks clear that
testsis a more common name thantest, and it may avoid conflicting with the test standard library module according to some.Therefore, I request to add "tests/test*.py" to sdist default inclusion list. And "test/test*.py" should be kept for compatibility with old repos.
Pull Request Checklist
changelog.d/