Repository navigation
Conversation
The 0.8.3 wheel and sdist both contain wcwidth/textwrap.py,cover, a 31KB 'coverage annotate' file left over in the package directory: the sdist's "/wcwidth/**" include and the wheel's automatic package discovery both sweep it up, and .gitignore has no pattern for it. Add "*,cover" to .gitignore and to a [tool.hatch.build] exclude covering both targets, and assert in the twine_check env that no packaged path contains a comma -- this project has no such file, and a comma must be CSV-quoted in the wheel's RECORD, which trips installers that parse that file by splitting on commas rather than as CSV. Co-Authored-By: Claude Opus 5 <[email protected]>
Owner
|
I apologize @DrAhmetK for this coverage filename troubling your day, thanks for taking the time to report it. The next release of wcwidth will include your
Indeed it is, I build and publish this package on my personal computer, and I also develop and troubleshoot the library there, and often right before release. |
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.
The 0.8.3 wheel and sdist both ship
wcwidth/textwrap.py,cover— a 31,107-bytecoverage annotateoutput file. It's the only comma-containing path in eitherartifact, and it isn't an importable module, so it's 31KB of dead weight in
every install.
Its first lines are the
coverage annotategutter:How it gets in
[tool.hatch.build.targets.sdist].includehas"/wcwidth/**", and there's nowheel target section, so the whole package directory is auto-included. Either
way, an untracked file sitting in
wcwidth/is picked up.tox.ininever runscoverage annotate, so this looks like a leftover from a manual run rather thananything the build does.
.gitignorehas.coverageandhtmlcovbut nopattern matching
*,cover, so such a file sits in a working tree unnoticed.Secondary effect: RECORD parsing
Because the name contains a comma, its
RECORDline is CSV-quoted, unlike everyother line:
That's valid RFC 4180 / PEP 376 and
csv.readerhandles it correctly — thewheel is not malformed. But an installer that reads
RECORDwithline.split(",")[0]instead of a CSV parser gets"wcwidth/textwrap.py— leadingquote included, truncated at the comma — and then fails its own
files-exist check. I hit this on a platform whose Python executor does exactly
that; it aborts with
wheel RECORD lists files missing on disk: "wcwidth/textwrap.py. That's a bug in that parser and I'm not asking you to workaround it. It just happens that the stray file is the only thing that triggers
it, so dropping the file fixes the symptom for every such consumer at once.
The change
.gitignore: add*,cover.pyproject.toml: a[tool.hatch.build] exclude = ["*,cover"]. Placed at theshared level so it covers the wheel as well as the sdist, which avoids adding
a
[tool.hatch.build.targets.wheel]section just for this.tox.ini: thetwine_checkenv already builds both distributions, so it alsoasserts no packaged path contains a comma.
Either of the first two alone is sufficient — hatchling does honor the
repository's own
.gitignore. Both are here because the include list isexplicit about what ships, and the comment above it already notes that ignore
rules aren't wholly reliable here.
Verification
Building
masterwith the file restored intowcwidth/reproduces the releaseexactly; the file list of the wheel I get matches the published 0.8.3 wheel
entry for entry.
Full before/after diff of the packaged file lists, both distributions:
Nothing else changes. The wheel goes from 53 to 52 entries; all 30
wcwidth/table_*.py, all 19table_grapheme_overrides/_known_*, and all 47.pyfiles are still present in both. The wheel'sRECORDgoes from oneCSV-quoted line to none.
The guard was checked in both directions with the project's own tooling:
Worth noting
twine check --strictpasses in both cases — it doesn't look atpackaged paths, so the existing check wouldn't have caught this.
tox -e py314(1364 passed, 10 skipped) andtox -e lintare green. No Pythonsource is touched.
Notes
tox.inipart if you'd rather keeptwine_checkscoped toREADME/metadata rendering, or move it to its own env — the two-line packaging
fix stands on its own.
docs/intro.rstHistory entry since 0.8.3 is already releasedand there's no unreleased heading; glad to add one under whatever version you
intend next.
🤖 Generated with Claude Code