Conversation
radoering
reviewed
Sep 27, 2026
| ) | ||
| assert len(build_artifacts) > 0 | ||
| assert all(archive.exists() for archive in build_artifacts) | ||
| assert {archive.suffix for archive in build_artifacts} == expected_suffixes |
Member
There was a problem hiding this comment.
We should use splitext from poetry-core to check the complete suffix.
Author
There was a problem hiding this comment.
Done — thanks for the pointer. I switched the assertion to the complete suffix via splitext from poetry.core.packages.utils.utils:
- assert {archive.suffix for archive in build_artifacts} == expected_suffixes
+ assert {splitext(archive)[1] for archive in build_artifacts} == expected_suffixesand the expectations now name the full suffixes (.tar.gz for sdist, .whl for wheel, both for all). That closes the gap Path.suffix left open: a sdist named foo-1.0.tar.gz was only being checked as .gz.
Rebased on main (3ea141d) and re-ran:
pytest tests/console/commands/test_build.py -q -n0 -p no:randomly→ 32 passedmypy tests/console/commands/test_build.py→ cleanpre-commit run --files tests/console/commands/test_build.py→ passed
Disclosure: this change was prepared with an AI coding assistant (DeepSeek) under my direction; I reviewed the diff and the commands above before pushing.
Use splitext() from poetry-core to assert the complete suffix so that a sdist is checked as .tar.gz instead of just .gz.
kokokoXUY
force-pushed
the
test/build-format-artifacts
branch
from
October 5, 2026 05:45
8dd70d2 to
0c3f5dc
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Relates-to: #3155
The existing
poetry build --formattest checks only that at least one artifact exists forsdist,wheel, andall. It would still pass if a single-format build produced an unwanted extra artifact. This test-only change checks the exact artifact suffixes and counts for each format.Validation on Windows with Python 3.12.7:
pytest tests/console/commands/test_build.py -q -o addopts=: 32 passed.mypy tests/console/commands/test_build.py: passed.pre-commit run --files tests/console/commands/test_build.py: passed.git diff --check: passed.Pull Request Check List
Disclosure: this change was prepared with an AI coding assistant (DeepSeek) under my direction; I reviewed the diff and the commands above before pushing.