Skip to content

Commit 6bc1c96

Browse files
committed
ci: add test + publish workflows for the Inspect integration package
1 parent af18c04 commit 6bc1c96

2 files changed

Lines changed: 122 additions & 0 deletions

File tree

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# ─── Before the first publish (integrations-inspect-python-v0.1.0) ───────────
2+
#
3+
# 1. Tighten the SDK dependency. integrations/inspect-python/pyproject.toml pins
4+
# `learning-commons-evaluators>=0.2.0`, but the integration requires the
5+
# LLMGeneratorProtocol / llm_provider support that ships in SDK 0.3.0. Raise
6+
# the floor to `>=0.3.0` once 0.3.0 is on PyPI — and do not publish this
7+
# package before then, or installs resolve a SDK without llm_provider.
8+
#
9+
# 2. Remove `release-as: "0.1.0"` from the integrations/inspect-python block in
10+
# release-please-config.json IMMEDIATELY after 0.1.0 lands on PyPI. It is a
11+
# sticky pin: every later release-please PR stays at 0.1.0 until removed, and
12+
# `skip-existing: true` below silently hides the duplicate-version rejection.
13+
#
14+
# ─────────────────────────────────────────────────────────────────────────────
15+
16+
name: Publish Inspect integration
17+
18+
on:
19+
release:
20+
types: [published]
21+
workflow_dispatch:
22+
23+
jobs:
24+
publish:
25+
if: github.event_name == 'workflow_dispatch' || startsWith(github.event.release.tag_name, 'integrations-inspect-python-v')
26+
runs-on: ubuntu-latest
27+
environment: pypi
28+
permissions:
29+
contents: read
30+
id-token: write
31+
defaults:
32+
run:
33+
working-directory: integrations/inspect-python
34+
concurrency:
35+
group: publish-inspect-python
36+
cancel-in-progress: false
37+
steps:
38+
- name: ⬇️ Checkout repo
39+
uses: actions/checkout@v6
40+
41+
- name: 🐍 Setup Python
42+
uses: actions/setup-python@v6
43+
with:
44+
python-version: "3.13"
45+
46+
- name: 📥 Install build tooling
47+
run: python -m pip install --upgrade build twine
48+
49+
- name: 📦 Build sdist + wheel
50+
run: python -m build
51+
52+
- name: 🧪 Validate distribution metadata
53+
run: python -m twine check dist/*
54+
55+
- name: 🚀 Publish to PyPI
56+
uses: pypa/gh-action-pypi-publish@release/v1
57+
with:
58+
packages-dir: integrations/inspect-python/dist
59+
skip-existing: true
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: 🔍 Test Inspect integration
2+
3+
# Runs only when the integration package itself changes, or when the Python SDK
4+
# it depends on changes (a SDK change — including a version bump — can break the
5+
# integration, so we re-verify here too).
6+
on:
7+
push:
8+
branches:
9+
- main
10+
paths:
11+
- "integrations/inspect-python/**"
12+
- "sdks/python/**"
13+
- "sdks/settings/**"
14+
- ".github/workflows/test-inspect-python.yml"
15+
pull_request:
16+
paths:
17+
- "integrations/inspect-python/**"
18+
- "sdks/python/**"
19+
- "sdks/settings/**"
20+
- ".github/workflows/test-inspect-python.yml"
21+
22+
permissions:
23+
contents: read
24+
25+
concurrency:
26+
group: ${{ github.workflow }}-${{ github.ref }}
27+
cancel-in-progress: true
28+
29+
jobs:
30+
verify:
31+
name: Verify (Python ${{ matrix.python-version }})
32+
runs-on: ubuntu-latest
33+
strategy:
34+
matrix:
35+
python-version: ["3.10", "3.11", "3.12", "3.13"]
36+
steps:
37+
- name: Checkout
38+
uses: actions/checkout@v6
39+
40+
- name: Set up Python ${{ matrix.python-version }}
41+
uses: actions/setup-python@v6
42+
with:
43+
python-version: ${{ matrix.python-version }}
44+
45+
- name: Install in-repo SDK + integration package
46+
# Install the SDK from source first: the integration relies on
47+
# LLMGeneratorProtocol (SDK >=0.3.0), which is not yet on PyPI. The
48+
# editable install satisfies the >=0.2.0 floor while providing the
49+
# unreleased protocol code, so CI tests against current monorepo state.
50+
run: |
51+
python -m pip install --upgrade pip
52+
pip install -e ./sdks/python
53+
pip install -e "./integrations/inspect-python[dev]"
54+
55+
- name: Lint
56+
working-directory: integrations/inspect-python
57+
run: |
58+
python -m ruff check .
59+
python -m ruff format --check .
60+
61+
- name: Test
62+
working-directory: integrations/inspect-python
63+
run: python -m pytest

0 commit comments

Comments
 (0)