Skip to content

Commit

Permalink
Merge pull request #1096 from woodruffw-forks/ww/fix-integration
Browse files Browse the repository at this point in the history
test_integration: allow PEP 625 sdist name
  • Loading branch information
sigmavirus24 authored Apr 29, 2024
2 parents 48af4c1 + 43ad554 commit 5de10e8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
10 changes: 9 additions & 1 deletion tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,15 @@ def sampleproject_dist(tmp_path_factory: pytest.TempPathFactory):
run([sys.executable, "-m", "build", "--sdist"], cwd=checkout)

[dist, *_] = (checkout / "dist").glob("*")
assert dist.name == f"twine-sampleproject-3.0.0.post{tag}.tar.gz"
# NOTE: newer versions of setuptools (invoked via build) adhere to PEP 625,
# causing the dist name to be `twine_sampleproject` instead of
# `twine-sampleproject`. Both are allowed here for now, but the hyphenated
# version can be removed eventually.
# See: https://github.com/pypa/setuptools/issues/3593
assert dist.name in (
f"twine-sampleproject-3.0.0.post{tag}.tar.gz",
f"twine_sampleproject-3.0.0.post{tag}.tar.gz",
)

return dist

Expand Down
6 changes: 5 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,17 @@ commands =
[testenv:types]
deps =
mypy
lxml
# required for report generation. 5.2.1 is forbidden due to an observed
# broken wheel on CPython 3.8:
# https://bugs.launchpad.net/lxml/+bug/2064158
lxml >= 5.2.0, != 5.2.1
# required for more thorough type declarations
keyring >= 22.3
# consider replacing with `mypy --install-types` when
# https://github.com/python/mypy/issues/10600 is resolved
types-requests
commands =
pip list
mypy --html-report mypy --txt-report mypy {posargs:twine}
python -c 'with open("mypy/index.txt") as f: print(f.read())'

Expand Down

0 comments on commit 5de10e8

Please sign in to comment.