GLiNER2 supports Python 3.10–3.12. Releases are built from tags and published with PyPI trusted publishing; maintainers must not upload artifacts with local API tokens.
- Create and protect a GitHub environment named
pypi. - In the PyPI project settings, add this repository and the
.github/workflows/release.ymlworkflow as a trusted publisher. - Add the repository variable
PYPI_TRUSTED_PUBLISHING_ENABLED=true.
The publish job is skipped unless that variable is exactly true. Keep it
unset while validating the release workflow.
-
Version in
gliner2/__init__.pyand the changelog release heading match. -
CI passes on Python 3.10, 3.11, and 3.12.
-
Ruff, the incremental mypy target, and the coverage floor pass.
-
Wheel and sdist pass
twine checkand artifact-content validation. -
Fresh base wheel and sdist installs remain torch-free.
-
Fresh
[local]and[train]wheel installs pass their smoke tests. -
Offline tests pass with no unexpected failure, skip, or xfail:
pytest -m "not slow and not quality and not compile" -
Compile tests pass separately.
-
The manual/nightly quality workflow passes with both exact checkpoints:
- span:
fastino/gliner2-base-v1 - boundary:
fastino/gliner2.5-multi-v1
- span:
-
CUDA no-host-sync and performance checks pass on the self-hosted GPU runner. CPU and MPS checks do not substitute for this gate.
-
Every hardware-only skip is recorded in the release notes.
python -m pip install ".[dev]"
python -m build
python -m twine check dist/*
python packaging_tests/check_artifact.py dist/*.whl
python packaging_tests/check_artifact.py dist/*.tar.gzRun each install in a new virtual environment; do not reuse the build environment:
python -m venv .smoke/base-wheel
.smoke/base-wheel/bin/python -m pip install dist/*.whl
.smoke/base-wheel/bin/python packaging_tests/smoke_install.py --profile base
python -m venv .smoke/local-wheel
wheel=$(printf '%s\n' dist/*.whl)
.smoke/local-wheel/bin/python -m pip install "${wheel}[local]"
.smoke/local-wheel/bin/python packaging_tests/smoke_install.py --profile local
python -m venv .smoke/train-wheel
.smoke/train-wheel/bin/python -m pip install "${wheel}[train]"
.smoke/train-wheel/bin/python packaging_tests/smoke_install.py --profile train
python -m venv .smoke/base-sdist
.smoke/base-sdist/bin/python -m pip install dist/*.tar.gz
.smoke/base-sdist/bin/python packaging_tests/smoke_install.py --profile base- Replace
Unreleasedon the target changelog heading with the release date. - Confirm the working tree and release branch contain only reviewed changes.
- Create an annotated
vX.Y.Ztag whose value exactly matchesgliner2.__version__, then push the tag. - The release workflow rebuilds artifacts, validates them, and uploads them as a workflow artifact.
- Only when trusted publishing is configured and
PYPI_TRUSTED_PUBLISHING_ENABLED=truewill the guarded publish job request an OIDC token and upload to PyPI. - Create the GitHub release from the validated tag and attach the workflow artifacts.
PyPI artifacts are immutable. If a version already exists, increment the version and create a new tag; never replace or mutate an existing release.