Skip to content

Commit c70a711

Browse files
Move JFrog setup before setup-python to fix pip upgrade on uncached versions
actions/setup-python upgrades pip when installing a Python version not in the runner cache (e.g. 3.9). This hits pypi.org which is blocked on the hardened runners. Moving JFrog setup before setup-python ensures PIP_INDEX_URL is set so pip upgrades resolve through JFrog. Co-authored-by: Isaac Signed-off-by: Vikrant Puppala <vikrant.puppala@databricks.com>
1 parent 2a178c0 commit c70a711

2 files changed

Lines changed: 7 additions & 70 deletions

File tree

.github/workflows/code-quality-checks.yml

Lines changed: 5 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -21,54 +21,32 @@ jobs:
2121
matrix:
2222
python-version: [3.9, "3.10", "3.11", "3.12"]
2323
steps:
24-
#----------------------------------------------
25-
# check-out repo and set-up python
26-
#----------------------------------------------
2724
- name: Check out repository
2825
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
26+
- name: Setup JFrog
27+
uses: ./.github/actions/setup-jfrog
2928
- name: Set up python ${{ matrix.python-version }}
3029
id: setup-python
3130
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
3231
with:
3332
python-version: ${{ matrix.python-version }}
34-
#----------------------------------------------
35-
# setup jfrog for dependency install
36-
#----------------------------------------------
37-
- name: Setup JFrog
38-
uses: ./.github/actions/setup-jfrog
39-
#----------------------------------------------
40-
# ----- install & configure poetry -----
41-
#----------------------------------------------
4233
- name: Install Poetry
4334
run: |
4435
pip install poetry==2.2.1
4536
poetry config virtualenvs.create true
4637
poetry config virtualenvs.in-project true
4738
poetry config installer.parallel true
48-
49-
#----------------------------------------------
50-
# load cached venv if cache exists
51-
#----------------------------------------------
5239
- name: Load cached venv
5340
id: cached-poetry-dependencies
5441
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
5542
with:
5643
path: .venv
5744
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ github.event.repository.name }}-${{ hashFiles('**/poetry.lock') }}
58-
#----------------------------------------------
59-
# install dependencies if cache does not exist
60-
#----------------------------------------------
6145
- name: Install dependencies
6246
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
6347
run: poetry install --no-interaction --no-root
64-
#----------------------------------------------
65-
# install your root project, if required
66-
#----------------------------------------------
6748
- name: Install library
6849
run: poetry install --no-interaction
69-
#----------------------------------------------
70-
# black the code
71-
#----------------------------------------------
7250
- name: Black
7351
run: poetry run black --check src
7452

@@ -80,55 +58,33 @@ jobs:
8058
matrix:
8159
python-version: [3.9, "3.10", "3.11", "3.12"]
8260
steps:
83-
#----------------------------------------------
84-
# check-out repo and set-up python
85-
#----------------------------------------------
8661
- name: Check out repository
8762
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
63+
- name: Setup JFrog
64+
uses: ./.github/actions/setup-jfrog
8865
- name: Set up python ${{ matrix.python-version }}
8966
id: setup-python
9067
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
9168
with:
9269
python-version: ${{ matrix.python-version }}
93-
#----------------------------------------------
94-
# setup jfrog for dependency install
95-
#----------------------------------------------
96-
- name: Setup JFrog
97-
uses: ./.github/actions/setup-jfrog
98-
#----------------------------------------------
99-
# ----- install & configure poetry -----
100-
#----------------------------------------------
10170
- name: Install Poetry
10271
run: |
10372
pip install poetry==2.2.1
10473
poetry config virtualenvs.create true
10574
poetry config virtualenvs.in-project true
10675
poetry config installer.parallel true
107-
108-
#----------------------------------------------
109-
# load cached venv if cache exists
110-
#----------------------------------------------
11176
- name: Load cached venv
11277
id: cached-poetry-dependencies
11378
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
11479
with:
11580
path: .venv
11681
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ github.event.repository.name }}-${{ hashFiles('**/poetry.lock') }}
117-
#----------------------------------------------
118-
# install dependencies if cache does not exist
119-
#----------------------------------------------
12082
- name: Install dependencies
12183
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
12284
run: poetry install --no-interaction --no-root
123-
#----------------------------------------------
124-
# install your root project, if required
125-
#----------------------------------------------
12685
- name: Install library
12786
run: poetry install --no-interaction
128-
#----------------------------------------------
129-
# mypy the code
130-
#----------------------------------------------
13187
- name: Mypy
13288
run: |
133-
mkdir .mypy_cache # Workaround for bad error message "error: --install-types failed (no mypy cache directory)"; see https://github.com/python/mypy/issues/10768#issuecomment-2178450153
89+
mkdir .mypy_cache
13490
poetry run mypy --install-types --non-interactive src

.github/workflows/integration.yml

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -25,47 +25,28 @@ jobs:
2525
DATABRICKS_SCHEMA: ${{ secrets.SQLALCHEMY_SCHEMA }}
2626
DATABRICKS_USER: ${{ secrets.TEST_PECO_SP_ID }}
2727
steps:
28-
#----------------------------------------------
29-
# check-out repo and set-up python
30-
#----------------------------------------------
3128
- name: Check out repository
3229
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
30+
- name: Setup JFrog
31+
uses: ./.github/actions/setup-jfrog
3332
- name: Set up python
3433
id: setup-python
3534
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
3635
with:
3736
python-version: "3.10"
38-
#----------------------------------------------
39-
# setup jfrog for dependency install
40-
#----------------------------------------------
41-
- name: Setup JFrog
42-
uses: ./.github/actions/setup-jfrog
43-
#----------------------------------------------
44-
# ----- install & configure poetry -----
45-
#----------------------------------------------
4637
- name: Install Poetry
4738
run: |
4839
pip install poetry==2.2.1
4940
poetry config virtualenvs.create true
5041
poetry config virtualenvs.in-project true
5142
poetry config installer.parallel true
52-
53-
#----------------------------------------------
54-
# load cached venv if cache exists
55-
#----------------------------------------------
5643
- name: Load cached venv
5744
id: cached-poetry-dependencies
5845
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
5946
with:
6047
path: .venv
6148
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ github.event.repository.name }}-${{ hashFiles('**/poetry.lock') }}
62-
#----------------------------------------------
63-
# install dependencies if cache does not exist
64-
#----------------------------------------------
6549
- name: Install dependencies
6650
run: poetry install --no-interaction --all-extras
67-
#----------------------------------------------
68-
# run test suite
69-
#----------------------------------------------
7051
- name: Run SQL Alchemy tests
7152
run: poetry run python -m pytest tests/test_local

0 commit comments

Comments
 (0)