1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
```bash
cd sdk/python
uv sync --extra dev
uv run python scripts/generate_protos.py
uv run pytest
uv run pyrefly check
uv run python -m build
uv run twine check dist/*
```
If you are not using `uv`, replace `uv run ...` with the same commands inside a virtualenv after `python -m pip install -e ".[dev]"`.
Make sure `pyproject.toml` has the version you want to publish. PyPI versions are immutable, so bump the version before rebuilding if a publish attempt already uploaded that version.
```bash
twine upload --repository testpypi dist/*
python -m pip install \
--index-url https://test.pypi.org/simple/ \
--extra-index-url https://pypi.org/simple/ \
udb-client==0.2.0
```
This repo has a GitHub `production` environment secret named `PYPI_API_TOKEN`.
Publish from GitHub Actions with either:
```bash
git tag v0.2.0
git push origin v0.2.0
```
or run the `Release Python SDK` workflow manually and enter `0.2.0`.
Manual fallback:
```bash
twine upload dist/*
```
Use a PyPI API token, not your account password. For username, use `__token__`; for password, paste the token value.
```yaml
name: Publish Python SDK
on:
push:
jobs:
publish:
```