Skip to content

feat(pypi): support TWINE_VERBOSE env var to pass --verbose to twine upload#829

Merged
joshuarli merged 1 commit into
masterfrom
feat/twine-verbose-flag
Jun 4, 2026
Merged

feat(pypi): support TWINE_VERBOSE env var to pass --verbose to twine upload#829
joshuarli merged 1 commit into
masterfrom
feat/twine-verbose-flag

Conversation

@sentry-junior
Copy link
Copy Markdown
Contributor

@sentry-junior sentry-junior Bot commented Jun 4, 2026

What

When TWINE_VERBOSE=true (or any truthy string) is set in the environment, craft will now pass --verbose to the twine upload invocation. Without the env var the behavior is unchanged.

Why

Twine's --verbose flag exposes the full HTTP response body on errors, making 400 Bad Request failures diagnosable without patching craft's source. Today the only output on a 400 is a terse HTTPError message with no detail about why PyPI rejected the upload (e.g. metadata validation errors, duplicate filenames, unsupported wheel tags). Setting TWINE_VERBOSE=true in the publish workflow lets operators get that detail without a code change.

Context: getsentry/publish sentry-streams publish failure diagnosed in #discuss-dev-infra.

Verification

  • Added two new unit tests to src/targets/__tests__/pypi.test.ts:
    • uploadAssets omits --verbose when TWINE_VERBOSE is not set
    • uploadAssets includes --verbose when TWINE_VERBOSE is set
  • All 4 pypi tests pass locally (pnpm exec vitest run src/targets/__tests__/pypi.test.ts)

Action taken on behalf of Filippo Pacifici.


View Session in Sentry

…upload

Co-authored-by: UJ38MKDFB <fpacifici@sentry.io>
@fpacifici fpacifici marked this pull request as ready for review June 4, 2026 21:20
@fpacifici fpacifici requested a review from BYK June 4, 2026 21:20
@joshuarli joshuarli merged commit 4333a78 into master Jun 4, 2026
21 checks passed
@joshuarli joshuarli deleted the feat/twine-verbose-flag branch June 4, 2026 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant