Skip to content

Commit 02c70b7

Browse files
authored
Merge branch 'main' into dev
2 parents 3a2de88 + 584f979 commit 02c70b7

File tree

6 files changed

+183
-59
lines changed

6 files changed

+183
-59
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: 'Setup Python Environment'
2+
description: 'Setup Python, uv, cache, and install dependencies'
3+
4+
inputs:
5+
python-version:
6+
description: 'Python version to setup'
7+
required: true
8+
default: '3.13'
9+
10+
runs:
11+
using: 'composite'
12+
steps:
13+
- name: Set up Python ${{ inputs.python-version }}
14+
uses: actions/setup-python@v4
15+
with:
16+
python-version: ${{ inputs.python-version }}
17+
18+
- name: Install system dependencies
19+
run: |
20+
sudo apt-get update
21+
sudo apt-get install -y ffmpeg
22+
shell: bash
23+
24+
- name: Install uv
25+
uses: astral-sh/setup-uv@v4
26+
with:
27+
version: "latest"
28+
29+
- name: Setup uv cache
30+
uses: actions/cache@v3
31+
with:
32+
path: |
33+
~/.cache/uv
34+
key: ${{ runner.os }}-uv-${{ inputs.python-version }}-${{ hashFiles('**/uv.lock') }}
35+
restore-keys: |
36+
${{ runner.os }}-uv-${{ inputs.python-version }}-
37+
${{ runner.os }}-uv-
38+
39+
- name: Install dependencies
40+
run: uv sync --group test --group extras
41+
shell: bash

.github/workflows/main.yml

Lines changed: 0 additions & 45 deletions
This file was deleted.

.github/workflows/pr-checks.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Code Quality
2+
3+
env:
4+
COVERAGE_THRESHOLD: 50
5+
VULTURE_MIN_CONFIDENCE: 80
6+
SCAN_PATHS: 'src tests'
7+
8+
on:
9+
pull_request:
10+
types: [ opened, synchronize, reopened ]
11+
12+
jobs:
13+
ruff-check:
14+
name: Ruff
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
python-version: [ "3.13" ]
19+
steps:
20+
- uses: actions/checkout@v3
21+
- uses: ./.github/actions/setup-python-env
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
25+
- name: Run Ruff linter
26+
run: uv run ruff check --output-format=github ${{ env.SCAN_PATHS }}
27+
28+
- name: Run Ruff formatter check
29+
run: uv run ruff format --check --diff ${{ env.SCAN_PATHS }}
30+
31+
dead-code-check:
32+
name: Vulture
33+
runs-on: ubuntu-latest
34+
strategy:
35+
matrix:
36+
python-version: [ "3.13" ]
37+
steps:
38+
- uses: actions/checkout@v3
39+
- uses: ./.github/actions/setup-python-env
40+
with:
41+
python-version: ${{ matrix.python-version }}
42+
43+
- name: Run Vulture dead code detector
44+
run: uv run vulture --min-confidence ${{ env.VULTURE_MIN_CONFIDENCE }} ${{ env.SCAN_PATHS }}
45+
46+
coverage:
47+
name: Coverage Report
48+
runs-on: ubuntu-latest
49+
strategy:
50+
matrix:
51+
python-version: [ "3.13" ]
52+
steps:
53+
- uses: actions/checkout@v3
54+
- uses: ./.github/actions/setup-python-env
55+
with:
56+
python-version: ${{ matrix.python-version }}
57+
58+
- name: Run coverage analysis
59+
run: |
60+
uv run pytest ${{ env.SCAN_PATHS }} \
61+
--cov=src \
62+
--cov-report=xml \
63+
--cov-report=term \
64+
--cov-fail-under=${{ env.COVERAGE_THRESHOLD }}
65+
66+
# - name: Upload coverage to Codecov (optional)
67+
# uses: codecov/codecov-action@v3
68+
# if: always()
69+
# with:
70+
# file: ./coverage.xml
71+
# fail_ci_if_error: false

.github/workflows/push-checks.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Code Quality
2+
3+
env:
4+
COVERAGE_THRESHOLD: 50
5+
VULTURE_MIN_CONFIDENCE: 80
6+
7+
on: [ push ]
8+
9+
jobs:
10+
type-check:
11+
name: Pyright
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
python-version: [ "3.13" ]
16+
steps:
17+
- uses: actions/checkout@v3
18+
- uses: ./.github/actions/setup-python-env
19+
with:
20+
python-version: ${{ matrix.python-version }}
21+
22+
- name: Run Pyright type checker
23+
run: uv run pyright
24+
25+
tests:
26+
name: Tests
27+
runs-on: ubuntu-latest
28+
strategy:
29+
matrix:
30+
python-version: [ "3.13" ]
31+
steps:
32+
- uses: actions/checkout@v3
33+
- uses: ./.github/actions/setup-python-env
34+
with:
35+
python-version: ${{ matrix.python-version }}
36+
37+
- name: Run tests
38+
run: uv run pytest

.github/workflows/release.yml

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,31 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout code
13-
uses: actions/checkout@v2
13+
uses: actions/checkout@v3
1414

1515
- name: Set up Python
16-
uses: actions/setup-python@v2
16+
uses: actions/setup-python@v4
1717
with:
18-
python-version: 3.10
18+
python-version: "3.11"
1919

2020
- name: Install Poetry
21-
run: |
22-
curl -sSL https://install.python-poetry.org | python3 -
21+
uses: snok/install-poetry@v1
22+
with:
23+
version: 2.1.1
24+
virtualenvs-create: true
25+
virtualenvs-in-project: true
26+
27+
- name: Setup Poetry cache
28+
uses: actions/cache@v3
29+
with:
30+
path: |
31+
~/.cache/pypoetry
32+
~/.cache/pip
33+
.venv
34+
key: ${{ runner.os }}-poetry-release-${{ hashFiles('**/poetry.lock') }}
35+
restore-keys: |
36+
${{ runner.os }}-poetry-release-
37+
${{ runner.os }}-poetry-
2338
2439
- name: Build package
2540
run: |
@@ -37,7 +52,7 @@ jobs:
3752
prerelease: false
3853
- name: Extract version
3954
id: get_version
40-
run: echo "::set-output name=version::$(python -c 'import calmlib; print(calmlib.__version__)')"
55+
run: echo "version=$(poetry version -s)" >> $GITHUB_OUTPUT
4156

4257
- name: Upload Release Asset
4358
id: upload-release-asset
@@ -46,13 +61,12 @@ jobs:
4661
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4762
with:
4863
upload_url: ${{ steps.create_release.outputs.upload_url }}
49-
asset_path: ./dist/calmlib-${{ steps.get_version.outputs.version }}.tar.gz
50-
asset_name: calmlib-${{ steps.get_version.outputs.version }}.tar.gz
64+
asset_path: ./dist/botspot-${{ steps.get_version.outputs.version }}.tar.gz
65+
asset_name: botspot-${{ steps.get_version.outputs.version }}.tar.gz
5166
asset_content_type: application/gzip
5267

5368
- name: Publish package
54-
uses: pypa/gh-action-pypi-publish@master
69+
uses: pypa/gh-action-pypi-publish@release/v1
5570
with:
56-
user: __token__
5771
password: ${{ secrets.PYPI_TOKEN }}
5872

dev/todo.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
11
# Todos
22

3+
## 30 May 2025
4+
5+
- [ ] add model picker for chat? permanent / per-message
6+
- [ ] bind and log all usage just for fun
7+
38
## New architecture grok discussion
49
https://grok.com/share/bGVnYWN5_832ecdcb-8083-4ef7-bfbf-9ab8411d8697
510

611
## Todos - 26 May
712

8-
- [ ] make sure the bot works for other users (and i have control over who) - try botspot friends
13+
- [x] make sure the bot works for other users (and i have control over who) - try botspot friends
914
- [ ] make sure the bot works for anonymous users - and I have control over how much. Did I already implemnt this?
1015

11-
- [ ] add explicitly models for transcript, chat, format and summary in app and User config
16+
- [x] add explicitly models for transcript, chat, format and summary in app and User config
1217
- [ ] implement better user settings component - handler etc.
1318

14-
- [ ] report user on our progress - update status message along the way
15-
- [ ] make a nice timing report in the end (total time to transcribe, details?)
19+
- [x] report user on our progress - update status message along the way
20+
- [x] make a nice timing report in the end (total time to transcribe, details?)
1621
- Nah, need a way to view it but not in their face
1722

1823
## 25 May 2025

0 commit comments

Comments
 (0)