Repository navigation
build(packaging): publish DicoGIS on PyPI - #521
Merged
Merged
Conversation
`license = "Apache-2.0"` is a PEP 639 SPDX expression, only understood by setuptools >= 77, while the build requirement allowed >= 64: a build without isolation (`python -m build --no-isolation`, as the manual release procedure used to do) with an older setuptools fails with a configuration error on `project.license`. AI-Level: 8 (bots planned, human approved) AI-Model: claude-sonnet-5-5 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
setuptools-scm isn't configured (no `[tool.setuptools_scm]`, the version is single-sourced from `dicogis/__about__.py`) but, installed in the build environment, it still acts as a file finder: the sdist embedded every git-tracked file (documentation images, tests, CI configuration…) and weighed 11 MB instead of 0.5 MB, and the wheel shipped the `.ts` translation sources that `package-data` deliberately leaves out. AI-Level: 8 (bots planned, human approved) AI-Model: claude-sonnet-5-5 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Fails when a `.ui` or `.qm` file isn't covered by `[tool.setuptools.package-data]`, when a pattern matches nothing, or when the build requirements can't handle the SPDX license expression. AI-Level: 8 (bots planned, human approved) AI-Model: claude-sonnet-5-5 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
New `pypi_publisher.yml` workflow: builds the sdist and the wheel, runs `twine check --strict`, refuses a tag that doesn't match the package version, then publishes from the `pypi` environment through OIDC (no API token). Run manually, or from a pull request touching the packaging files, it builds and checks without publishing. AI-Level: 8 (bots planned, human approved) AI-Model: claude-sonnet-5-5 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Describe the automated publication and the one-time pending publisher setup, fix the manual fallback (no editable install nor `--no-isolation` needed, add the `twine check` step) and note the packaging rules in CLAUDE.md. AI-Level: 8 (bots planned, human approved) AI-Model: claude-sonnet-5-5 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ease Add a `build-python-package` job to the build and release workflow, as done in QDT: it builds the sdist and the wheel, runs `twine check --strict` and, on a tag, refuses a tag that doesn't match the package version. The distributions are attached to the GitHub release along with the executables, and rebuilt on pull requests touching `pyproject.toml` or `MANIFEST.in`. AI-Level: 8 (bots planned, human approved) AI-Model: claude-sonnet-5-5 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HATwPxs2xpwnubZPvpGzBh
Add the `release-pypi` job, as done in QDT: on a tag, it uploads the distributions built by `build-python-package` from the `pypi` environment through Trusted Publishing (no API token). It replaces the standalone `pypi_publisher.yml` workflow, removed here, so that the executables, the GitHub release and the PyPI package come from a single workflow. AI-Level: 8 (bots planned, human approved) AI-Model: claude-sonnet-5-5 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HATwPxs2xpwnubZPvpGzBh
… workflow The package is now built, attached to the GitHub release and published to PyPI by `builder_releaser.yml`: update the release procedure, the workflow name to give to the PyPI pending publisher, and the packaging notes in CLAUDE.md. AI-Level: 8 (bots planned, human approved) AI-Model: claude-sonnet-5-5 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HATwPxs2xpwnubZPvpGzBh
Guts
force-pushed
the
packaging/publish-to-pypi
branch
from
November 6, 2026 09:08
39242d6 to
7dddb36
Compare
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #521 +/- ##
=======================================
Coverage 78.23% 78.23%
=======================================
Files 54 54
Lines 3469 3469
Branches 435 435
=======================================
Hits 2714 2714
Misses 633 633
Partials 122 122
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
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.

Description
Makes DicoGIS publishable on PyPI, so that
pip install dicogis/pipx install dicogis(already documented in the installation guide) can work.build: requiresetuptools>=77.license = "Apache-2.0"is a PEP 639 SPDX expression, which older setuptools reject (reproduced with setuptools 76.1 and--no-isolation).build: drop the unusedsetuptools-scmbuild requirement. It isn't configured, but as a build-time file finder it made the sdist embed every git-tracked file (11 MB instead of 0.5 MB) and the wheel ship the.tstranslation sources, whichpackage-datadeliberately leaves out.test: newtests/test_packaging.pychecking that every.ui/.qmfile is covered by[tool.setuptools.package-data], that no pattern matches nothing, and that the setuptools floor supports the SPDX license.ci: the build and release workflow (builder_releaser.yml) now also handles the Python package, as QDT does. Abuild-python-packagejob builds the sdist and the wheel, runstwine check --strictand, on a tag, refuses a tag that doesn't match the package version (compared as PEP 440 versions). Thereleasejob attaches them to the GitHub release, and arelease-pypijob publishes them from thepypienvironment with Trusted Publishing (no API token). On pull requests touchingpyproject.tomlorMANIFEST.in, the package is only built and checked.docs:docs/development/releasing.mddescribes the automated publication and the one-time setup, and the manual fallback is fixed.CLAUDE.mdnotes the packaging rules.To do before the first release
dicogis, ownerGuts, repositoryDicoGIS, workflowbuilder_releaser.yml, environmentpypi.pypienvironment (optionally with required reviewers).Verification
python -m build:twine check --strictpasses and the wheel contains the.ui,.qm, locale andbinfiles.package-datapattern or a.uilocation is broken on purpose.tests.test_aboutandtests.test_packagingpass.pytestsuite (needs fixtures and PostGIS), and the availability of thedicogisname on PyPI (pip index versionsfound nothing, to be confirmed on pypi.org).Related issue(s)
None.
Type of change
fix/…branch)feature/…branch)docs/…branch or*.md/docs/**changes)packaging/…branch orbuilder/**changes)tooling/…branch or.github/**changes)tests/**changes)Checklist
pre-commit run --all-filespasses locallypytestpasses locallyAI/LLM disclosure
https://claude.ai/code/session_01HATwPxs2xpwnubZPvpGzBh
Generated by Claude Code