|
| 1 | +# AGENTS.md — tts-api-python |
| 2 | + |
| 3 | +## Project Summary |
| 4 | + |
| 5 | +Python gRPC stub package for the Techmo TTS Service API v3. Generates Python bindings from the proto definitions in the `tts-api` submodule and publishes them as a pip-installable package. |
| 6 | + |
| 7 | +**PyPI package name:** `tts-api` (import namespace: `tts_service_api`) |
| 8 | +**Distribution:** GitHub tagged releases — `git+https://github.com/techmo-pl/tts-api-python.git@vX.Y.Z` |
| 9 | +**Version:** `tts_service_api/VERSION.py` |
| 10 | +**Python support:** 3.8–3.13 |
| 11 | + |
| 12 | +## Repo Layout |
| 13 | + |
| 14 | +``` |
| 15 | +tts_service_api/ |
| 16 | + __init__.py # re-exports everything from techmo.tts.api.v3 |
| 17 | + v3.py # same re-export (explicit v3 alias) |
| 18 | + VERSION.py # single version source (__version__) |
| 19 | +techmo/tts/api/v3/ # generated — never committed |
| 20 | + techmo_tts_pb2.py |
| 21 | + techmo_tts_pb2_grpc.py |
| 22 | +submodules/ |
| 23 | + tts-service-api/ # git submodule → github.com/techmo-pl/tts-api |
| 24 | +shim/ |
| 25 | + pyproject.toml # deprecated tts-service-api==999.0.0 shim package |
| 26 | + README.md |
| 27 | +setup.py # drives protoc via grpcio-tools at build time |
| 28 | +pyproject.toml # build backend + grpcio-tools constraint |
| 29 | +setup.sh # one-time: init submodule + pre-commit hooks |
| 30 | +install.sh # create .venv + uv pip install -e . |
| 31 | +``` |
| 32 | + |
| 33 | +## Import Paths |
| 34 | + |
| 35 | +```python |
| 36 | +# Canonical (generated namespace): |
| 37 | +from techmo.tts.api.v3 import techmo_tts_pb2, techmo_tts_pb2_grpc |
| 38 | + |
| 39 | +# Convenience re-export: |
| 40 | +from tts_service_api import v3 |
| 41 | +from tts_service_api.v3 import TTSStub, SynthesizeRequest # etc. |
| 42 | + |
| 43 | +# Top-level wildcard (everything from v3): |
| 44 | +import tts_service_api |
| 45 | +``` |
| 46 | + |
| 47 | +## Environment Setup |
| 48 | + |
| 49 | +```bash |
| 50 | +./setup.sh # one-time: init submodule + pre-commit hooks |
| 51 | +./install.sh # create .venv, install package (triggers stub generation) |
| 52 | +source .venv/bin/activate |
| 53 | +``` |
| 54 | + |
| 55 | +Stub generation runs automatically during `uv pip install -e .` via `setup.py`. Generated files (`techmo_tts_pb2.py`, `techmo_tts_pb2_grpc.py`) are **never committed**. |
| 56 | + |
| 57 | +## Building & Releasing |
| 58 | + |
| 59 | +```bash |
| 60 | +uv build # produces dist/tts_api-X.Y.Z.tar.gz |
| 61 | +git tag vX.Y.Z && git push origin vX.Y.Z |
| 62 | +``` |
| 63 | + |
| 64 | +When a new proto version lands in `tts-api`: |
| 65 | +1. Pull the submodule update |
| 66 | +2. Regenerate stubs (reinstall or run `python setup.py build_grpc` in tts-api-python) |
| 67 | +3. Bump `tts_service_api/VERSION.py` |
| 68 | +4. Update `CHANGELOG.md` |
| 69 | +5. Tag and release |
| 70 | + |
| 71 | +## Deprecation Shim |
| 72 | + |
| 73 | +`shim/` contains a metadata-only `tts-service-api==999.0.0` package that depends on `tts-api`. Build and release alongside main package releases. It exists solely for backwards compatibility — install it the same way. |
| 74 | + |
| 75 | +## Dependency Constraints |
| 76 | + |
| 77 | +Python 3.8 requires tighter bounds (grpcio 1.71.0 dropped Python 3.8): |
| 78 | +- `grpcio>=1.70.0,<1.71.0` (3.8) vs `grpcio>=1.70.0` (3.9+) |
| 79 | +- `protobuf>=5.29.0,<6.0` (3.8) vs `protobuf>=5.29.0` (3.9+) |
| 80 | +- `grpcio-tools>=1.70.0,<1.71.0` in `pyproject.toml` build deps |
| 81 | + |
| 82 | +Do not widen these without verifying Python 3.8 compatibility. |
| 83 | + |
| 84 | +## CI — GitHub Actions |
| 85 | + |
| 86 | +`.github/workflows/test.yml` tests Python 3.8–3.13. Each job: checkout with submodules → install uv → `uv pip install -e .` → verify `from tts_service_api import VERSION`. |
| 87 | + |
| 88 | +## Commit Conventions |
| 89 | + |
| 90 | +`feat:`, `fix:`, `chore:`, `ci:`, `docs:` — conventional commits. Never commit `*_pb2.py` or `*_pb2_grpc.py`. No Claude attribution in commit messages. |
0 commit comments