Commit 572fb158 authored by Jason R. Coombs's avatar Jason R. Coombs Committed by GitHub

Merge pull request #1625 from pypa/bugfix/1623-always-targz

In build_meta (PEP 517), always built gztar
parents feea356d d56ed68d
In PEP 517 build_meta builder, ensure that sdists are built as gztar per the spec.
...@@ -175,7 +175,7 @@ def build_wheel(wheel_directory, config_settings=None, ...@@ -175,7 +175,7 @@ def build_wheel(wheel_directory, config_settings=None,
def build_sdist(sdist_directory, config_settings=None): def build_sdist(sdist_directory, config_settings=None):
config_settings = _fix_config(config_settings) config_settings = _fix_config(config_settings)
sdist_directory = os.path.abspath(sdist_directory) 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"] + \ config_settings["--global-option"] + \
["--dist-dir", sdist_directory] ["--dist-dir", sdist_directory]
_run_setup() _run_setup()
......
...@@ -217,3 +217,22 @@ def test_build_sdist_setup_py_manifest_excluded(tmpdir_cwd): ...@@ -217,3 +217,22 @@ def test_build_sdist_setup_py_manifest_excluded(tmpdir_cwd):
targz_path = build_sdist("temp") targz_path = build_sdist("temp")
with tarfile.open(os.path.join("temp", targz_path)) as tar: with tarfile.open(os.path.join("temp", targz_path)) as tar:
assert not any('setup.py' in name for name in tar.getnames()) 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")
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment