diff options
| author | Floris Lambrechts <florisla@gmail.com> | 2019-03-26 09:08:33 +0100 |
|---|---|---|
| committer | Paul Ganssle <paul@ganssle.io> | 2019-04-20 20:16:55 -0400 |
| commit | 869c634880f24b918ca074588b625b9dce2038b2 (patch) | |
| tree | 754e51531eea7b0623165fe0ba2702b44fe5fc72 /setuptools | |
| parent | 7be2d14dcd669d6010621a8e5db23763a63cf55e (diff) | |
| download | external_python_setuptools-869c634880f24b918ca074588b625b9dce2038b2.tar.gz external_python_setuptools-869c634880f24b918ca074588b625b9dce2038b2.tar.bz2 external_python_setuptools-869c634880f24b918ca074588b625b9dce2038b2.zip | |
Add test for pre-existing wheels in build_meta
Currently, this will fail because setuptools.build_meta.build_wheel
assumes that no wheels already exist in the `dist/` directory.
See GH #1671
Diffstat (limited to 'setuptools')
| -rw-r--r-- | setuptools/tests/test_build_meta.py | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/setuptools/tests/test_build_meta.py b/setuptools/tests/test_build_meta.py index 0bdea2d6..90400afc 100644 --- a/setuptools/tests/test_build_meta.py +++ b/setuptools/tests/test_build_meta.py @@ -157,6 +157,44 @@ 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 + files = { + 'setup.py': "from setuptools import setup\nsetup()", + 'VERSION': "0.0.1", + 'setup.cfg': DALS(""" + [metadata] + name = foo + version = file: VERSION + """), + 'pyproject.toml': DALS(""" + [build-system] + requires = ["setuptools", "wheel"] + build-backend = "setuptools.build_meta + """), + } + + build_files(files) + + dist_dir = os.path.abspath('pip-wheel-preexisting') + os.makedirs(dist_dir) + + # make first wheel + build_backend = self.get_build_backend() + wheel_one = build_backend.build_wheel(dist_dir) + + # change version + with open("VERSION", "wt") as version_file: + version_file.write("0.0.2") + + # make *second* wheel + wheel_two = self.get_build_backend().build_wheel(dist_dir) + + assert os.path.isfile(os.path.join(dist_dir, wheel_one)) + assert wheel_one != wheel_two + def test_build_sdist(self, build_backend): dist_dir = os.path.abspath('pip-sdist') os.makedirs(dist_dir) |
