Skip to content

Commit c9cf343

Browse files
committed
Add 3.12 support and standardize CI
1 parent 2baf95f commit c9cf343

File tree

6 files changed

+123
-89
lines changed

6 files changed

+123
-89
lines changed

Diff for: .github/workflows/Publish.yaml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Build and upload to PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-22.04
10+
permissions:
11+
id-token: write # mandatory for PyPI trusted publishing
12+
13+
steps:
14+
- uses: actions/checkout@v3
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v4
18+
with:
19+
python-version-file: pyproject.toml
20+
architecture: x64
21+
22+
- name: Build packages
23+
run: |
24+
pip install -U pip build
25+
python -m build --sdist --wheel
26+
27+
- name: Upload to PyPI
28+
uses: pypa/gh-action-pypi-publish@release/v1.8

Diff for: .github/workflows/QA.yaml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: QA
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
check-qa:
11+
runs-on: ubuntu-22.04
12+
13+
steps:
14+
- uses: actions/checkout@v3
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v4
18+
with:
19+
python-version-file: pyproject.toml
20+
architecture: x64
21+
22+
- name: Install dependencies (and project)
23+
run: |
24+
pip install -U pip
25+
pip install -e .[lint,scripts,test,check]
26+
27+
- name: Check black formatting
28+
run: inv lint-black
29+
30+
- name: Check ruff
31+
run: inv lint-ruff
32+
33+
- name: Check pyright
34+
run: inv check-pyright

Diff for: .github/workflows/Tests.yaml

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Tests
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
run-tests:
11+
strategy:
12+
matrix:
13+
os: [ubuntu-22.04]
14+
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
15+
runs-on: ${{ matrix.os }}
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
20+
- name: install ffmpeg and gifsicle
21+
run: sudo apt update && sudo apt install ffmpeg gifsicle
22+
23+
- name: add required locales for tests
24+
run: sudo locale-gen fr_FR.UTF-8 pt_BR.UTF-8 && sudo update-locale
25+
26+
- name: Set up Python ${{ matrix.python }}
27+
uses: actions/setup-python@v4
28+
with:
29+
python-version: ${{ matrix.python }}
30+
architecture: x64
31+
32+
- name: Install dependencies (and project)
33+
run: |
34+
pip install -U pip
35+
pip install -e .[test,scripts]
36+
37+
- name: Run the tests
38+
run: inv coverage --args "-vvv"
39+
40+
- name: Upload coverage report to codecov
41+
if: matrix.python == '3.12'
42+
uses: codecov/codecov-action@v3
43+
with:
44+
token: ${{ secrets.CODECOV_TOKEN }}
45+
46+
build_python:
47+
runs-on: ubuntu-22.04
48+
steps:
49+
- uses: actions/checkout@v3
50+
51+
- name: Set up Python
52+
uses: actions/setup-python@v4
53+
with:
54+
python-version-file: pyproject.toml
55+
architecture: x64
56+
57+
- name: Ensure we can build Python targets
58+
run: |
59+
pip install -U pip build
60+
python3 -m build --sdist --wheel

Diff for: .github/workflows/ci.yml

-54
This file was deleted.

Diff for: .github/workflows/release.yml

-34
This file was deleted.

Diff for: pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "zimscraperlib"
7-
requires-python = ">=3.8,<3.12"
7+
requires-python = ">=3.8,<3.13"
88
description = "Collection of python tools to re-use common code across scrapers"
99
readme = "README.md"
1010
dependencies = [

0 commit comments

Comments
 (0)