Skip to content

Commit 5f36794

Browse files
authored
Merge pull request #91 from datasciencemonkey/marshall/uv-update
chore: migrate to uv with supply-chain guardrails
2 parents 467aa71 + dc54f9a commit 5f36794

6 files changed

Lines changed: 76 additions & 4 deletions

File tree

.github/workflows/dependency-audit.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,22 @@ jobs:
2727
with:
2828
python-version: "3.11"
2929

30+
- name: Install uv
31+
uses: astral-sh/setup-uv@v5
32+
3033
- name: Install audit tools
31-
run: pip install pip-audit==2.9.0 uv==0.7.12
34+
run: pip install pip-audit==2.9.0
35+
36+
- name: Compile requirements.txt from pyproject.toml
37+
run: |
38+
# Keep requirements.txt in sync with pyproject.toml so Dependabot can scan it.
39+
# Note: [tool.uv.sources] git overrides are not resolved by pip compile —
40+
# requests and cryptography fall back to their PyPI versions here, which is
41+
# intentional for Dependabot's purposes.
42+
uv pip compile pyproject.toml -o /tmp/requirements.compiled.txt
43+
if ! diff -q requirements.txt /tmp/requirements.compiled.txt > /dev/null 2>&1; then
44+
echo "::warning::requirements.txt is out of date with pyproject.toml. Run: uv pip compile pyproject.toml -o requirements.txt"
45+
fi
3246
3347
- name: Audit pinned dependencies
3448
run: |
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Update Lockfile
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- "requirements.txt"
8+
9+
jobs:
10+
update-lockfile:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
21+
with:
22+
python-version: "3.11"
23+
24+
- name: Install uv
25+
uses: astral-sh/setup-uv@v5
26+
27+
- name: Regenerate requirements.lock
28+
run: uv pip compile requirements.txt -o requirements.lock --generate-hashes
29+
30+
- name: Commit updated lockfile
31+
run: |
32+
git config user.name "github-actions[bot]"
33+
git config user.email "github-actions[bot]@users.noreply.github.com"
34+
if git diff --quiet requirements.lock; then
35+
echo "requirements.lock is already up to date, nothing to commit"
36+
else
37+
git add requirements.lock
38+
git commit -m "chore: regenerate requirements.lock after requirements.txt update"
39+
git push
40+
fi

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ outstanding-todos.md
1717

1818
# Uploaded files (clipboard paste images)
1919
uploads/
20+
21+
# uv lockfile — not portable across PyPI proxies, generate locally with `uv lock`
22+
uv.lock

pyproject.toml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,23 @@ description = "CoDA - Coding Agents on Databricks Apps"
55
requires-python = ">=3.10"
66
dependencies = [
77
"flask>=2.0",
8+
"flask-socketio>=5.0",
9+
"simple-websocket>=1.0",
810
"claude-agent-sdk",
911
"databricks-sdk>=0.20.0",
10-
"mlflow[genai]>=3.4",
12+
"mlflow-tracing>=3.4",
1113
"opentelemetry-exporter-otlp-proto-grpc",
14+
"requests",
15+
"cryptography",
1216
]
17+
18+
[tool.uv]
19+
# Exclude packages uploaded to PyPI more recently than ~30 days ago.
20+
# This gives the community time to catch supply-chain issues before they land here.
21+
# Bump this date when you intentionally need a newer release.
22+
exclude-newer = "7 days"
23+
24+
[tool.uv.sources]
25+
# Direct GitHub installs — workaround for Databricks internal PyPI proxy gaps.
26+
# Remove these once the proxy has current versions.
27+
requests = { git = "https://github.com/psf/requests", rev = "v2.33.0" }

requirements.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ click==8.3.1 \
256256
# flask
257257
# flask-socketio
258258
# uvicorn
259-
cryptography @ git+https://github.com/pyca/cryptography@91d728897bdad30cd5c79a2b23e207f1f050d587
259+
cryptography==46.0.6
260260
# via
261261
# -r requirements.txt
262262
# pyjwt

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ databricks-sdk==0.102.0
66
mlflow-tracing==3.10.1
77
opentelemetry-exporter-otlp-proto-grpc==1.40.0
88
requests @ git+https://github.com/psf/requests@v2.33.0
9-
cryptography @ git+https://github.com/pyca/cryptography@46.0.6
9+
cryptography==46.0.6

0 commit comments

Comments
 (0)