aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2019-01-03 08:06:58 -0500
committerGitHub <noreply@github.com>2019-01-03 08:06:58 -0500
commit572fb158a4077d779488cd3c81e6d47028322396 (patch)
treec93d5dbaeda7ac464e9cf414df568f6a2b374735
parentfeea356de2466f169b5a025d7e6266b83b252424 (diff)
parentd56ed68dcdb321df635a2c3a698c5026b7feadcc (diff)
downloadexternal_python_setuptools-572fb158a4077d779488cd3c81e6d47028322396.tar.gz
external_python_setuptools-572fb158a4077d779488cd3c81e6d47028322396.tar.bz2
external_python_setuptools-572fb158a4077d779488cd3c81e6d47028322396.zip
Merge pull request #1625 from pypa/bugfix/1623-always-targz
In build_meta (PEP 517), always built gztar
-rw-r--r--changelog.d/1625.change.rst1
-rw-r--r--setuptools/build_meta.py2
-rw-r--r--setuptools/tests/test_build_meta.py19
3 files changed, 21 insertions, 1 deletions
diff --git a/changelog.d/1625.change.rst b/changelog.d/1625.change.rst
new file mode 100644
index 00000000..9125ac0c
--- /dev/null
+++ b/changelog.d/1625.change.rst
@@ -0,0 +1 @@
+In PEP 517 build_meta builder, ensure that sdists are built as gztar per the spec.
diff --git a/setuptools/build_meta.py b/setuptools/build_meta.py
index 02de4427..c883d92f 100644
--- a/setuptools/build_meta.py
+++ b/setuptools/build_meta.py
@@ -175,7 +175,7 @@ def build_wheel(wheel_directory, config_settings=None,
def build_sdist(sdist_directory, config_settings=None):
config_settings = _fix_config(config_settings)
sdist_directory = os.path.abspath(sdist_directory)
- sys.argv = sys.argv[:1] + ['sdist'] + \
+ sys.argv = sys.argv[:1] + ['sdist', '--formats', 'gztar'] + \
config_settings["--global-option"] + \
["--dist-dir", sdist_directory]
_run_setup()
diff --git a/setuptools/tests/test_build_meta.py b/setuptools/tests/test_build_meta.py
index a472d3eb..82b44c89 100644
--- a/setuptools/tests/test_build_meta.py
+++ b/setuptools/tests/test_build_meta.py
@@ -217,3 +217,22 @@ def test_build_sdist_setup_py_manifest_excluded(tmpdir_cwd):
targz_path = build_sdist("temp")
with tarfile.open(os.path.join("temp", targz_path)) as tar:
assert not any('setup.py' in name for name in tar.getnames())
+
+
+def test_build_sdist_builds_targz_even_if_zip_indicated(tmpdir_cwd):
+ files = {
+ 'setup.py': DALS("""
+ __import__('setuptools').setup(
+ name='foo',
+ version='0.0.0',
+ py_modules=['hello']
+ )"""),
+ 'hello.py': '',
+ 'setup.cfg': DALS("""
+ [sdist]
+ formats=zip
+ """)
+ }
+
+ build_files(files)
+ build_sdist("temp")