Install the build and upload tools:
pip install build twineYou will also need a PyPI account with upload rights to the sapcli project.
Steps 1–5 below are fully automated by one of three Makefile targets.
The target computes the next version from pyproject.toml, patches both
pyproject.toml and sap/cli/_entry.py, runs the full check suite, commits
the result, and creates the git tag.
| Command | Increments | Example: 1.2.3 → |
|---|---|---|
make release-major |
MAJOR, resets MINOR and PATCH to 0 | 2.0.0 |
make release-minor |
MINOR, resets PATCH to 0 | 1.3.0 |
make release-fix |
PATCH only | 1.2.4 |
If make check fails the process stops before any commit or tag is created,
so the working tree is left with the version files already patched — fix the
issue, reset the two files, and re-run the target.
Edit the version field in pyproject.toml:
[project]
version = "X.Y.Z"Patch _FALLBACK_VERSION in sap/cli/_entry.py to match:
_FALLBACK_VERSION = 'X.Y.Z'make checkAll tests and linters must pass before proceeding.
git add pyproject.toml sap/cli/_entry.py
git commit -m "release: bump version to X.Y.Z"git tag X.Y.ZThe tag is used by get_version.sh to derive the runtime version string reported by
sapcli --version.
python -m buildThis produces two files under dist/:
sapcli-X.Y.Z.tar.gz— source distributionsapcli-X.Y.Z-py3-none-any.whl— wheel
twine upload dist/sapcli-X.Y.Z*Enter your PyPI credentials when prompted, or configure them in ~/.pypirc.
git push origin master
git push origin X.Y.ZInstall the newly published package in a clean environment and check the version:
pip install --upgrade sapcli
sapcli --versionThe project follows a simple MAJOR.MINOR.PATCH scheme. Choose the next version
according to the scope of changes since the last release:
| Change type | Component to increment |
|---|---|
| Breaking / incompatible change | MAJOR |
| New backwards-compatible feature | MINOR |
| Bug fix or documentation update | PATCH |