Skip to content

Commit 61a69ea

Browse files
authored
🧪🔧 Switch to using pypa/build in CI (#463)
This patch switches the CI/CD workflows to use the PyPA-endorsed PEP 517 build front-end called `build`. It is called without `--sdist` and `--wheel` CLI options, in which case `build` creates an sdist from the Git checkout but the following wheel build is made from that sdist tarball as opposed to using the Git checkout. This has a side effect of smoke-testing that it's possible to build wheels from the published sdists. And this is the flow that `pip install` follows when it's requested to install from an sdist. Ref: #460 (comment)
1 parent 1f8a16b commit 61a69ea

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

‎.github/workflows/ci.yml

+6-3
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ jobs:
3232
with:
3333
python-version: ${{ matrix.python-version }}
3434

35+
- name: Install pypa/build
36+
run: python -m pip install build==0.10.0
37+
3538
- name: Install Hatch
3639
run: python -m pip install hatch==1.6.3
3740

@@ -74,12 +77,12 @@ jobs:
7477

7578
- name: Build test (gitlint)
7679
run: |
77-
hatch build
80+
python -m build
7881
hatch clean
7982
8083
- name: Build test (gitlint-core)
8184
run: |
82-
hatch build
85+
python -m build
8386
hatch clean
8487
working-directory: ./gitlint-core
8588

@@ -136,4 +139,4 @@ jobs:
136139
secrets: inherit # pass all secrets (required to access secrets in a called workflow)
137140
with:
138141
pypi_target: "pypi.org"
139-
repo_release_ref: "main"
142+
repo_release_ref: "main"

‎.github/workflows/publish-release.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ jobs:
4343
with:
4444
python-version: "3.11"
4545

46+
- name: Install pypa/build
47+
run: python -m pip install build==0.10.0
48+
4649
- name: Install Hatch
4750
run: python -m pip install hatch==1.6.3
4851

@@ -76,13 +79,13 @@ jobs:
7679
echo "gitlint_version=$(hatch version | cut -d+ -f1)" >> $GITHUB_OUTPUT
7780
7881
- name: Build (gitlint-core)
79-
run: hatch build
82+
run: python -m build
8083
working-directory: ./gitlint-core
8184
env:
8285
SETUPTOOLS_SCM_PRETEND_VERSION: ${{ steps.set_version.outputs.gitlint_version }}
8386

8487
- name: Build (gitlint)
85-
run: hatch build
88+
run: python -m build
8689
env:
8790
SETUPTOOLS_SCM_PRETEND_VERSION: ${{ steps.set_version.outputs.gitlint_version }}
8891

0 commit comments

Comments
 (0)