Skip to content

test_integration: allow PEP 625 sdist name #1096

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading