Skip to content
Closed
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
38 changes: 19 additions & 19 deletions .github/RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ The Speechmatics Python SDK repository contains two separate packages:

- `speechmatics-rt` - Real-Time API Client
- `speechmatics-batch` - Batch API Client
- `speechmatics-flow` - Flow API Client
- `speechmatics-voice` - Voice Agent API Client
- `speechmatics-tts` - TTS API Client

Each package is released independently with its own versioning and release workflow.

Expand Down Expand Up @@ -91,55 +91,55 @@ To release a new version of the Batch SDK:
- Update GitHub release notes
- Announce the release

### 3. Flow SDK Release
### 3. Voice Agent SDK Release

To release a new version of the Flow SDK:
To release a new version of the Voice Agent SDK:

1. **Create a Release Tag**

```bash
git tag flow/v1.0.0
git push origin flow/v1.0.0
git tag voice/v1.0.0
git push origin voice/v1.0.0
```

2. **Automated Workflow**
The `release-flow.yaml` workflow will automatically:
The `release-voice.yaml` workflow will automatically:

- Extract version from tag (e.g., `flow/v1.0.0` → `1.0.0`)
- Extract version from tag (e.g., `voice/v1.0.0` → `1.0.0`)
- Run comprehensive tests across Python versions
- Update version in `sdk/flow/speechmatics/flow/__init__.py`
- Update version in `sdk/voice/speechmatics/voice/__init__.py`
- Build the package
- Publish to PyPI

3. **Manual Steps After Release**
- Verify the package is available on PyPI
- Test installation: `pip install speechmatics-flow==1.0.0`
- Test installation: `pip install speechmatics-voice==1.0.0`
- Update GitHub release notes
- Announce the release

### 4. Voice Agent SDK Release
### 4. TTS SDK Release

To release a new version of the Voice Agent SDK:
To release a new version of the TTS SDK:

1. **Create a Release Tag**

```bash
git tag voice/v1.0.0
git push origin voice/v1.0.0
git tag tts/v1.0.0
git push origin tts/v1.0.0
```

2. **Automated Workflow**
The `release-voice.yaml` workflow will automatically:
The `release-tts.yaml` workflow will automatically:

- Extract version from tag (e.g., `voice/v1.0.0` → `1.0.0`)
- Extract version from tag (e.g., `tts/v1.0.0` → `1.0.0`)
- Run comprehensive tests across Python versions
- Update version in `sdk/voice/speechmatics/voice/__init__.py`
- Update version in `sdk/tts/speechmatics/tts/__init__.py`
- Build the package
- Publish to PyPI

3. **Manual Steps After Release**
- Verify the package is available on PyPI
- Test installation: `pip install speechmatics-voice==1.0.0`
- Test installation: `pip install speechmatics-tts==1.0.0`
- Update GitHub release notes
- Announce the release

Expand All @@ -162,8 +162,8 @@ Both packages follow semantic versioning (SemVer):

- RT SDK: `rt/v{version}` (e.g., `rt/v1.0.0`)
- Batch SDK: `batch/v{version}` (e.g., `batch/v1.0.0`)
- Flow SDK: `flow/v{version}` (e.g., `flow/v1.0.0`)
- Voice Agent SDK: `voice/v{version}` (e.g., `voice/v1.0.0`)
- TTS SDK: `tts/v{version}` (e.g., `tts/v1.0.0`)

## Environment Setup

