Skip to content

Commit d22a029

Browse files
committed
Various CI speedups
- Switch to official PyPA build frontend for sdist ref https://pypi.org/project/build/ - Cancel running jobs when a new commit is pushed to a PR ref https://stackoverflow.com/questions/66335225#comment133398800_72408109 - Switch from setup-python to setup-uv ref https://github.com/astral-sh/setup-uv
1 parent 1d3c4fe commit d22a029

File tree

2 files changed

+13
-18
lines changed

2 files changed

+13
-18
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ jobs:
6363

6464
- name: Build source distribution
6565
run: |
66-
pip install -U setuptools wheel pip
67-
python setup.py sdist
66+
pip install -U setuptools wheel build
67+
python -m build --sdist
6868
6969
- uses: actions/upload-artifact@v4
7070
with:

.github/workflows/tests.yml

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ on:
99
branches:
1010
- master
1111

12+
concurrency: # https://stackoverflow.com/questions/66335225#comment133398800_72408109
13+
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
14+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
15+
1216
jobs:
1317
test-platforms:
1418
# NOTE: this matrix is for testing various combinations of Python and OS
@@ -33,9 +37,6 @@ jobs:
3337
run:
3438
shell: bash
3539

36-
env:
37-
PIP_DISABLE_PIP_VERSION_CHECK: 1
38-
3940
steps:
4041
- uses: actions/checkout@v5
4142
with:
@@ -61,18 +62,17 @@ jobs:
6162
echo "$(brew --prefix "$POSTGRES_FORMULA")/bin" >> $GITHUB_PATH
6263
6364
- name: Set up Python ${{ matrix.python-version }}
64-
uses: actions/setup-python@v6
65+
uses: astral-sh/setup-uv@v7
6566
if: "!steps.release.outputs.is_release"
6667
with:
6768
python-version: ${{ matrix.python-version }}
69+
activate-environment: true
6870

6971
- name: Install Python Deps
7072
if: "!steps.release.outputs.is_release"
7173
run: |
7274
[ "$RUNNER_OS" = "Linux" ] && .github/workflows/install-krb5.sh
73-
python -m pip install -U pip setuptools wheel
74-
python -m pip install --group test
75-
python -m pip install -e .
75+
uv pip install -e . --group test
7676
7777
- name: Test
7878
if: "!steps.release.outputs.is_release"
@@ -94,9 +94,6 @@ jobs:
9494

9595
permissions: {}
9696

97-
env:
98-
PIP_DISABLE_PIP_VERSION_CHECK: 1
99-
10097
steps:
10198
- uses: actions/checkout@v5
10299
with:
@@ -125,19 +122,17 @@ jobs:
125122
echo PGINSTALLATION="/usr/lib/postgresql/${PGVERSION}/bin" \
126123
>> "${GITHUB_ENV}"
127124
128-
- name: Set up Python ${{ matrix.python-version }}
129-
uses: actions/setup-python@v6
125+
- name: Set up Python
126+
uses: astral-sh/setup-uv@v7
130127
if: "!steps.release.outputs.is_release"
131128
with:
132-
python-version: "3.x"
129+
activate-environment: true
133130

134131
- name: Install Python Deps
135132
if: "!steps.release.outputs.is_release"
136133
run: |
137134
[ "$RUNNER_OS" = "Linux" ] && .github/workflows/install-krb5.sh
138-
python -m pip install -U pip setuptools wheel
139-
python -m pip install --group test
140-
python -m pip install -e .
135+
uv pip install -e . --group test
141136
142137
- name: Test
143138
if: "!steps.release.outputs.is_release"

0 commit comments

Comments
 (0)