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
55 changes: 55 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Tests

on:
push:
branches: ["main", "master"]
pull_request:
workflow_dispatch:

jobs:
test:
name: Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
cache-dependency-glob: "pyproject.toml"

- name: Generate proto stubs and install package
run: ./install.sh

- name: Run tests via tox
run: |
TOXENV="py$(echo '${{ matrix.python-version }}' | tr -d '.')"
uvx --with "tox-uv>=1" tox -e "${TOXENV}"

test-py314:
name: Python 3.14 (allowed failure)
runs-on: ubuntu-latest
continue-on-error: true

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
cache-dependency-glob: "pyproject.toml"

- name: Generate proto stubs and install package
run: ./install.sh

- name: Run tests via tox
run: uvx --with "tox-uv>=1" tox -e py314
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
build/
*.egg-info/
.eggs/
.tox/
google/
__pycache__/
techmo/
.venv/
.vscode/
pre-commit/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "submodules/asr-api"]
path = submodules/asr-api
url = https://github.com/techmo-pl/asr-api.git
28 changes: 23 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,28 @@
# Changelog of ASR API (Python)

## [1.0.0] - 2024-08-14

## [1.1.4] - 2026-03-22

### Fixed

- `install.sh`: added `export PATH="$HOME/.local/bin:$PATH"` so that `uv` is found on runners where it is installed locally rather than system-wide.
- `VERSION.py`: corrected version string (was not updated when 1.1.3 was tagged).

### Changed

- `setup.py`: replaced `pkg_resources` with importlib-compatible path resolution; removed upper bound on setuptools; removed upper bound on grpcio-tools build requirement.
- `pyproject.toml`: removed upper bound on grpcio and protobuf runtime requirements; added Python-version markers to guard Python 3.8 users from grpcio>=1.71.0 and protobuf>=6.0.0; grpcio bounds set to `>=1.49.4,<1.71.0` for Python 3.8 and `>=1.49.4` for 3.9+; protobuf bounds set to `>=4.21.3,<6`; `requires-python` lowered to `>=3.8`; introduced upper bound on setuptools below 82; added `pip<26` constraint.
- `tox.ini`, `install.sh`: introduced uv-based multi-version testing (Python 3.8–3.14); replaced Docker-based single-version test with tox multi-version matrix.
- `submodules/asr-api`: updated to v1.1.1; restructured from committed proto files to a submodule.
- `asr_api/`: support for _techmo.asr.api.v1p1_ API.
- `tests/`: attribute check for _techmo.asr.api.v1p1_ API.


## [1.0.0] - 2024-01-29

### Added

- _asr_api_ package
- support for _techmo.asr.api.dictation_ API
- support for _techmo.asr.api.v1_ API
- Setuptools configuration
- `asr_api/`: support for _techmo.asr.api.dictation_ and _techmo.asr.api.v1_ APIs.
- `pyproject.toml`: setuptools configuration.
- `tests/`: attribute checks for _techmo.asr.api.dictation_ and _techmo.asr.api.v1_ APIs; coverage report.
- `submodules/asr-api`: asr-api v1.0.0.
35 changes: 32 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# ASR API (Python)

The collection of gRPC APIs for Techmo ASR supplied as a Python package.
The collection of gRPC APIs for Techmo ASR solutions supplied as a Python package.

## Setup

The project can be used as-is and does not require any additional setup.
Run once after cloning to initialise the submodule:

## Requirements
```sh
./setup.sh
```

### Requirements

- [Python](https://www.python.org/) >=3.8

Expand All @@ -23,6 +27,23 @@ pip install --require-virtualenv --upgrade pip
pip install --require-virtualenv .
```

*For basic development use, consider convenient `./install.sh`.*

## Running tests

Proto stubs must be generated before running tests. Use `./install.sh` once, then invoke tox:

```sh
./install.sh
uvx --with "tox-uv>=1" tox
```

To run a single Python version:

```sh
uvx --with "tox-uv>=1" tox -e py312
```

## Usage

### Import
Expand All @@ -31,6 +52,14 @@ The package provides a precompiled collection of `.proto` files that can be impo

Example:

- direct import

```python
>>> from techmo.asr.api.v1p1 import asr_pb2 as api
>>> hasattr(api, "StreamingRecognizeRequest")
True
```

- import from an alias module

```python
Expand Down
1 change: 0 additions & 1 deletion VERSION.md

This file was deleted.

2 changes: 1 addition & 1 deletion asr_api/VERSION.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.0.0"
__version__ = "1.1.4"
19 changes: 19 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash
#
# usage: ./install.sh [VENV_PATH]
#
# VENV_PATH: Optional path for the virtual environment (default: ./.venv).
#
# Creates a virtualenv with uv and installs the package with test dependencies.

set -euo pipefail

VENV_PATH="${1:-.venv}"

if [ ! -d "${VENV_PATH}" ]; then
uv venv "${VENV_PATH}"
fi

# shellcheck disable=SC1091
source "${VENV_PATH}/bin/activate"
uv pip install -e ".[tests]"
49 changes: 0 additions & 49 deletions proto/google/rpc/status.proto

This file was deleted.

20 changes: 0 additions & 20 deletions proto/techmo/api/status.proto

This file was deleted.

Loading
Loading