aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--setuptools/command/py36compat.py2
-rw-r--r--setuptools/tests/test_sdist.py14
2 files changed, 15 insertions, 1 deletions
diff --git a/setuptools/command/py36compat.py b/setuptools/command/py36compat.py
index 61063e75..c256bfb8 100644
--- a/setuptools/command/py36compat.py
+++ b/setuptools/command/py36compat.py
@@ -76,7 +76,7 @@ class sdist_add_defaults:
self.warn("standard file '%s' not found" % fn)
def _add_defaults_optional(self):
- optional = ['test/test*.py', 'setup.cfg']
+ optional = ['test/test*.py', 'setup.cfg', 'pyproject.toml']
for pattern in optional:
files = filter(os.path.isfile, glob(pattern))
self.filelist.extend(files)
diff --git a/setuptools/tests/test_sdist.py b/setuptools/tests/test_sdist.py
index d2c4e0cf..06813a00 100644
--- a/setuptools/tests/test_sdist.py
+++ b/setuptools/tests/test_sdist.py
@@ -449,6 +449,20 @@ class TestSdistTest:
except UnicodeDecodeError:
filename not in cmd.filelist.files
+ def test_pyproject_toml_in_sdist(self):
+ """
+ Check if pyproject.toml is included in source distribution if present
+ """
+ open(os.path.join(self.temp_dir, 'pyproject.toml'), 'w').close()
+ dist = Distribution(SETUP_ATTRS)
+ dist.script_name = 'setup.py'
+ cmd = sdist(dist)
+ cmd.ensure_finalized()
+ with quiet():
+ cmd.run()
+ manifest = cmd.filelist.files
+ assert 'pyproject.toml' in manifest
+
def test_default_revctrl():
"""