Skip to content

Commit f21b750

Browse files
committed
Update workflows to not invoke setup.py as much.
Use latest OS versions.
1 parent f045daf commit f21b750

2 files changed

Lines changed: 24 additions & 16 deletions

File tree

.github/workflows/python-package.yml

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ env:
1717

1818
jobs:
1919
black:
20-
runs-on: ubuntu-20.04
20+
runs-on: ubuntu-latest
2121
steps:
2222
- uses: actions/checkout@v3
2323
- name: Install Black
@@ -26,7 +26,7 @@ jobs:
2626
run: black --check --diff examples/ scripts/ tcod/ tests/ *.py
2727

2828
isort:
29-
runs-on: ubuntu-20.04
29+
runs-on: ubuntu-latest
3030
steps:
3131
- uses: actions/checkout@v3
3232
- name: Install isort
@@ -43,7 +43,7 @@ jobs:
4343
run: isort examples/ --check --diff --thirdparty tcod
4444

4545
flake8:
46-
runs-on: ubuntu-20.04
46+
runs-on: ubuntu-latest
4747
steps:
4848
- uses: actions/checkout@v3
4949
- name: Install Flake8
@@ -55,7 +55,7 @@ jobs:
5555
run: flake8 scripts/ tcod/ tests/
5656

5757
mypy:
58-
runs-on: ubuntu-20.04
58+
runs-on: ubuntu-latest
5959
steps:
6060
- uses: actions/checkout@v3
6161
- name: Checkout submodules
@@ -76,7 +76,7 @@ jobs:
7676
runs-on: ${{ matrix.os }}
7777
strategy:
7878
matrix:
79-
os: ["windows-2019", "macos-11"]
79+
os: ["windows-latest", "macos-latest"]
8080
sdl-version: ["2.0.14", "2.0.16"]
8181
fail-fast: true
8282
steps:
@@ -85,8 +85,13 @@ jobs:
8585
fetch-depth: ${{ env.git-depth }}
8686
- name: Checkout submodules
8787
run: git submodule update --init --recursive --depth 1
88+
- uses: actions/setup-python@v4
89+
with:
90+
python-version: "3.x"
91+
- name: Install build dependencies
92+
run: pip install build
8893
- name: Build package
89-
run: ./setup.py build
94+
run: python -m build
9095
env:
9196
SDL_VERSION: ${{ matrix.sdl-version }}
9297

@@ -95,14 +100,14 @@ jobs:
95100
runs-on: ${{ matrix.os }}
96101
strategy:
97102
matrix:
98-
os: ["ubuntu-20.04", "windows-2019"]
103+
os: ["ubuntu-latest", "windows-latest"]
99104
python-version: ["3.7", "3.8", "3.9", "pypy-3.7"]
100105
architecture: ["x64"]
101106
include:
102-
- os: "windows-2019"
107+
- os: "windows-latest"
103108
python-version: "3.7"
104109
architecture: "x86"
105-
- os: "windows-2019"
110+
- os: "windows-latest"
106111
python-version: "pypy-3.7"
107112
architecture: "x86"
108113
fail-fast: false
@@ -127,14 +132,14 @@ jobs:
127132
- name: Install Python dependencies
128133
run: |
129134
python -m pip install --upgrade pip
130-
pip install pytest pytest-cov pytest-benchmark wheel twine
135+
pip install pytest pytest-cov pytest-benchmark build twine
131136
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
132137
- name: Initialize package
133138
run: |
134-
python setup.py check # Creates tcod/version.py.
139+
pip install -e . # Install the package in-place.
135140
- name: Build package.
136141
run: |
137-
python setup.py build sdist develop bdist_wheel --py-limited-api cp36 # Install the package in-place.
142+
python -m build
138143
- name: Test with pytest
139144
if: runner.os == 'Windows'
140145
run: |
@@ -172,7 +177,7 @@ jobs:
172177
runs-on: ${{ matrix.os }}
173178
strategy:
174179
matrix:
175-
os: ["ubuntu-20.04", "windows-2019"]
180+
os: ["ubuntu-latest", "windows-latest"]
176181
steps:
177182
- name: Set up Python
178183
uses: actions/setup-python@v4
@@ -199,7 +204,7 @@ jobs:
199204
200205
linux-wheels:
201206
needs: build # These take a while to build/test, so wait for normal tests to pass first.
202-
runs-on: "ubuntu-20.04"
207+
runs-on: "ubuntu-latest"
203208
strategy:
204209
matrix:
205210
arch: ["x86_64", "aarch64"]
@@ -272,7 +277,7 @@ jobs:
272277
run: pip3 install wheel twine -r requirements.txt
273278
- name: Prepare package
274279
# Downloads SDL2 for the later step.
275-
run: python3 setup.py check
280+
run: python3 setup.py || true
276281
- name: Build wheels
277282
uses: pypa/cibuildwheel@v2.12.3
278283
env:

.vscode/settings.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,5 +428,8 @@
428428
"python.testing.pytestEnabled": true,
429429
"[python]": {
430430
"editor.defaultFormatter": "ms-python.black-formatter"
431-
}
431+
},
432+
"cSpell.enableFiletypes": [
433+
"github-actions-workflow"
434+
]
432435
}

0 commit comments

Comments
 (0)