Development and releases#
Setting up#
git clone https://github.com/directelectron/de-twin
cd de-twin
uv sync --group dev # the package (editable), deapi, pytest, towncrier, ruff
uv run pytest # ~340 tests, a few minutes
On Windows, cpp\build.bat builds the stand-alone check of DE-Server’s
ExternalFrameSource (needs Visual Studio); the layout and C++ ↔ Python interop tests run
when it has been built and are skipped otherwise.
Build the documentation with:
uv sync --extra docs
uv run sphinx-build -b html docs docs/_build/html -W --keep-going
Changelog entries#
Every pull request that changes something a user would notice adds a news fragment to
upcoming_changes/, named {PR number}.{type}.rst (types: api_change, new_feature,
bugfix, deprecation, removal, doc, maintenance). See
upcoming_changes/README.rst. Preview the next release notes with:
uvx towncrier build --draft --version NEXT
Making a release#
Releases are prepared by a workflow and published by hand on GitHub.
Prepare. In GitHub, Actions → Prepare Release → Run workflow. Pick the bump (
minor,bugfix,major;pre-release/betafor betas,finalizeto turn a beta into the stable release). The workflow bumps the version inpyproject.toml, buildsCHANGELOG.rstfrom the fragments (and deletes them), adds the version to the docs switcher, and opens arelease/vX.Y.Zpull request.Review and merge that pull request once CI passes. Edit
CHANGELOG.rstin the PR if the notes need work.Publish on GitHub. Releases → Draft a new release: tag
vX.Y.Zonmain(the tag must matchpyproject.toml), titlevX.Y.Z, paste the version’sCHANGELOG.rstsection as the notes, tick pre-release for a beta, and Publish release.Publishing runs the Release workflow: it checks the tag matches the package version, builds the wheel and sdist, uploads them to PyPI by trusted publishing, and attaches them to the GitHub Release. Pushing the tag also builds that version’s documentation.
One-time setup#
PyPI: on pypi.org, Your projects → Publishing → Add a pending publisher: project
de-twin, ownerdirectelectron, repositoryde-twin, workflowrelease.yml, environmentpypi.GitHub: create an environment named
pypi(Settings → Environments); optionally require a reviewer for it. Enable GitHub Pages from thegh-pagesbranch once the Docs workflow has pushed it.