Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 21 additions & 0 deletions .github/actions/setup-jfrog-pypi/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Setup JFrog PyPI proxy
description: Authenticate to JFrog via OIDC and configure uv to use the db-pypi proxy

runs:
using: composite
steps:
- name: Setup JFrog CLI with OIDC
id: jfrog
uses: jfrog/setup-jfrog-cli@279b1f629f43dd5bc658d8361ac4802a7ef8d2d5 # v4.9.1
env:
JF_URL: https://databricks.jfrog.io
with:
oidc-provider-name: github-actions

- name: Configure uv for JFrog
shell: bash
run: |
# Route uv package resolution through the JFrog PyPI proxy. Hardened
# runners block direct access to pypi.org, so all index queries go
# through this authenticated mirror instead.
echo "UV_INDEX_URL=https://${{ steps.jfrog.outputs.oidc-user }}:${{ steps.jfrog.outputs.oidc-token }}@databricks.jfrog.io/artifactory/api/pypi/db-pypi/simple" >> "$GITHUB_ENV"
21 changes: 21 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
merge_group:
types: [checks_requested]

permissions:
id-token: write
contents: read

jobs:
tests-ubuntu:
uses: ./.github/workflows/test.yml
Expand Down Expand Up @@ -39,9 +43,20 @@ jobs:
with:
version: "0.6.5"

- name: Setup JFrog PyPI proxy
uses: ./.github/actions/setup-jfrog-pypi

- name: Re-lock for JFrog
run: uv lock

- name: Format all files
run: make dev fmt

- name: Restore lockfiles and fix proxy URLs
run: |
git checkout -- '*.lock'
make fix-lockfile

- name: Fail on differences
run: git diff --exit-code

Expand All @@ -57,5 +72,11 @@ jobs:
with:
version: "0.6.5"

- name: Setup JFrog PyPI proxy
uses: ./.github/actions/setup-jfrog-pypi

- name: Re-lock for JFrog
run: uv lock

- name: Check MANIFEST.in
run: make dev && uv run check-manifest .
14 changes: 14 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ jobs:
strategy:
fail-fast: false
runs-on: ${{ inputs.os }}

permissions:
id-token: write
contents: read

steps:
- name: Checkout
uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
Expand All @@ -28,6 +33,15 @@ jobs:
version: "0.6.5"
python-version: ${{ inputs.pyVersion }}

- name: Setup JFrog PyPI proxy
uses: ./.github/actions/setup-jfrog-pypi

# Re-lock so uv.lock matches the JFrog-configured UV_INDEX_URL.
# Keeps the same versions; only registry URLs change. Ephemeral (not committed).
- name: Re-lock for JFrog
shell: bash
run: uv lock

- name: Run tests
run: make dev test

Expand Down
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,13 @@ benchmark:
coverage: test
open htmlcov/index.html

fix-lockfile:
@# Replace JFrog proxy URLs with public equivalents in lockfiles.
@# Prevents proxy URLs from being accidentally committed.
find . -type f -name '*.lock' -not -path './.github/*' \
-exec sed -i 's|databricks\.jfrog\.io/artifactory/api/pypi/db-pypi/simple|pypi.org/simple|g' {} +
find . -type f -name '*.lock' -not -path './.github/*' \
-exec sed -i 's|databricks\.jfrog\.io/artifactory/api/pypi/db-pypi/packages|files.pythonhosted.org|g' {} +

clean:
rm -fr dist *.egg-info .pytest_cache build htmlcov .venv
Loading