Skip to content

Commit 2c6088b

Browse files
authored
Merge pull request #51 from scrapinghub/modernize
Harden CI, add Python 3.15
2 parents a9c83d0 + f6afe51 commit 2c6088b

7 files changed

Lines changed: 98 additions & 33 deletions

File tree

‎.github/dependabot.yml‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: "/"
5+
schedule:
6+
interval: monthly
7+
groups:
8+
github-actions:
9+
patterns:
10+
- "*"
11+
cooldown:
12+
default-days: 7

‎.github/workflows/publish.yml‎

Lines changed: 35 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,50 @@
1-
# This workflows will upload a Python Package using Twine when a release is created
2-
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3-
41
name: publish
52

3+
permissions:
4+
contents: read
5+
66
on:
77
push:
88
tags:
99
- "[0-9]+.[0-9]+.[0-9]+"
1010

1111
jobs:
12-
deploy:
12+
build:
13+
name: Build distribution
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
17+
with:
18+
persist-credentials: false
19+
- name: Set up Python
20+
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
21+
with:
22+
python-version: "3.14"
23+
- name: Install pypa/build
24+
run: python3 -m pip install build --user
25+
- name: Build a binary wheel and a source tarball
26+
run: python3 -m build
27+
- name: Store the distribution packages
28+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
29+
with:
30+
name: python-package-distributions
31+
path: dist/
32+
33+
publish:
34+
name: Publish to PyPI
35+
needs:
36+
- build
1337
runs-on: ubuntu-latest
1438
environment:
1539
name: pypi
16-
url: https://pypi.org/p/${{ github.event.repository.name }}
40+
url: https://pypi.org/p/andi
1741
permissions:
1842
id-token: write
19-
2043
steps:
21-
- uses: actions/checkout@v5
22-
- name: Set up Python
23-
uses: actions/setup-python@v6
44+
- name: Download all the dists
45+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
2446
with:
25-
python-version: '3.13'
26-
- name: Install dependencies
27-
run: |
28-
python -m pip install --upgrade pip
29-
pip install build
30-
- name: Build package
31-
run: python -m build
32-
- name: Publish package
33-
uses: pypa/gh-action-pypi-publish@release/v1
47+
name: python-package-distributions
48+
path: dist/
49+
- name: Publish distribution to PyPI
50+
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2

‎.github/workflows/test.yml‎

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
1+
name: tests
32

4-
name: tox
3+
permissions:
4+
contents: read
55

66
on:
77
push:
@@ -13,28 +13,40 @@ jobs:
1313
test:
1414

1515
runs-on: ubuntu-latest
16+
permissions:
17+
contents: read
18+
id-token: write # OIDC authentication with Codecov
1619
strategy:
1720
fail-fast: false
1821
matrix:
19-
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
22+
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14', '3.15']
2023

2124
steps:
22-
- uses: actions/checkout@v5
25+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
26+
with:
27+
persist-credentials: false
2328
- name: Set up Python ${{ matrix.python-version }}
24-
uses: actions/setup-python@v6
29+
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
2530
with:
2631
python-version: ${{ matrix.python-version }}
32+
allow-prereleases: true
2733
- name: Install dependencies
2834
run: |
2935
python -m pip install --upgrade pip
3036
python -m pip install tox
3137
- name: tox
3238
run: |
3339
tox -e py
34-
- name: coverage
35-
uses: codecov/codecov-action@v5
40+
- name: Upload coverage report
41+
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
42+
with:
43+
use_oidc: true
44+
- name: Upload test results
45+
if: ${{ !cancelled() }}
46+
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
3647
with:
37-
token: ${{ secrets.CODECOV_TOKEN }}
48+
report_type: test_results
49+
use_oidc: true
3850

3951
check:
4052
runs-on: ubuntu-latest
@@ -45,9 +57,11 @@ jobs:
4557
tox-job: ["mypy", "twinecheck"]
4658

4759
steps:
48-
- uses: actions/checkout@v5
60+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
61+
with:
62+
persist-credentials: false
4963
- name: Set up Python ${{ matrix.python-version }}
50-
uses: actions/setup-python@v6
64+
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
5165
with:
5266
python-version: ${{ matrix.python-version }}
5367
- name: Install dependencies
@@ -61,5 +75,7 @@ jobs:
6175
pre-commit:
6276
runs-on: ubuntu-latest
6377
steps:
64-
- uses: actions/checkout@v5
65-
- uses: pre-commit/action@v3.0.1
78+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
79+
with:
80+
persist-credentials: false
81+
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
.pytest_cache/
1919
.coverage
2020
coverage.xml
21+
*.junit.xml
2122
htmlcov/
2223
.env/
2324
.venv/

‎.pre-commit-config.yaml‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.16.4
3+
rev: v0.16.7
44
hooks:
55
- id: ruff-check
66
args: [ --fix ]
@@ -10,3 +10,12 @@ repos:
1010
hooks:
1111
- id: end-of-file-fixer
1212
- id: trailing-whitespace
13+
- repo: https://github.com/rhysd/actionlint
14+
rev: v1.7.12
15+
hooks:
16+
- id: actionlint
17+
- repo: https://github.com/zizmorcore/zizmor-pre-commit
18+
rev: v1.30.1
19+
hooks:
20+
- id: zizmor
21+
args: [--no-progress, --fix]

‎pyproject.toml‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ classifiers = [
2323
"Programming Language :: Python :: 3.12",
2424
"Programming Language :: Python :: 3.13",
2525
"Programming Language :: Python :: 3.14",
26+
"Programming Language :: Python :: 3.15",
2627
]
2728
requires-python = ">=3.10"
2829

@@ -71,6 +72,12 @@ extend-select = [
7172
"COM",
7273
# pydocstyle
7374
"D",
75+
# pycodestyle
76+
"E4",
77+
"E7",
78+
"E9",
79+
# Pyflakes
80+
"F",
7481
# flake8-future-annotations
7582
"FA",
7683
# flynt
@@ -115,6 +122,8 @@ extend-select = [
115122
"T10",
116123
# flake8-type-checking
117124
"TC",
125+
# flake8-tidy-imports
126+
"TID",
118127
# pyupgrade
119128
"UP",
120129
# pycodestyle warnings

‎tox.ini‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py310,py311,py312,py313,py314,mypy,twinecheck
2+
envlist = py310,py311,py312,py313,py314,py315,mypy,twinecheck
33

44
[testenv]
55
deps =
@@ -9,6 +9,7 @@ deps =
99
commands =
1010
pytest \
1111
--cov-report= --cov-report=xml --cov-report=term-missing --cov=andi \
12+
--junitxml=testenv.junit.xml -o junit_family=legacy \
1213
--doctest-modules \
1314
{posargs:andi tests README.rst}
1415

0 commit comments

Comments
 (0)