setuptools icon indicating copy to clipboard operation
setuptools copied to clipboard

SOURCES.txt should be regenerated on every use

Open ghost opened this issue 11 years ago • 3 comments

Originally reported by: jurko (Bitbucket: jurko, GitHub: jurko)


I think the SOURCES.txt project manifest file should be regenerated on every use.

Older distutils versions, e.g. those from early 2.7.x or 3.1 Python releases, have bugs with how they generate the project's manifest file from its MANIFEST.in template (see CPython issue http://bugs.python.org/issue6884) which may cause the manifest to contain some extra entries.

This can cause problems because if you use an older Python versions to generate the SOURCES.txt, and later run a setup.py sdist operation using a later Python version (e.g. 3.4), your generated sdist will end up containing those extra entries. On the other hand, if you delete the old SOURCES.txt manifest and just let the new Python version regenerate it - the project's sdist will again contain the correct files.

Setuptools documentation already states:

#!text
The file is automatically generated by setuptools whenever the
egg_info or sdist commands are run, and it is not user-editable.

Hope this helps.

Best regards, Jurko Gospodnetić


  • Bitbucket: https://bitbucket.org/pypa/setuptools/issue/211

ghost avatar May 29 '14 08:05 ghost

Original comment by jurko (Bitbucket: jurko, GitHub: jurko):


In the project where I ran into this problem, I worked around the issue by adding some prune statements to MANIFEST.in to make sure the extra entries get removed even if the Python bug adds them, and added some dummy folders to the project to make sure they always exist so my clean installs do not constantly output warnings on about nothing being found to prune.

Best regards, Jurko Gospodnetić

ghost avatar May 29 '14 08:05 ghost

Related: #436

htgoebel avatar Jul 30 '25 19:07 htgoebel

According to the the history for version 0.6a9, .egg-info/SOURCES.txt "is rebuilt every time the egg_info command is run." And this is the only occurrence of SOURCES.txt in the Changelog.

htgoebel avatar Jul 30 '25 19:07 htgoebel