Skip to content

Commit 5d1dfcf

Browse files
committed
General overhaul: GitHub CI, pyproject.toml, ruff (#243)
A general update/refresh of the zocalo tooling and repository: - Switch zocalo setup.cfg to PEP 621/518 pyproject.toml, merge configuration for other tools where possible - Update pre-commits - and fix new mypy warnings. configure_rabbitmq has a few more valid complaints that are harder to immediately remove. - Switch isort/flake8 to use ruff instead - Drop Azure pipelines and switch to GitHub actions
2 parents d0a0a98 + 6a490af commit 5d1dfcf

40 files changed

+270
-512
lines changed

.azure-pipelines.yml

Lines changed: 0 additions & 167 deletions
This file was deleted.

.azure-pipelines/ci.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

.azure-pipelines/flake8-validation.py

Lines changed: 0 additions & 42 deletions
This file was deleted.

.azure-pipelines/syntax-validation.py

Lines changed: 0 additions & 32 deletions
This file was deleted.

.bumpversion.cfg

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ current_version = 0.30.1
33
commit = True
44
tag = True
55

6-
[bumpversion:file:setup.cfg]
7-
search = version = {current_version}
8-
replace = version = {new_version}
6+
[bumpversion:file:pyproject.toml]
7+
search = version = "{current_version}"
8+
replace = version = "{new_version}"
99

1010
[bumpversion:file:src/zocalo/__init__.py]
1111
search = __version__ = "{current_version}"
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Build and Test
2+
3+
on:
4+
push:
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v3
11+
- name: Set up Python
12+
uses: actions/setup-python@v4
13+
with:
14+
python-version: 3.11
15+
- name: Install dependencies
16+
run: |
17+
python -m pip install --upgrade pip
18+
pip install pytest build
19+
- name: Build distribution
20+
run: |
21+
python -m build
22+
pip install dist/*.whl
23+
- uses: actions/upload-artifact@v3
24+
with:
25+
path: ./dist/*
26+
27+
test:
28+
needs: build
29+
runs-on: ubuntu-latest
30+
strategy:
31+
matrix:
32+
python-version: ["3.8", "3.9", "3.10", "3.11"]
33+
34+
steps:
35+
- uses: actions/checkout@v3
36+
- uses: actions/download-artifact@v3
37+
with:
38+
name: artifact
39+
path: dist
40+
41+
- name: Set up Python ${{ matrix.python-version }}
42+
uses: actions/setup-python@v4
43+
with:
44+
python-version: ${{ matrix.python-version }}
45+
- name: Install dependencies
46+
run: |
47+
python -m pip install --upgrade pip
48+
pip install pytest dist/*.whl -r requirements_dev.txt pytest-md pytest-emoji
49+
- name: Run pytest
50+
uses: pavelzw/pytest-action@b09a85cd1831cbaae76125fcae4a1e4b137ef026 # v2.1.3
51+
with:
52+
click-to-expand: false
53+
emoji: true
54+
job-summary: true
55+
verbose: false
56+
custom-arguments: "-v -ra --cov=zocalo --cov-report=xml --cov-branch"
57+
custom-pytest: "PYTHONDEVMODE=1 pytest"
58+
report-title: "Test Report"
59+
- name: Upload Coverage to Codecov
60+
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
61+
62+
pypi-publish:
63+
name: Upload release to PyPI
64+
needs: test
65+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
66+
runs-on: ubuntu-latest
67+
environment:
68+
name: release
69+
url: https://pypi.org/watchdir
70+
permissions:
71+
id-token: write
72+
steps:
73+
- uses: actions/download-artifact@v3
74+
with:
75+
name: artifact
76+
path: dist
77+
- name: Publish package distributions to PyPI
78+
uses: pypa/gh-action-pypi-publish@b7f401de30cb6434a1e19f805ff006643653240e

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: "CodeQL"
22

33
on:
44
push:
5-
branches: [ "main", "master" ]
5+
branches: ["main"]
66
pull_request:
77
branches: [ "main" ]
88
schedule:

0 commit comments

Comments
 (0)