diff options
author | Shashank Singh <shashanksingh28@gmail.com> | 2019-04-20 23:24:41 -0400 |
---|---|---|
committer | Paul Ganssle <paul@ganssle.io> | 2019-04-22 10:19:28 -0400 |
commit | 901f7cc2a036bfeb93bfbe480608e04c76c2c5ec (patch) | |
tree | 0962d11daf503ab65ecdce1f4c400768d1efebaa /setuptools/tests/test_build_meta.py | |
parent | ab79268c792ce2a5f0ccaed65dd0bc668fbbdba3 (diff) | |
download | external_python_setuptools-901f7cc2a036bfeb93bfbe480608e04c76c2c5ec.tar.gz external_python_setuptools-901f7cc2a036bfeb93bfbe480608e04c76c2c5ec.tar.bz2 external_python_setuptools-901f7cc2a036bfeb93bfbe480608e04c76c2c5ec.zip |
Fix error when wheels already exist in dist/
`build_meta.build_wheel` assumes that the only wheel in its output
directory is the one it builds, but prior to this, it also used the
`dist/` folder as its working output directory. This commit uses a
temporary directory instead, preventing an error that was triggered when
previously-generated wheel files were still sitting in `dist/`.
Fixes GH #1671
Diffstat (limited to 'setuptools/tests/test_build_meta.py')
-rw-r--r-- | setuptools/tests/test_build_meta.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/setuptools/tests/test_build_meta.py b/setuptools/tests/test_build_meta.py index 90400afc..88e29ffe 100644 --- a/setuptools/tests/test_build_meta.py +++ b/setuptools/tests/test_build_meta.py @@ -157,7 +157,6 @@ class TestBuildMetaBackend: assert os.path.isfile(os.path.join(dist_dir, wheel_name)) - @pytest.mark.xfail(reason="Known error, see GH #1671") def test_build_wheel_with_existing_wheel_file_present(self, tmpdir_cwd): # Building a wheel should still succeed if there's already a wheel # in the wheel directory @@ -195,6 +194,12 @@ class TestBuildMetaBackend: assert os.path.isfile(os.path.join(dist_dir, wheel_one)) assert wheel_one != wheel_two + # and if rebuilding the same wheel? + open(os.path.join(dist_dir, wheel_two), 'w').close() + wheel_three = self.get_build_backend().build_wheel(dist_dir) + assert wheel_three == wheel_two + assert os.path.getsize(os.path.join(dist_dir, wheel_three)) > 0 + def test_build_sdist(self, build_backend): dist_dir = os.path.abspath('pip-sdist') os.makedirs(dist_dir) |