Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
d5d98d9
Allow `codex` to run `pip-audit`
benglewis Feb 4, 2026
f211aca
Install `pip-audit` as a development dependency
benglewis Feb 4, 2026
2b352db
Switch to `dependency-groups` for development to match better modern …
benglewis Feb 4, 2026
b69a1a3
Migrate fully to `uv`
benglewis Feb 4, 2026
84dfb86
Add `AGENTS.md`
benglewis Feb 4, 2026
eb0f3d4
Fix vulnerability scan GitHub Actions workflow scanning the `pyprojec…
benglewis Feb 4, 2026
ea09765
Fix vulnerabilities
benglewis Feb 4, 2026
7192438
Update `AGENTS.md`
benglewis Feb 4, 2026
c37898e
Upgrade `uv` version in `pyproject.toml` to fix issues with agent usage
benglewis Feb 4, 2026
7bc0a86
Merge branch 'main' into sdk-87-allow-codex-to-run-pip-audit-and-fix-…
benglewis Feb 4, 2026
d75f190
Fix bugs found by agent code reviewers
benglewis Feb 4, 2026
d6f9e18
Fix `pip-audit` rule
benglewis Feb 4, 2026
7232248
Fix agent code review comments
benglewis Feb 4, 2026
fea3606
Skip local install in docs workflow
benglewis Feb 4, 2026
cd4b0ec
Fix Windows venv activation and uv setup
benglewis Feb 4, 2026
c92eb9a
Align cleanup workflow uv setup
benglewis Feb 4, 2026
ef7b6c6
Merge branch 'main' into sdk-87-allow-codex-to-run-pip-audit-and-fix-…
benglewis Feb 5, 2026
433464f
Align `.envrc` with `pre-commit` and docs and other development recom…
benglewis Feb 5, 2026
2ec8051
Fix `jaraco-context` vulnerability by upgrading
benglewis Feb 5, 2026
6ee5ab2
Change vulnerability scan to run on the `uv` environment with `lowest…
benglewis Feb 5, 2026
8b97a70
Fix release flow by re-running PyTest sanity and vulnerability scanni…
benglewis Feb 5, 2026
c984178
Drop irrelevant `matrix` from `vulnerability-scan.yml`
benglewis Feb 8, 2026
46a487c
Ensure that `uv`'s `venv` is activated before scanning for vulnerabil…
benglewis Feb 8, 2026
94b89a4
Align `uv venv` and activation order in `vulnerability-scan.yml`
benglewis Feb 8, 2026
69a8430
Change `vulnerability-scan.yml` to install all `groups` and all `extr…
benglewis Feb 8, 2026
a8a5e9f
Fix `deploy-docker-image.yaml` disk space issues by changing GitHub A…
benglewis Feb 8, 2026
0f16ab0
Fix Cursor's bugbot's comment about `vulnerability-scan.yml` specific…
benglewis Feb 8, 2026
c74d696
Update workflows to use setup-uv
benglewis Feb 8, 2026
d2d3668
Add deploy-only dependency group
benglewis Feb 8, 2026
6abef50
Fix vulnerabilities
benglewis Feb 10, 2026
062512a
Fix NumPy being compiled for macOS (which is silly)
benglewis Feb 10, 2026
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
6 changes: 6 additions & 0 deletions .codex/environments/environment.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# THIS IS AUTOGENERATED. DO NOT EDIT MANUALLY
version = 1
name = "hirundo-python-sdk"

[setup]
script = "uv sync --group dev && source .venv/bin/activate"
13 changes: 13 additions & 0 deletions .codex/rules/pip-audit.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
prefix_rule(
pattern = ["UV_CACHE_DIR=/tmp/uv-cache", "uv", "run", "pip-audit"],
decision = "allow",
justification = "pip-audit is allowed to run",
match = [
"'UV_CACHE_DIR=/tmp/uv-cache' uv run pip-audit",
],
not_match = [
"uv run abc",
"uv run pip-audit",
"uvx pip-audit",
],
Comment thread
cursor[bot] marked this conversation as resolved.
)
2 changes: 1 addition & 1 deletion .envrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
watch_file uv.lock
uv sync --group dev && source .venv/bin/activate
uv sync --all-groups && source .venv/bin/activate
10 changes: 2 additions & 8 deletions .github/workflows/cleanup-test-artifacts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v6
- name: Set up uv
uses: astral-sh/setup-uv@v7
Comment thread
benglewis marked this conversation as resolved.
with:
python-version: '3.11'
cache: 'pip'
- name: Set up uv 0.9.6
uses: astral-sh/setup-uv@v3
with:
version: '0.9.6'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
uv venv
uv sync --extra polars
- name: Run cleanup script
Expand Down
13 changes: 5 additions & 8 deletions .github/workflows/create-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,17 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.ref }}
- name: Set up Python
uses: actions/setup-python@v6
with:
cache: 'pip'
- name: Install uv
- name: Set up uv
uses: astral-sh/setup-uv@v7
with:
python-version: '3.11'
- name: Bump version with `bumpver` then push tag
env:
GH_TOKEN: ${{ github.token }}
run: |
python -m pip install --upgrade pip
python -m venv .venv
uv venv
source .venv/bin/activate
pip install bumpver
uv pip install bumpver
git config user.name "GitHub Actions [release-bot]"
git config user.email "github-actions@hirundo.io"
git checkout -b release-${{ github.event.inputs.version }}
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/deploy-docker-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,14 @@ permissions:
jobs:
build-and-push:
if: (startsWith(github.ref, 'refs/tags/v') && contains(github.ref, '+on-prem')) || github.event_name == 'pull_request'
runs-on: ubuntu-latest
runs-on: ubuntu-latest-small-docker

steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
install: true
platforms: linux/amd64
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
Expand All @@ -43,7 +42,7 @@ jobs:
uses: actions/cache@v4
with:
path: opt-uv
key: opt-uv-${{ hashFiles('requirements/*') }}
key: opt-uv-${{ hashFiles('uv.lock') }}
- name: inject uv cache into docker
# v1 was composed of two actions: "inject" and "extract".
# v2 is unified to a single action.
Expand Down
11 changes: 3 additions & 8 deletions .github/workflows/deploy-to-pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.base.ref }}
- name: Set up Python
uses: actions/setup-python@v6
with:
cache: 'pip'
- uses: astral-sh/setup-uv@v7
- name: Push tag with release
env:
GH_TOKEN: ${{ github.token }}
Expand All @@ -44,11 +41,9 @@ jobs:
git push origin ${{ github.event.pull_request.title }}
- name: Install dependencies & build package
run: |
python -m pip install --upgrade pip
Comment thread
benglewis marked this conversation as resolved.
Comment thread
benglewis marked this conversation as resolved.
python -m venv .venv
uv venv
source .venv/bin/activate
pip install -r requirements/dev.txt
pip install build twine
uv sync --only-group deploy --no-install-project
python -m build
- name: Publish package distributions to TestPyPI (with act)
env:
Expand Down
16 changes: 6 additions & 10 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,13 @@ jobs:
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v6
- uses: astral-sh/setup-uv@v7
with:
cache: 'pip'
python-version: ${{ matrix.python-version }}
- run: |
python -m pip install --upgrade pip
python -m venv .venv
uv venv
source .venv/bin/activate
pip install -r requirements/dev.txt -r requirements/pandas.txt -r requirements/polars.txt -r requirements/transformers.txt
uv sync --group dev
- run: echo "$PWD/.venv/bin" >> $GITHUB_PATH
- uses: astral-sh/ruff-action@v3
- run: ruff check
Expand All @@ -42,14 +40,12 @@ jobs:
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v6
- uses: astral-sh/setup-uv@v7
with:
cache: 'pip'
python-version: ${{ matrix.python-version }}
- run: |
python -m pip install --upgrade pip
python -m venv .venv
uv venv
source .venv/bin/activate
pip install -r requirements/dev.txt -r requirements/pandas.txt -r requirements/polars.txt -r requirements/transformers.txt
uv sync --group dev
- run: echo "$PWD/.venv/bin" >> $GITHUB_PATH
- run: basedpyright
10 changes: 3 additions & 7 deletions .github/workflows/pytest-full.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,12 @@ jobs:
env: RUN_COCO_OD_GCP_SANITY_DATA_QA
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v6
with:
cache: 'pip'
- uses: astral-sh/setup-uv@v7
- name: Install dependencies on Linux and macOS
run: |
python -m pip install --upgrade pip
python -m venv .venv
uv venv
source .venv/bin/activate
pip install -r requirements/dev.txt -r requirements/polars.txt -r requirements/transformers.txt
uv sync --group dev
- name: Run PyTest
run: .venv/bin/pytest tests/${{ matrix.data-qa-test['test'] }}
env:
Expand Down
18 changes: 8 additions & 10 deletions .github/workflows/pytest-sanity.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Run sanity tests with PyTest

on:
pull_request:
types: [opened, synchronize]
types: [opened, synchronize, reopened, assigned]
push:
branches:
- "main"
Expand Down Expand Up @@ -46,24 +46,22 @@ jobs:
fi
- name: Set up Python
if: github.event_name != 'pull_request' && steps.changes.outputs.non_workflow == 'true'
uses: actions/setup-python@v6
uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies on Linux and macOS
if: github.event_name != 'pull_request' && runner.os != 'Windows' && steps.changes.outputs.non_workflow == 'true'
run: |
python -m pip install --upgrade pip
python -m venv .venv
uv venv
source .venv/bin/activate
pip install -r requirements/dev.txt -r requirements/polars.txt -r requirements/transformers.txt
uv sync --group dev
- name: Run commands on Windows
if: github.event_name != 'pull_request' && runner.os == 'Windows' && steps.changes.outputs.non_workflow == 'true'
shell: pwsh
run: |
python -m pip install --upgrade 'pip>=24.1.2'
python -m venv .venv
.venv\Scripts\activate
python -m pip install -r requirements\dev.txt -r requirements\polars.txt -r requirements\transformers.txt
uv venv
& .\.venv\Scripts\Activate.ps1
uv sync --group dev
Comment thread
benglewis marked this conversation as resolved.
- name: Run PyTest on Linux and macOS
if: github.event_name != 'pull_request' && runner.os != 'Windows' && steps.changes.outputs.non_workflow == 'true'
run: .venv/bin/pytest
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/update-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,15 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all tags and branches
- uses: actions/setup-python@v6
with:
cache: 'pip'
- uses: astral-sh/setup-uv@v7
- name: Install dependencies
timeout-minutes: 5
env:
SLEEP: 15
run: |
python -m pip install --upgrade pip
python -m venv .venv
uv venv
source .venv/bin/activate
pip install -r requirements/docs.txt
uv sync --only-group docs --no-install-project
# Extract version from hirundo/__init__.py with error handling
if [ -f "hirundo/__init__.py" ]; then
export VERSION=$(python -c "import re; content=open('hirundo/__init__.py').read(); match=re.search(r'__version__ = [\"\'](.*?)[\"\']', content); print(match.group(1) if match else 'unknown')" 2>/dev/null || echo 'unknown')
Expand All @@ -56,7 +53,7 @@ jobs:
exit 1
fi

until pip install --no-cache-dir "hirundo==${VERSION}"; do
until uv pip install --no-cache-dir "hirundo==${VERSION}"; do
echo "Can't find the version you mentioned, waiting $SLEEP seconds and retrying"
sleep $SLEEP
echo "finish waiting. retrying..."
Expand Down
20 changes: 9 additions & 11 deletions .github/workflows/vulnerability-scan.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Vulnerability scan
on:
pull_request:
types: [opened, synchronize]
types: [opened, synchronize, reopened, assigned]
merge_group:
types: [checks_requested]
push:
Expand All @@ -16,15 +16,6 @@ concurrency:

jobs:
vulnerability-scan:
strategy:
matrix:
requirements:
- requirements/requirements.txt
- requirements/dev.txt
- requirements/docs.txt
- requirements/pandas.txt
- requirements/polars.txt
- requirements/transformers.txt
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -34,7 +25,14 @@ jobs:
- name: No-op on pull_request
if: github.event_name == 'pull_request'
run: echo "Skipping vulnerability scan on PR; marking job success."
- uses: astral-sh/setup-uv@v7
if: github.event_name != 'pull_request'
- if: github.event_name != 'pull_request'
run: |
uv venv
source .venv/bin/activate
uv sync --resolution lowest-direct --all-groups --all-extras
- uses: pypa/gh-action-pip-audit@v1.1.0
if: github.event_name != 'pull_request'
with:
inputs: ${{ matrix.requirements }}
virtual-environment: .venv
64 changes: 9 additions & 55 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,63 +16,17 @@ repos:
- id: ruff-format
- repo: local
hooks:
- id: basedpyright
name: basedpyright
entry: basedpyright
language: python
types: [python]
pass_filenames: false
additional_dependencies: [basedpyright==1.37.1]
- id: pip-compile
name: compile requirements/requirements.txt
entry: uv
Comment thread
benglewis marked this conversation as resolved.
args: ["pip", "compile", "-o", "requirements/requirements.txt"]
language: python
always_run: false
files: pyproject.toml$
additional_dependencies: [uv]
- id: pip-compile-dev
name: compile requirements/dev.txt
entry: uv
args: ["pip", "compile", "--extra", "dev", "-o", "requirements/dev.txt", "-c", "requirements/requirements.txt"]
language: python
always_run: false
files: pyproject.toml$
additional_dependencies: [uv]
- id: pip-compile-pandas
name: compile requirements/pandas.txt
entry: uv
args: ["pip", "compile", "--extra", "pandas", "-o", "requirements/pandas.txt", "-c", "requirements/requirements.txt"]
language: python
files: pyproject.toml$
additional_dependencies: [uv]
- id: pip-compile-polars
name: compile requirements/polars.txt
entry: uv
args: ["pip", "compile", "--extra", "polars", "-o", "requirements/polars.txt", "-c", "requirements/requirements.txt"]
language: python
files: pyproject.toml$
additional_dependencies: [uv]
- id: pip-compile-docs
name: compile requirements/docs.txt
entry: uv
args: ["pip", "compile", "--extra", "docs", "-o", "requirements/docs.txt", "-c", "requirements/requirements.txt"]
language: python
always_run: false
files: pyproject.toml$
additional_dependencies: [uv]
- id: pip-compile-transformers
name: compile requirements/transformers.txt
entry: uv
args: ["pip", "compile", "--extra", "transformers", "-o", "requirements/transformers.txt", "-c", "requirements/requirements.txt"]
language: python
always_run: false
files: pyproject.toml$
additional_dependencies: [uv]
- id: basedpyright
name: basedpyright
entry: basedpyright
language: python
types: [python]
pass_filenames: false
additional_dependencies: [basedpyright==1.37.1]
- repo: https://github.com/astral-sh/uv-pre-commit
# uv version.
rev: 0.9.6
rev: 0.9.29
hooks:
- id: uv-lock
- id: uv-sync
args: ["--group", "dev"]
args: ["--all-groups"]
Comment thread
benglewis marked this conversation as resolved.
Loading