Skip to content

Commit

Permalink
Merge pull request #1726 from florisla/issue-1671-test
Browse files Browse the repository at this point in the history
Add failing test for issue #1671 (ValueError when .whl is present)
  • Loading branch information
mergify[bot] authored Apr 21, 2019
2 parents 7be2d14 + 869c634 commit ab79268
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions setuptools/tests/test_build_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,44 @@ def test_build_wheel(self, build_backend):

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)
Expand Down

0 comments on commit ab79268

Please sign in to comment.