Skip to content

Commit d02a2ba

Browse files
committed
ci: pin tooling deps and add dependency smoke test
Pin the previously-loose pip deps (pydantic==2.13.4, mcp==1.27.2, python-dotenv==1.2.2) so Dependabot bumps from a concrete baseline. Add a Dependency Smoke Test workflow that installs each requirements.txt in a clean venv, py_compiles the scripts, and imports them to catch a bad bump (or new python) breaking the helper scripts. Triggers on requirements.txt and *.py changes under scripts/.
1 parent 60cc248 commit d02a2ba

3 files changed

Lines changed: 77 additions & 3 deletions

File tree

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: "Dependency Smoke Test"
2+
3+
# Sanity-check that the pip-installed helper scripts still install and import
4+
# after a dependency bump. Primarily a guard for Dependabot PRs that touch a
5+
# requirements.txt, but also runs on any edit to the scripts themselves.
6+
on:
7+
pull_request:
8+
paths:
9+
- "scripts/**/requirements.txt"
10+
- "scripts/**/*.py"
11+
- ".github/workflows/dependency-smoke.yml"
12+
13+
# Cancel in-progress runs of this workflow if a new run is triggered.
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
16+
cancel-in-progress: true
17+
18+
permissions:
19+
contents: read
20+
21+
jobs:
22+
smoke:
23+
name: "Smoke: ${{ matrix.dir }}"
24+
runs-on: ubuntu-latest
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
dir:
29+
- scripts/ci/control-tower
30+
- scripts/ci/spec-review
31+
- scripts/mcps
32+
steps:
33+
- name: Checkout
34+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
35+
with:
36+
persist-credentials: false
37+
38+
- name: Install and smoke-test
39+
env:
40+
DIR: ${{ matrix.dir }}
41+
run: |
42+
set -euo pipefail
43+
cd "$DIR"
44+
45+
# A clean venv ensures we exercise exactly the pinned requirements.
46+
python3 -m venv .smoke-venv
47+
# shellcheck disable=SC1091
48+
. .smoke-venv/bin/activate
49+
python -m pip install --quiet --upgrade pip
50+
pip install --quiet -r requirements.txt
51+
52+
shopt -s nullglob
53+
scripts=( *.py )
54+
if (( ${#scripts[@]} == 0 )); then
55+
echo "No python scripts in $DIR; install-only smoke passed."
56+
exit 0
57+
fi
58+
59+
# Syntax-compile every script (works regardless of filename).
60+
python -m py_compile "${scripts[@]}"
61+
62+
# Import each importable module to exercise the bumped dependencies.
63+
# Skip files whose name is not a valid module identifier (e.g. hyphenated).
64+
for f in "${scripts[@]}"; do
65+
mod="${f%.py}"
66+
case "$mod" in
67+
*[!a-zA-Z0-9_]*)
68+
echo "skip import: $f (filename is not a valid module name)"
69+
continue
70+
;;
71+
esac
72+
echo "import $mod"
73+
python -c "import $mod"
74+
done
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
pydantic>=2.0
1+
pydantic==2.13.4

scripts/mcps/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
mcp
2-
python-dotenv
1+
mcp==1.27.2
2+
python-dotenv==1.2.2

0 commit comments

Comments
 (0)