Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

25 changes: 11 additions & 14 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Project Overview

**asr-client-python** is a gRPC client library and CLI tool for the Techmo ASR (Automatic Speech Recognition) Service. It wraps the `asr-api-python` Python bindings (from `submodules/asr-api-python`) into a user-facing package with:
**asr-client-python** is a gRPC client library and CLI tool for the Techmo ASR (Automatic Speech Recognition) Service. It wraps the `asr-api-python` Python bindings (from `techmo-asr-api` on GitHub) into a user-facing package with:
- A Python API (`asr_client` package)
- A CLI tool (`asr-client` entry point → `asr_client.__main__:main`)

Expand All @@ -13,11 +13,11 @@ Current version: see `asr_client/VERSION.py` (`__version__` attribute).
## Repository Setup (run once after cloning)

```bash
./setup.sh # Sync git submodules
./setup.sh # Install pre-commit hooks
./install.sh # Create .venv + install package with test extras
```

- `setup.sh` — submodule sync/init only (`git submodule sync/update --init --recursive`).
- `setup.sh` — clones the `techmo-pl/pre-commit` tooling from GitHub and installs hooks.
- `install.sh` — creates `.venv` via `uv`, runs `uv pip install -e ".[test]"`. Accepts an optional `VENV_PATH` argument (default: `.venv`). Checks upfront for `uv`, `gcc`, Python headers, and PortAudio headers — fails with a clear message if any are missing.

---
Expand Down Expand Up @@ -51,20 +51,17 @@ asr_client/

## gRPC / Protobuf Rules

- Generated protobuf files (`*_pb2.py`, `*_pb2_grpc.py`) come from `submodules/asr-api-python` and are produced at install time — never commit them.
- All gRPC stubs are imported via `from asr_api import v1, v1p1, dictation`. The `asr_api` package is installed from the submodule under the name `techmo-asr-api` (see `[tool.uv.sources]` in `pyproject.toml`), not from PyPI.
- If `asr_api` imports fail after cloning, run `./setup.sh` then `./install.sh`.
- `tox.ini` installs the submodule directly as a dep: `deps = -e {toxinidir}/submodules/asr-api-python`.
- Generated protobuf files (`*_pb2.py`, `*_pb2_grpc.py`) are produced at install time — never commit them.
- All gRPC stubs are imported via `from asr_api import v1, v1p1, dictation`. The `asr_api` package is installed from `techmo-asr-api @ git+https://github.com/techmo-pl/asr-api-python.git@1.1.4` (declared in `pyproject.toml` dependencies).
- If `asr_api` imports fail after cloning, run `./install.sh`.

---

## Key Submodule
## Key Dependency

| Path | Purpose |
|------|---------|
| `submodules/asr-api-python/` | gRPC stubs for all ASR API versions (the `asr_api` package) |

Run `./setup.sh` after any commit that changes `.gitmodules`.
| Package | Source |
|---------|--------|
| `techmo-asr-api` | `git+https://github.com/techmo-pl/asr-api-python.git@1.1.4` — gRPC stubs for all ASR API versions (the `asr_api` Python package) |

---

Expand All @@ -87,7 +84,7 @@ apt install python3-dev portaudio19-dev build-essential
| `audioop-lts` | `audioop` removed from stdlib in Python 3.13; conditional dep for `python_version >= '3.13'` |
| `pydub` | Emits `SyntaxWarning` on Python 3.14 during import; suppressed with `warnings.catch_warnings()` in `audio_processing.py` — do not remove or move that guard |
| `grpcio` | Pinned `<1.71.0` for Python 3.8 only; unpinned on 3.9+ |
| `techmo-asr-api` | Local package from submodule, not on PyPI |
| `techmo-asr-api` | Installed from `git+https://github.com/techmo-pl/asr-api-python.git@1.1.4` |

**gRPC 4 MB message limit:** Default max incoming message size is 4 MB. Sending a file larger than ~4 MB as a single chunk will fail with `StatusCode.RESOURCE_EXHAUSTED`. Use `--audio-stream-chunk-duration` for large files.

Expand Down
5 changes: 1 addition & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dependencies = [
"pyaudio>=0.2.12",
"pydub>=0.25.1",
"audioop-lts>=0.2.2; python_version>='3.13'",
"techmo-asr-api",
"techmo-asr-api @ git+https://github.com/techmo-pl/asr-api-python.git@1.1.4",
]

[project.optional-dependencies]
Expand All @@ -37,9 +37,6 @@ version = { attr = "asr_client.VERSION.__version__" }
[tool.setuptools.packages.find]
include = ["asr_client*"]

[tool.uv.sources]
techmo-asr-api = { path = "submodules/asr-api-python", editable = true }

[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = ["--strict-markers"]
Expand Down
8 changes: 5 additions & 3 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
#
# usage: ./setup.sh
#
# Run once after cloning: initialises git submodules.
# Run once after cloning: installs pre-commit hooks.

set -euo pipefail

git submodule sync --recursive
git submodule update --init --recursive
if [ ! -d pre-commit ]; then
git clone --depth 1 --branch v3.0.0 https://github.com/techmo-pl/pre-commit.git
fi
./pre-commit/install.sh
1 change: 0 additions & 1 deletion submodules/asr-api-python
Submodule asr-api-python deleted from 3b0f98
2 changes: 0 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ requires =

[testenv]
extras = test
deps =
-e {toxinidir}/submodules/asr-api-python
set_env = PYTHONPATH = {toxinidir}
passenv =
ASR_*
Expand Down
Loading