22
33This document captures the steps for cutting a new version of the SDK and publishing it to PyPI.
44
5- 1 . ** Prep the repo**
5+ 1 . ** Set up Poetry credentials (one-time per machine)**
6+ ``` bash
7+ poetry config repositories.testpypi https://test.pypi.org/legacy/
8+ # Use a TestPyPI API token copied from https://test.pypi.org/manage/account/token/
9+ poetry config pypi-token.testpypi < TESTPYPI_API_TOKEN>
10+ # For the main PyPI token (if not already configured)
11+ poetry config pypi-token.pypi < PYPI_API_TOKEN>
12+ ```
13+ Alternatively export ` POETRY_HTTP_BASIC_TESTPYPI_USERNAME="__token__" ` and ` POETRY_HTTP_BASIC_TESTPYPI_PASSWORD="<token>" ` before publishing.
14+
15+ 2 . ** Prep the repo**
616 - Update ` pyproject.toml ` with the new version under ` [tool.poetry] ` .
717 - Add an entry to ` CHANGELOG.md ` summarising the release and changes.
818 - Commit your work before building artifacts.
919
10- 2 . ** Run quality checks**
20+ 3 . ** Run quality checks**
1121 ``` bash
1222 make install # installs dependencies
1323 make fmt && make lint # optional but recommended
1424 make test # run pytest
1525 ```
1626
17- 3 . ** Build distributions**
27+ 4 . ** Build distributions**
1828 ``` bash
1929 poetry build
2030 ls dist/ # verify the wheel and sdist exist
2131 tar tf dist/kratix-sdk-< version> .tar.gz | head
2232 ```
2333 Inspect the contents to ensure only expected files are included.
2434
25- 4 . ** Publish to TestPyPI (recommended)**
35+ 5 . ** Publish to TestPyPI (recommended)**
2636 ``` bash
2737 poetry publish --repository testpypi --build
2838 python -m venv /tmp/kratix-sdk-test
@@ -31,15 +41,14 @@ This document captures the steps for cutting a new version of the SDK and publis
3141 ```
3242 Run a quick smoke test (` python -c "import kratix_sdk; print(kratix_sdk.__version__)" ` ) to ensure the build works.
3343
34- 5 . ** Publish to PyPI**
44+ 6 . ** Publish to PyPI**
3545 ``` bash
3646 poetry publish --build
3747 git tag v< version>
3848 git push origin main --tags
3949 ```
4050 PyPI credentials/API token must be configured in ` ~/.pypirc ` beforehand.
4151
42- 6 . ** Communicate the release**
52+ 7 . ** Communicate the release**
4353 - Share release notes on the relevant channels.
4454 - Update downstream sample projects if they pin versions.
45-
0 commit comments