summaryrefslogtreecommitdiffstats
path: root/Lib/packaging/command/sdist.py
diff options
context:
space:
mode:
authorÉric Araujo <merwok@netwok.org>2011-06-06 19:55:43 (GMT)
committerÉric Araujo <merwok@netwok.org>2011-06-06 19:55:43 (GMT)
commit7373fccd50516909574fc67bb92a899963e96ed9 (patch)
treeed0820b1cf1e2d1dca93fc3ea3ca2daa7e1911a8 /Lib/packaging/command/sdist.py
parent078368fe4d9955890bf317481483b56752fb4ad2 (diff)
downloadcpython-7373fccd50516909574fc67bb92a899963e96ed9.zip
cpython-7373fccd50516909574fc67bb92a899963e96ed9.tar.gz
cpython-7373fccd50516909574fc67bb92a899963e96ed9.tar.bz2
Fix sdist to always include setup.cfg (#11092), to comply with the spec
Diffstat (limited to 'Lib/packaging/command/sdist.py')
-rw-r--r--Lib/packaging/command/sdist.py21
1 files changed, 13 insertions, 8 deletions
diff --git a/Lib/packaging/command/sdist.py b/Lib/packaging/command/sdist.py
index a19203f..09b26db 100644
--- a/Lib/packaging/command/sdist.py
+++ b/Lib/packaging/command/sdist.py
@@ -201,15 +201,20 @@ class sdist(Command):
self.filelist.write(self.manifest)
def add_defaults(self):
- """Add all the default files to self.filelist:
- - all pure Python modules mentioned in setup script
- - all files pointed by package_data (build_py)
- - all files defined in data_files.
- - all files defined as scripts.
- - all C sources listed as part of extensions or C libraries
- in the setup script (doesn't catch C headers!)
- Everything is optional.
+ """Add all default files to self.filelist.
+
+ In addition to the setup.cfg file, this will include all files returned
+ by the get_source_files of every registered command. This will find
+ Python modules and packages, data files listed in package_data_,
+ data_files and extra_files, scripts, C sources of extension modules or
+ C libraries (headers are missing).
"""
+ if os.path.exists('setup.cfg'):
+ self.filelist.append('setup.cfg')
+ else:
+ logger.warning("%s: standard 'setup.cfg' file not found",
+ self.get_command_name())
+
for cmd_name in get_command_names():
try:
cmd_obj = self.get_finalized_command(cmd_name)