Skip to content

release: verify the published package before announcing it - #185

Merged
villelaitila merged 1 commit into
softagram:mainfrom
villelaitila:release/verify-published-package
Aug 24, 2026
Merged

release: verify the published package before announcing it#185
villelaitila merged 1 commit into
softagram:mainfrom
villelaitila:release/verify-published-package

Conversation

@villelaitila

Copy link
Copy Markdown
Contributor

twine reports success when PyPI accepts the bytes — which says nothing about whether the distribution installs or contains what it claims to. Phase 2 now checks.

What it does. Installs sgraph==<version> from PyPI into a throwaway virtualenv, imports it, and compares the shipped subpackages against those in src/sgraph. Only absence is a defect. Runs between the upload and the GitHub release: it cannot prevent the upload, but it can stop a broken artifact from being announced.

--no-cache-dir is load-bearing, and a test asserts it. The distribution reaches PyPI seconds before this step runs, so a cached index page predates it and resolves the new version to "no such version" — a false report of a failed upload. This actually bit during the 1.13.0 release. The install also retries on a fixed schedule, since PyPI serves an upload before every index replica reflects it.

--skip-verification opts out for an unavailable network.

Validated against the live 1.13.0 release, not only against mocks — success path reports all 8 subpackages, a nonexistent version retries then raises, the skip flag does no network work. 485 tests pass (474 + 11); flake8 on scripts/release.py 15 → 14.

twine reports success when PyPI accepts the bytes. That says nothing about
whether the distribution installs, imports, or contains the subpackages it
claims to -- so a packaging misconfiguration shipped silently and was
discovered by a user rather than by the release that caused it. The release
of 1.13.0 published and announced without ever asking whether what it
published worked.

Phase 2 now installs sgraph==<version> from PyPI into a throwaway virtualenv,
imports it, and compares the subpackages that shipped against those in
src/sgraph. Only absence is a defect: a distribution containing more than the
source tree lists is a question for a human, not grounds for aborting a release
that has already happened.

It runs between the upload and the GitHub release. It cannot prevent the
upload -- nothing can, which is the whole reason the upload asks for
confirmation -- but it can stop a broken artifact from being announced, and the
tag is already public by then, so the earlier position buys nothing.

--no-cache-dir is load-bearing rather than hygienic, and a test asserts it so
it cannot be tidied away by someone who has not seen the failure. The
distribution reaches PyPI seconds before this step runs, so a cached index page
predates it and resolves the new version to "no such version" -- a false report
of a failed upload. This bit during the 1.13.0 release: a clean-venv check
reported "No solution found" until the index was re-fetched. For the same
reason the install retries on a fixed schedule, since PyPI serves an upload
before every index replica reflects it, and failing on the first attempt would
report ordinary propagation lag as a broken release.

--skip-verification exists for an unavailable network and says in its own help
text that it removes the only check that what reached PyPI is usable.

Validated against the live 1.13.0 release rather than only against mocks: the
success path reports all eight subpackages present, a nonexistent version
retries and raises ReleaseError, and the skip flag performs no network work.
The existing ordering test pinned the exact call sequence and was updated
rather than loosened -- that pin is what makes the position of this step a
fact instead of an intention.
@softagram-bot

Copy link
Copy Markdown

Softagram Impact Report for pull/185 (head commit: 0cd0279)

TL;DR Arch. Impact: -10 | Changed code files: 3 | Directly impacted code files: 0

⭐ Change Overview

Showing the changed files, dependency changes and the impact - click for full size
(Open in Softagram Desktop for full details)

⭐ Details of Dependency Changes (diagram)

details of dependency changes - click for full size
(Open in Softagram Desktop for full details)

🤖 AGENTS - machine-readable impact data (3 files changed, 0 impacted, +20/-0 deps)

Change overview

Head 0cd0279e820f vs base a929556cbfc8. 3 code files changed. 0 unchanged files directly depend on the changed files (see Impacted files). Dependencies: 20 added, 0 removed. New external components: 0. Removed external components: 0.

Added dependencies (19)

from to type roles signal
sgraph/scripts/release.py External/PythonLibs/Usual dependencies import prod→external external dependency
sgraph/scripts/release.py External/PythonLibs/tempfile import prod→external external dependency
sgraph/scripts/release.py External/PythonLibs/time import prod→external external dependency
sgraph/tests/test_release_automation.py/TestVerificationOrdering/setup_method External/Python/Usual dependencies import test→external external dependency
sgraph/tests/test_release_automation.py/TestVerifyPublishedPackage/setup_method External/Python/Usual dependencies import test→external external dependency
sgraph/tests/test_release_automation.py/TestVerifyPublishedPackage/test_dry_run_does_no_network_work External/Python/Usual dependencies import test→external external dependency
sgraph/tests/test_release_automation.py/TestVerifyPublishedPackage/test_install_gives_up_and_raises External/PythonLibs/Usual dependencies import_ref test→external external dependency
sgraph/tests/test_release_automation.py/TestVerifyPublishedPackage/test_install_retries_while_pypi_propagates External/PythonLibs/Usual dependencies import_ref test→external external dependency
sgraph/tests/test_release_automation.py/TestVerifyPublishedPackage/test_skip_verification_does_no_network_work External/Python/Usual dependencies import test→external external dependency
sgraph/scripts/release.py/ReleaseAutomation/complete_release sgraph/scripts/release.py/ReleaseAutomation/verify_published_package func_ref prod→prod regular
sgraph/scripts/release.py/ReleaseAutomation/_check_installed_report sgraph/scripts/release.py/ReleaseError/init new prod→prod regular
sgraph/scripts/release.py/ReleaseAutomation/_install_published_package sgraph/scripts/release.py/ReleaseError/init new prod→prod regular
sgraph/scripts/release.py/ReleaseAutomation/_install_published_package sgraph/scripts/release.py/ReleaseAutomation/run_command func_ref prod→prod regular
sgraph/scripts/release.py/ReleaseAutomation/verify_published_package sgraph/scripts/release.py/ReleaseError/init new prod→prod regular
sgraph/scripts/release.py/ReleaseAutomation/verify_published_package sgraph/scripts/release.py/ReleaseAutomation/run_command func_ref prod→prod regular
sgraph/scripts/release.py/ReleaseAutomation/verify_published_package sgraph/scripts/release.py/ReleaseAutomation/_check_installed_report func_ref prod→prod regular
sgraph/scripts/release.py/ReleaseAutomation/verify_published_package sgraph/scripts/release.py/ReleaseAutomation/_install_published_package func_ref prod→prod regular
sgraph/tests/test_release_automation.py/TestVerificationOrdering/setup_method sgraph/tests/test_release_automation.py/TestVerificationOrdering/var automation var_ref test→test regular
sgraph/tests/test_release_automation.py/TestVerifyPublishedPackage/setup_method sgraph/tests/test_release_automation.py/TestVerifyPublishedPackage/var automation var_ref test→test regular

Removed dependencies (0)

None.

Impacted files (0)

None.

Complete data

[]

📄 Full report

Impact Report explained. Give feedback on this report to support@softagram.com

@villelaitila
villelaitila merged commit b7dd46c into softagram:main Aug 24, 2026
1 check passed
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.

2 participants