For DataMasque staff / maintainers of this project.
Covers production releases to PyPI, dev releases to TestPyPI, and how downstream projects pin datamasque-python.
The assumed starting point is that you have a datamasque-python feature/fix PR in progress,
and want to know how to get it pushed up to PyPI once merged,
or how to build a test release / pin to a particular commit so you can test before merging the PR.
Every release must update both, or CI will reject the tag. As part of your PR, update:
pyproject.toml—[project] version. This is the version the built sdist/wheel carries, and the onerelease.ymlchecks the git tag against.uv.lock— theversionfield of thedatamasque-pythonpackage entry. CI runsuv sync --frozen, so a stale lock fails every job.
Edit pyproject.toml by hand, then run uv lock to update the lock entry.
Don't hand-edit uv.lock.
Don't update datamasque.client.__version__ or docs/conf.py.
These read the installed package metadata.
Do this as part of your PR.
HISTORY.rst needs a new entry for each release to pypi.
Add a new entry at the top, under the History heading, with the new version and today's date.
Use short summaries of additions and changes, written with past tense and worded for a customer consumer of this library.
For example:
1.2.2 (2026-08-05) ------------------ * Added ``get_all_widgets`` API. * Fixed issue where ``list_frobs`` would incorrectly raise a ``ValueError`` when using the filtering options. Requires server version 3.26.14.
Call out breaking changes explicitly, and note the minimum DataMasque server version if the release requires one.
Get your PR approved and merged.
Tag the merge commit on
mainand push the tag:git checkout main git pull --ff-only git tag v1.2.2 # or whatever is your version number git push origin v1.2.2
The tag must be
v+ the exactpyproject.tomlversion.release.ymltriggers onv*.*.*and fails the build if the two disagree. Tag only after the PR has merged, so the tag points at a commit onmain.The admins of the repo will get an automated email asking them to approve the deployment. They can do this by visiting the Workflows page or by clicking the link in the email.
Once approved, the build will appear on PyPI very quickly (around 1 minute). You can verify that the release appears at https://pypi.org/project/datamasque-python/, and Read the Docs has built the new tag at https://datamasque-python.readthedocs.io/.
The GitHub Release is created automatically once the PyPI publish succeeds.
release.ymlruns agithub-releasejob that creates the release for the pushed tag, attaches the built distributions, and links toHISTORY.rstat that tag for the changelog. Nothing to do by hand; just confirm it appears under Releases on the repository home page.
Use this to let a downstream project try an unreleased change. It builds from any ref and never touches PyPI.
Push the branch you want to publish. Nothing needs to be merged first.
Go to Actions → Release (TestPyPI) → Run workflow.
Fill in the inputs:
- ref — the branch to build from.
- dev_version — the version to publish, for example
1.3.0.dev1.
Use a
.devNsuffix. The input is validated, so a plain release version like1.3.0is rejected.Note: Version numbers cannot be reused. Ensure you increment the suffix each time.
No approval is needed — unlike a PyPI release, the build publishes as soon as it passes.
Note: Do not create a git tag or a GitHub Release for a TestPyPI build.
Three ways to depend on datamasque-python, depending on what you need.
The usual case.
In the consuming project's pyproject.toml:
dependencies = [
"datamasque-python==1.2.2",
]
Always give a version specifier.
An unpinned "datamasque-python" means "whatever is newest at the moment this resolves",
which is prone to breaking when someone releases a datamasque-python change before the corresponding server release.
Pin exactly (==1.2.2) when you want every upgrade to be a deliberate, reviewed change.
A bounded range (>=1.2.2,<2) is acceptable where you need a floor for a specific feature,
but note that this project does sometimes ship breaking changes
(e.g. 1.2.0 removed config_type from the discovery config library APIs),
so read the HISTORY.rst entries between your current version and the new one before raising the floor.
TestPyPI is a separate index, so it must be declared as well as pinned. Pin the exact dev version — TestPyPI content is disposable.
Note: Always replace a TestPyPI pin with a real PyPI version before merging the consuming project —
TestPyPI is not a durable index,
and the downstream project should always use a "proper" (normal PyPI) version of datamasque-python once merged.
With uv:
[project]
dependencies = [
"datamasque-python==1.3.0.dev1",
]
[[tool.uv.index]]
name = "testpypi"
url = "https://test.pypi.org/simple/"
explicit = true
[tool.uv.sources]
datamasque-python = { index = "testpypi" }
Note: Be sure to include the explicit = true:
without it, uv will resolve every dependency against TestPyPI, which mirrors PyPI only partially.
With Poetry:
[[tool.poetry.source]]
name = "testpypi"
url = "https://test.pypi.org/simple/"
priority = "explicit"
[tool.poetry.dependencies]
datamasque-python = { version = "1.3.0.dev1", source = "testpypi" }
Ad hoc, without editing anything:
pip install \
--index-url https://test.pypi.org/simple/ \
--extra-index-url https://pypi.org/simple/ \
datamasque-python==1.3.0.dev1
For testing an unmerged change without publishing anything at all. Prefer a commit SHA over a branch name — a branch ref can change under you, and a lockfile pinned to one is not reproducible.
Note: Always replace a git pin with a PyPI version before merging the consuming project, for the same reasons as above, plus the fact git dependencies break any downstream install that lacks repository access.
uv sources form, which keeps the version constraint readable:
[project]
dependencies = [
"datamasque-python",
]
[tool.uv.sources]
datamasque-python = { git = "https://github.com/datamasque/datamasque-python.git", rev = "ab12cd34" }
With Poetry:
[tool.poetry.dependencies]
datamasque-python = { git = "https://github.com/datamasque/datamasque-python.git", rev = "ab12cd34" }
Use git+ssh://git@github.com/... instead of https if the consumer builds somewhere without an HTTPS credential for the repository.
PEP 508 direct reference,
which pip and uv both understand:
dependencies = [
"datamasque-python @ git+https://github.com/datamasque/datamasque-python.git@ab12cd34",
]