Skip to content

Commit 0ce99c3

Browse files
michalk8msmdev
andauthored
CI testing using Python 3.12 (#60)
* Enable 3.12 CI * Add `lint.yml` * Switch to `publish.yml` * Update RTD config --------- Co-authored-by: Bernhard Reuter <bernhard-reuter@gmx.de>
1 parent bfae9f1 commit 0ce99c3

5 files changed

Lines changed: 85 additions & 74 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -2,54 +2,23 @@ name: CI
22

33
on:
44
schedule:
5-
- cron: 00 00 * * 1 # run every Monday at 00:00
5+
- cron: 00 00 * * 1 # Run every Monday at 00:00
66
push:
7-
branches:
8-
- main
9-
tags:
10-
- v[0-9]+.[0-9]+.[0-9]+
7+
branches: [main]
118
pull_request:
12-
branches:
13-
- main
9+
branches: [main]
1410

1511
concurrency:
1612
group: ${{ github.workflow }}-${{ github.ref }}
1713
cancel-in-progress: true
1814

19-
2015
jobs:
21-
lint:
22-
runs-on: ubuntu-latest
23-
steps:
24-
- uses: actions/checkout@v3
25-
- name: Set up Python
26-
uses: actions/setup-python@v4
27-
with:
28-
python-version: '3.10'
29-
30-
- uses: actions/cache@v3
31-
with:
32-
path: ~/.cache/pre-commit
33-
key: precommit-${{ env.pythonLocation }}-${{ hashFiles('**/.pre-commit-config.yaml') }}
34-
35-
- name: Install dependencies
36-
run: |
37-
sudo apt-get update -y
38-
sudo apt install libenchant-2-dev pandoc
39-
python -m pip install --upgrade pip
40-
python -m pip install tox
41-
42-
- name: Linting
43-
run: |
44-
tox -e lint,check-docs,readme
45-
4616
test:
4717
runs-on: ${{ matrix.os }}
4818
strategy:
4919
fail-fast: false
50-
max-parallel: 5
5120
matrix:
52-
python: ['3.8', '3.10', '3.11']
21+
python: ['3.8', '3.10', '3.11', '3.12']
5322
os: [ubuntu-latest]
5423
slepc: ['noslepc']
5524
include:
@@ -87,30 +56,3 @@ jobs:
8756
env_vars: OS,PYTHON
8857
fail_ci_if_error: false
8958
verbose: true
90-
91-
deploy:
92-
needs: [lint, test]
93-
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
94-
runs-on: ubuntu-latest
95-
steps:
96-
- uses: actions/checkout@v3
97-
- name: Set up Python
98-
uses: actions/setup-python@v4
99-
with:
100-
python-version: '3.10'
101-
- name: Install pypa/build
102-
run: |
103-
python -m pip install --upgrade pip
104-
pip install build
105-
- name: Build a binary wheel and a source tarball
106-
run: |
107-
python -m build --sdist --wheel --outdir dist/
108-
109-
- name: Publish package on PyPI
110-
uses: pypa/gh-action-pypi-publish@release/v1
111-
with:
112-
user: __token__
113-
password: ${{ secrets.PYPI_PASSWORD }}
114-
skip_existing: true
115-
verify-metadata: true
116-
verbose: true

.github/workflows/lint.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Lint
2+
3+
on:
4+
schedule:
5+
- cron: 00 00 * * 1 # run every Monday at 00:00
6+
push:
7+
branches: [main]
8+
pull_request:
9+
branches: [main]
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
lint:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v3
20+
- name: Set up Python 3.10
21+
uses: actions/setup-python@v4
22+
with:
23+
python-version: '3.10'
24+
25+
- name: Cache pre-commit
26+
uses: actions/cache@v3
27+
with:
28+
path: ~/.cache/pre-commit
29+
key: pre-commit-${{ env.pythonLocation }}-${{ hashFiles('**/.pre-commit-config.yaml') }}
30+
31+
- name: Install dependencies
32+
run: |
33+
sudo apt-get update -y
34+
sudo apt install libenchant-2-dev pandoc
35+
python -m pip install --upgrade pip
36+
python -m pip install tox
37+
38+
- name: Linting
39+
run: |
40+
tox -e lint,check-docs,readme

.github/workflows/publish.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Upload package
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
- name: Set up Python
13+
uses: actions/setup-python@v4
14+
with:
15+
python-version: '3.10'
16+
17+
- name: Install pip dependencies
18+
run: |
19+
python -m pip install --upgrade pip
20+
pip install build
21+
22+
- name: Build package
23+
run: |
24+
python -m build --sdist --wheel --outdir dist/
25+
26+
- name: Publish package on PyPI
27+
uses: pypa/gh-action-pypi-publish@release/v1
28+
with:
29+
user: __token__
30+
password: ${{ secrets.PYPI_PASSWORD }}
31+
skip_existing: true
32+
verify-metadata: true
33+
verbose: true

.readthedocs.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
version: 2
22

3+
build:
4+
os: ubuntu-22.04
5+
tools:
6+
python: '3.10'
7+
38
sphinx:
49
builder: html
510
configuration: docs/source/conf.py
611
fail_on_warning: false
712

8-
formats:
9-
- htmlzip
10-
- pdf
11-
12-
build:
13-
image: latest
14-
1513
python:
16-
version: 3.8
1714
install:
1815
- method: pip
1916
path: .
20-
extra_requirements:
21-
- docs
17+
extra_requirements: [docs]

tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ isolated_build = True
7979
envlist =
8080
covclean
8181
lint
82-
py{3.8,3.9,3.10,3.11}-{slepc,noslepc}
82+
py{3.8,3.9,3.10,3.11,3.12}-{slepc,noslepc}
8383
coverage
8484
readme
8585
check-docs
@@ -113,7 +113,7 @@ deps =
113113
coverage
114114
diff_cover
115115
skip_install = true
116-
depends = py{3.8,3.9,3.10,3.11}
116+
depends = py{3.8,3.9,3.10,3.11,3.12}
117117
parallel_show_output = True
118118
commands =
119119
coverage report --omit="tox/*"

0 commit comments

Comments
 (0)