Skip to content

Add a script that releases to PyPI from a Docker container - #5

Merged
saevarom merged 2 commits into
mainfrom
docker-release
Oct 14, 2026
Merged

saevarom merged 2 commits into
mainfrom
docker-release

Conversation

@saevarom

@saevarom saevarom commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

What

docker-release.sh builds the package and uploads it to PyPI from a clean python:3.12-slim container, so releasing doesn't depend on the Python install on the releasing machine. It runs the existing build.sh and release.sh unchanged.

  • The repo is mounted read-only and copied inside the container. The build runs on a clean copy and leaves no root-owned build/ or dist/ files in the checkout.
  • PyPI credentials come from ~/.pypirc (mounted read-only) or the TWINE_USERNAME / TWINE_PASSWORD environment variables. When run from a terminal, twine can still ask for credentials.
  • It refuses to run with uncommitted changes to tracked files, so what's uploaded matches a commit.

The README gets a short "Releasing" section.

This PR also adds the 0.1.26 release notes, covering the payment_changed fix from #4 and this script. They missed #4 because it was merged before they were pushed.

Testing

Tested in a throwaway local clone, with the upload line in release.sh replaced by an echo and no ~/.pypirc available:

  • It built django_askell-0.1.25 (wheel and sdist) in the container, twine check passed for both, and it reached the upload step.
  • The checkout had no build/ or dist/ afterwards.
  • With an uncommitted change to setup.py it stopped with an error and exit code 1.

The real upload hasn't been run.

🤖 Generated with Claude Code

saevarom and others added 2 commits October 14, 2026 14:31
docker-release.sh runs build.sh and release.sh in a clean python:3.12-slim
container, so releasing doesn't depend on the local Python install. The
source is mounted read-only and copied, and PyPI credentials come from
~/.pypirc or TWINE_USERNAME / TWINE_PASSWORD. It refuses to run with
uncommitted changes, so what's uploaded matches a commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@saevarom
saevarom merged commit c29c289 into main Oct 14, 2026
2 checks passed
@saevarom
saevarom deleted the docker-release branch October 14, 2026 14: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