Skip to content

Commit c9f4db4

Browse files
authored
Update release flow (#210)
The release workflow needs an adjustment to work with pyproject.toml. Otherwise, updating CI to use Python 3.11 to match the new Python requirements, and adds a "test" extra to support the release workflow's installation step.
1 parent 00cebac commit c9f4db4

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

.github/actions/build-package/action.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ inputs:
44
python-version:
55
description: 'Python version to use'
66
required: false
7-
default: '3.8'
7+
default: '3.11'
88

99
runs:
1010
using: "composite"
@@ -20,12 +20,12 @@ runs:
2020

2121
- name: Install dependencies
2222
shell: bash
23-
run: pip install twine wheel
23+
run: pip install build twine wheel
2424

2525
- name: Setup deployment
2626
shell: bash
27-
run: python setup.py sdist bdist_wheel
27+
run: python -m build --sdist --wheel
2828

2929
- name: Validate deployment
3030
shell: bash
31-
run: twine check dist/*
31+
run: twine check dist/*

.github/workflows/release.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ jobs:
1212
- uses: actions/checkout@v4
1313

1414
- uses: ./.github/actions/build-package
15+
with:
16+
python-version: '3.11'
1517

1618
- name: Set up a fresh environment and run tests
1719
run: |
@@ -29,10 +31,10 @@ jobs:
2931
steps:
3032
- uses: actions/checkout@v4
3133

32-
- name: Set up Python 3.8
34+
- name: Set up Python 3.11
3335
uses: actions/setup-python@v5
3436
with:
35-
python-version: 3.8
37+
python-version: '3.11'
3638

3739
- name: Compare tags
3840
run: |
@@ -41,6 +43,8 @@ jobs:
4143
[ "${{ github.ref_type }}" = "tag" ] && [ "${{ github.ref_name }}" = "v$PKG_VERSION" ]
4244
4345
- uses: ./.github/actions/build-package
46+
with:
47+
python-version: '3.11'
4448

4549
- name: Run deployment
4650
run:

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ dependencies = [
3131

3232
[project.optional-dependencies]
3333
estimate-area = ["supermercado>=0.2.0"]
34+
test = [
35+
"pre-commit>=3.5",
36+
"pytest>=8",
37+
"pytest-cov>=4",
38+
]
3439

3540
[project.scripts]
3641
tilesets = "mapbox_tilesets.scripts.cli:cli"

0 commit comments

Comments
 (0)