Expand All @@ -173,8 +173,8 @@ Both packages are published to PyPI using GitHub Actions with OpenID Connect (OI

- RT SDK: Uses `pypi-rt` environment
- Batch SDK: Uses `pypi-batch` environment
- Flow SDK: Uses `pypi-flow` environment
- Voice Agent SDK: Uses `pypi-voice` environment
- TTS SDK: Uses `pypi-tts` environment

### Required Secrets

Expand Down
74 changes: 74 additions & 0 deletions .github/workflows/release-sdk.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Release SDK Meta-Package

on:
push:
tags:
- "sdk/v*"

permissions:
contents: read
id-token: write

jobs:
extract-version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.extract.outputs.version }}
steps:
- name: Extract version from tag
id: extract
run: |
# Extract version from tag (sdk/v1.0.0 -> 1.0.0)
VERSION=${GITHUB_REF#refs/tags/sdk/v}
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Extracted version: $VERSION"

release-build:
runs-on: ubuntu-latest
needs: [extract-version]
outputs:
version: ${{ needs.extract-version.outputs.version }}
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.13"

- name: Update package version in sdk/sdk/speechmatics/sdk/__init__.py
run: |
VERSION="${{ needs.extract-version.outputs.version }}"
sed -i "s/0\.0\.0/$VERSION/g" ./sdk/sdk/speechmatics/sdk/__init__.py
echo "Updated version to: $VERSION"
cat ./sdk/sdk/speechmatics/sdk/__init__.py | grep __version__

- name: Build SDK meta-package
run: |
make install-dev
make build-sdk

- name: Upload dist
uses: actions/upload-artifact@v4
with:
name: sdk-release-dist
path: sdk/sdk/dist/

pypi-publish:
runs-on: ubuntu-latest
needs: [release-build]
environment:
name: pypi-sdk
url: https://pypi.org/project/speechmatics-sdk/${{ needs.release-build.outputs.version }}

steps:
- name: Retrieve release dist
uses: actions/download-artifact@v4
with:
name: sdk-release-dist
path: dist/

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/
password: ${{ secrets.PYPI_ORG_TOKEN }}
40 changes: 31 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

.PHONY: help
.PHONY: test-all test-rt test-batch test-flow test-tts test-voice
.PHONY: format-all format-rt format-batch format-flow format-tts format-voice
.PHONY: lint-all lint-rt lint-batch lint-flow lint-tts lint-voice
.PHONY: format-all format-rt format-batch format-flow format-tts format-voice format-sdk
.PHONY: lint-all lint-rt lint-batch lint-flow lint-tts lint-voice lint-sdk
.PHONY: type-check-all type-check-rt type-check-batch type-check-flow type-check-tts type-check-voice
.PHONY: build-all build-rt build-batch build-flow build-tts build-voice
.PHONY: clean-all clean-rt clean-batch clean-flow clean-tts clean-voice
.PHONY: build-all build-rt build-batch build-flow build-tts build-voice build-sdk
.PHONY: clean-all clean-rt clean-batch clean-flow clean-tts clean-voice clean-sdk


help:
Expand All @@ -27,6 +27,7 @@ help:
@echo " format-flow Auto-fix formatting for Flow SDK"
@echo " format-tts Auto-fix formatting for TTS SDK"
@echo " format-voice Auto-fix formatting for Voice Agent SDK"
@echo " format-sdk Auto-fix formatting for SDK meta-package"
@echo ""
@echo "Linting:"
@echo " lint-all Run linting for all SDKs"
Expand All @@ -35,6 +36,7 @@ help:
@echo " lint-flow Run linting for Flow SDK"
@echo " lint-tts Run linting for TTS SDK"
@echo " lint-voice Run linting for Voice Agent SDK"
@echo " lint-sdk Run linting for SDK meta-package"
@echo ""
@echo "Type checking:"
@echo " type-check-all Run type checking for all SDKs"
Expand All @@ -43,6 +45,7 @@ help:
@echo " type-check-flow Run type checking for Flow SDK"
@echo " type-check-tts Run type checking for TTS SDK"
@echo " type-check-voice Run type checking for Voice Agent SDK"
@echo " type-check-sdk Run type checking for SDK meta-package"
@echo ""
@echo "Building:"
@echo " build-all Build all SDKs"
Expand All @@ -51,6 +54,7 @@ help:
@echo " build-flow Build Flow SDK"
@echo " build-tts Build TTS SDK"
@echo " build-voice Build Voice Agent SDK"
@echo " build-sdk Build SDK meta-package"
@echo ""
@echo "Cleaning:"
@echo " clean-all Clean all SDKs"
Expand All @@ -59,6 +63,7 @@ help:
@echo " clean-flow Clean Flow SDK build artifacts"
@echo " clean-tts Clean TTS SDK build artifacts"
@echo " clean-voice Clean Voice Agent SDK build artifacts"
@echo " clean-sdk Clean SDK meta-package build artifacts"
@echo ""

# Testing targets
Expand All @@ -79,7 +84,7 @@ test-voice:
pytest tests/voice/ -v -s

# Formatting targets
format-all: format-rt format-batch format-flow format-tts format-voice format-tests format-examples
format-all: format-rt format-batch format-flow format-tts format-voice format-sdk format-tests format-examples

format-rt:
cd sdk/rt/speechmatics && black .
Expand All @@ -101,6 +106,10 @@ format-voice:
cd sdk/voice/speechmatics && black .
cd sdk/voice/speechmatics && ruff check --fix .

format-sdk:
cd sdk/sdk/speechmatics && black .
cd sdk/sdk/speechmatics && ruff check --fix .

format-tests:
cd tests && black .
cd tests && ruff check --fix .
Expand All @@ -110,7 +119,7 @@ format-examples:
cd examples && ruff check --fix .

# Linting targets
lint-all: lint-rt lint-batch lint-flow lint-tts lint-voice
lint-all: lint-rt lint-batch lint-flow lint-tts lint-voice lint-sdk

lint-rt:
cd sdk/rt/speechmatics && ruff check .
Expand All @@ -127,8 +136,11 @@ lint-tts:
lint-voice:
cd sdk/voice/speechmatics && ruff check .

lint-sdk:
cd sdk/sdk/speechmatics && ruff check .

# Type checking targets
type-check-all: type-check-rt type-check-batch type-check-flow type-check-tts type-check-voice
type-check-all: type-check-rt type-check-batch type-check-flow type-check-tts type-check-voice type-check-sdk
type-check-rt:
cd sdk/rt/speechmatics && mypy .

Expand All @@ -144,6 +156,9 @@ type-check-tts:
type-check-voice:
cd sdk/voice/speechmatics && mypy .

type-check-sdk:
cd sdk/sdk/speechmatics && mypy .

# Installation targets
install-dev:
python -m pip install --upgrade pip
Expand All @@ -157,7 +172,7 @@ install-build:
python -m pip install --upgrade build

# Building targets
build-all: build-rt build-batch build-flow build-tts build-voice
build-all: build-rt build-batch build-flow build-tts build-voice build-sdk

build-rt: install-build
cd sdk/rt && python -m build
Expand All @@ -174,8 +189,11 @@ build-tts: install-build
build-voice: install-build
cd sdk/voice && python -m build

build-sdk: install-build
cd sdk/sdk && python -m build

# Cleaning targets
clean-all: clean-rt clean-batch clean-flow clean-tts clean-voice clean-test clean-examples
clean-all: clean-rt clean-batch clean-flow clean-tts clean-voice clean-sdk clean-test clean-examples
clean-rt:
rm -rf sdk/rt/dist sdk/rt/build sdk/rt/*.egg-info
find sdk/rt -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
Expand All @@ -196,6 +214,10 @@ clean-voice:
rm -rf sdk/voice/dist sdk/voice/build sdk/voice/*.egg-info
find sdk/voice -name __pycache__ -exec rm -rf {} + 2>/dev/null || true

clean-sdk:
rm -rf sdk/sdk/dist sdk/sdk/build sdk/sdk/*.egg-info
find sdk/sdk -name __pycache__ -exec rm -rf {} + 2>/dev/null || true

clean-test:
find tests -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
rm -rf .pytest_cache
Expand Down
23 changes: 5 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Speechmatics Python SDK

[![License](https://img.shields.io/badge/license-MIT-yellow.svg)](https://github.com/speechmatics/speechmatics-python-sdk/blob/master/LICENSE)
[![PythonSupport](https://img.shields.io/badge/Python-3.9%2B-green)](https://www.python.org/)

A collection of Python clients for Speechmatics APIs packaged as separate installable packages. These packages replace the old [speechmatics-python](https://pypi.org/project/speechmatics-python) package, which will be deprecated soon.

Expand All @@ -10,31 +11,23 @@ Each client targets a specific Speechmatics API (e.g. real-time, batch transcrip

This repository contains the following packages:

### (Beta) Real-Time Client (`speechmatics-rt`)
### Real-Time Client (`speechmatics-rt`)

A Python client for Speechmatics Real-Time API.

```bash
pip install speechmatics-rt
```

### (Beta) Batch Client (`speechmatics-batch`)
### Batch Client (`speechmatics-batch`)

An async Python client for Speechmatics Batch API.

```bash
pip install speechmatics-batch
```

### (Beta) Flow Client (`speechmatics-flow`)

An async Python client for Speechmatics Flow API.

```bash
pip install speechmatics-flow
```

### (Beta) Voice Agent Client (`speechmatics-voice`)
### Voice Agent Client (`speechmatics-voice`)

A Voice Agent Python client for Speechmatics Real-Time API.

Expand All @@ -46,7 +39,7 @@ pip install speechmatics-voice
pip install speechmatics-voice[smart]
```

### (Beta) TTS Client (`speechmatics-tts`)
### TTS Client (`speechmatics-tts`)

An async Python client for Speechmatics TTS API.

Expand All @@ -69,10 +62,6 @@ speechmatics-python-sdk/
│ │ ├── pyproject.toml
│ │ └── README.md
│ │
│ ├── flow/
│ │ ├── pyproject.toml
│ │ └── README.md
│ │
│ ├── voice/
│ │ ├── pyproject.toml
│ │ └── README.md
Expand All @@ -84,7 +73,6 @@ speechmatics-python-sdk/
├── tests/
│ ├── batch/
│ ├── rt/
│ ├── flow/
│ ├── voice/
│ └── tts/
Expand Down Expand Up @@ -126,7 +114,6 @@ Each package can be installed separately:
```bash
pip install speechmatics-rt
pip install speechmatics-batch
pip install speechmatics-flow
pip install speechmatics-voice[smart]
pip install speechmatics-tts
```
Expand Down
Loading
Loading