summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTzu-ping Chung <uranusjr@gmail.com>2019-12-27 16:12:40 +0800
committerJason R. Coombs <jaraco@jaraco.com>2019-12-29 12:47:46 -0500
commit8a7a6272942c84a0cf59169b84f7434ea4dc4bfe (patch)
tree0c664f6a8df293fe3672b74ba1995a8d884499be
parenta5b66a8581b758aff763765857359ef540631202 (diff)
downloadpython-setuptools-git-8a7a6272942c84a0cf59169b84f7434ea4dc4bfe.tar.gz
Add test ensuring pyproject.toml is included during PEP 517 build.
-rw-r--r--setuptools/tests/test_build_meta.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/setuptools/tests/test_build_meta.py b/setuptools/tests/test_build_meta.py
index e1efe561..326b4f5d 100644
--- a/setuptools/tests/test_build_meta.py
+++ b/setuptools/tests/test_build_meta.py
@@ -262,6 +262,27 @@ class TestBuildMetaBackend:
assert os.path.isfile(
os.path.join(os.path.abspath("out_sdist"), sdist_name))
+ def test_build_sdist_pyproject_toml_exists(self, tmpdir_cwd):
+ files = {
+ 'setup.py': DALS("""
+ __import__('setuptools').setup(
+ name='foo',
+ version='0.0.0',
+ py_modules=['hello']
+ )"""),
+ 'hello.py': '',
+ 'pyproject.toml': DALS("""
+ [build-system]
+ requires = ["setuptools", "wheel"]
+ build-backend = "setuptools.build_meta
+ """),
+ }
+ build_files(files)
+ build_backend = self.get_build_backend()
+ targz_path = build_backend.build_sdist("temp")
+ with tarfile.open(os.path.join("temp", targz_path)) as tar:
+ assert any('pyproject.toml' in name for name in tar.getnames())
+
def test_build_sdist_setup_py_exists(self, tmpdir_cwd):
# If build_sdist is called from a script other than setup.py,
# ensure setup.py is included