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
4 changes: 2 additions & 2 deletions .github/workflows/publish_asr_worker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ jobs:
uses: astral-sh/setup-uv@v7
with:
version: "0.10.8"
- name: Install Python 3.11
run: uv python install 3.11
- name: Install Python 3.12
run: uv python install 3.12
- name: Build
run: cd workers/asr-worker && uv build
- name: Publish
Expand Down
87 changes: 87 additions & 0 deletions .github/workflows/publish_caul.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Publish caul

on:
workflow_dispatch:
push:
tags:
- 'caul-*'
- '!caul-core-*'

jobs:
create-release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v6
- name: Create GH release
run: gh release create "$tag" --generate-notes
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}

publish-caul-to-pypi:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
environment:
name: pypi
url: https://pypi.org/p/caul
steps:
- uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "0.10.8"
- name: Install Python 3.12
run: uv python install 3.12
- name: Set version from tag
run: |
if [ "$GITHUB_REF_TYPE" != "tag" ]; then
echo "must be run from a caul-* tag, got $GITHUB_REF_TYPE $GITHUB_REF_NAME" >&2
exit 1
fi
cd caul
uv version --frozen "${GITHUB_REF_NAME#caul-}"
- name: Build
run: cd caul && uv build
- name: Publish
run: cd caul && uv publish

sync-caul-version:
permissions:
contents: write
needs:
- publish-caul-to-pypi
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
# main, not the tag: the tag may point at a commit whose
# pyproject.toml doesn't have this version yet
ref: main
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "0.10.8"
- name: Sync pyproject.toml version with tag
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
version="${GITHUB_REF_NAME#caul-}"
cd caul
uv version --frozen "$version"
git add pyproject.toml
if git diff --cached --quiet; then
echo "pyproject.toml already at $version, nothing to sync"
else
git commit -m "release(caul): \`caul==$version\`"
git pull --rebase
git push
fi

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
86 changes: 86 additions & 0 deletions .github/workflows/publish_caul_core.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Publish caul-core

on:
workflow_dispatch:
push:
tags:
- 'caul-core-*'

jobs:
create-release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v6
- name: Create GH release
run: gh release create "$tag" --generate-notes
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}

publish-caul-core-to-pypi:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
environment:
name: pypi
url: https://pypi.org/p/caul-core
steps:
- uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "0.10.8"
- name: Install Python 3.12
run: uv python install 3.12
- name: Set version from tag
run: |
if [ "$GITHUB_REF_TYPE" != "tag" ]; then
echo "must be run from a caul-core-* tag, got $GITHUB_REF_TYPE $GITHUB_REF_NAME" >&2
exit 1
fi
cd caul-core
uv version --frozen "${GITHUB_REF_NAME#caul-core-}"
- name: Build
run: cd caul-core && uv build
- name: Publish
run: cd caul-core && uv publish

sync-caul-core-version:
permissions:
contents: write
needs:
- publish-caul-core-to-pypi
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
# main, not the tag: the tag may point at a commit whose
# pyproject.toml doesn't have this version yet
ref: main
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "0.10.8"
- name: Sync pyproject.toml version with tag
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
version="${GITHUB_REF_NAME#caul-core-}"
cd caul-core
uv version --frozen "$version"
git add pyproject.toml
if git diff --cached --quiet; then
echo "pyproject.toml already at $version, nothing to sync"
else
git commit -m "release(caul-core): \`caul-core==$version\`"
git pull --rebase
git push
fi

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
2 changes: 2 additions & 0 deletions .github/workflows/test_asr_worker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
paths:
- 'datashare-python/**'
- 'workers/asr-worker/**'
- 'caul/**'
- 'caul-core/**'

# TODO: leverage some caching here
jobs:
Expand Down
59 changes: 59 additions & 0 deletions .github/workflows/test_caul.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Test caul

on:
push:
branches: [ 'main' ]
paths:
- 'caul/**.py'
- 'caul/pyproject.toml'
- 'caul/uv.lock'
- 'caul-core/**.py'
- 'caul-core/pyproject.toml'
- 'caul-core/uv.lock'
pull_request:
paths:
- 'caul/**.py'
- 'caul/pyproject.toml'
- 'caul/uv.lock'
- 'caul-core/**.py'
- 'caul-core/pyproject.toml'
- 'caul-core/uv.lock'

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: astral-sh/ruff-action@v4.1.0
with:
args: "--version" # skips test by displaying the version
version: "0.16.1"
- name: Check formatting
run: ruff format --config qa/ruff.toml --check caul caul-core
- name: Lint test
run: ruff check --config qa/ruff.toml caul caul-core

test:
runs-on: ubuntu-latest
env:
PYTHON_VERSION: 3.12
ASTRAL_VERSION: 0.11.6
steps:
- uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: ${{ env.ASTRAL_VERSION }}
python-version: ${{ env.PYTHON_VERSION }}
enable-cache: true
working-directory: caul
- name: Install ffmpeg
run: sudo apt-get update && sudo apt-get install -y ffmpeg
- name: Run tests
run: |
cd caul
uv run --frozen --dev --extra preprocessing --extra nemo --extra pyannote --extra fireredasr2 --extra faster-whisper --extra cpu python -m pytest -vvv --cache-clear --show-capture=all -r A tests -m "not no_ci"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
1 change: 1 addition & 0 deletions caul-core/.python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.13
3 changes: 3 additions & 0 deletions caul-core/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Core caul objects

Separates core configs and objects for separate import without having to pull in heavier `caul` dependencies.
Loading
Loading