Skip to content

Commit 72ef109

Browse files
committed
Maintenance: update all linters
1 parent b1902cd commit 72ef109

File tree

14 files changed

+309
-656
lines changed

14 files changed

+309
-656
lines changed

.github/workflows/pythonpackage.yml

Lines changed: 119 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,59 @@
11
name: Python package
22

3-
on: [push]
3+
on:
4+
push:
5+
branches-ignore:
6+
- 'dependabot/**'
7+
tags-ignore:
8+
- '*.[0-9][ab][0-9]'
9+
pull_request: {}
410

511
jobs:
612
PEP8:
13+
name: Check with Ruff
714
runs-on: ubuntu-latest
815
steps:
9-
- uses: actions/checkout@v4.1.1
16+
- uses: actions/checkout@v4
1017
- name: Set up Python
11-
uses: actions/setup-python@v4.7.1
18+
uses: actions/setup-python@v4
1219
with:
1320
python-version: '3.x'
1421
cache: 'pip'
15-
cache-dependency-path: |
16-
requirements.txt
17-
flake8_requirements.txt
1822
- name: Install dependencies
1923
run: |
2024
python -m pip install --upgrade pip
21-
pip install --upgrade -r flake8_requirements.txt
22-
- name: Lint with flake8
25+
pip install --upgrade ruff
26+
- name: Lint with ruff
2327
run: |
24-
flake8 sqlalchemy_jsonfield
28+
ruff sqlalchemy_jsonfield --output-format github
2529
2630
PyLint:
2731
runs-on: ubuntu-latest
2832
steps:
29-
- uses: actions/checkout@v4.1.1
33+
- uses: actions/checkout@v4
3034
- name: Set up Python
31-
uses: actions/setup-python@v4.7.1
35+
uses: actions/setup-python@v4
3236
with:
33-
python-version: '3.7'
37+
python-version: '3.11'
3438
cache: 'pip'
3539
- name: Install dependencies
3640
run: |
3741
python -m pip install --upgrade pip
3842
pip install --upgrade -r CI_REQUIREMENTS.txt
39-
pip install --upgrade "pylint >= 2.6.0"
40-
- name: Generate version file
43+
pip install --upgrade "pylint >= 3.0.0"
44+
- name: Install develop
4145
run: |
42-
python setup.py --version clean
46+
pip install -e .
4347
- name: Lint with PyLint
4448
run: |
4549
pylint sqlalchemy_jsonfield
4650
4751
MyPy:
4852
runs-on: ubuntu-latest
4953
steps:
50-
- uses: actions/checkout@v4.1.1
54+
- uses: actions/checkout@v4
5155
- name: Set up Python
52-
uses: actions/setup-python@v4.7.1
56+
uses: actions/setup-python@v4
5357
with:
5458
python-version: '3.x'
5559
cache: 'pip'
@@ -61,19 +65,19 @@ jobs:
6165
python -m pip install --upgrade pip
6266
pip install --upgrade -r CI_REQUIREMENTS.txt
6367
pip install --upgrade -r mypy_requirements.txt
64-
- name: Generate version file
68+
- name: Install develop
6569
run: |
66-
python setup.py --version clean
70+
pip install -e .
6771
- name: Lint with MyPy
6872
run: |
6973
mypy --strict --install-types --non-interactive sqlalchemy_jsonfield
7074
7175
Black:
7276
runs-on: ubuntu-latest
7377
steps:
74-
- uses: actions/checkout@v4.1.1
78+
- uses: actions/checkout@v4
7579
- name: Set up Python
76-
uses: actions/setup-python@v4.7.1
80+
uses: actions/setup-python@v4
7781
with:
7882
python-version: '3.x'
7983
cache: 'pip'
@@ -85,22 +89,39 @@ jobs:
8589
run: |
8690
black --check sqlalchemy_jsonfield
8791
92+
Refurb:
93+
runs-on: ubuntu-latest
94+
steps:
95+
- uses: actions/checkout@v4
96+
- name: Set up Python
97+
uses: actions/setup-python@v4
98+
with:
99+
python-version: '3.x'
100+
cache: 'pip'
101+
- name: Install dependencies
102+
run: |
103+
python -m pip install --upgrade pip
104+
pip install --upgrade refurb
105+
- name: Lint with refurb
106+
run: |
107+
refurb sqlalchemy_jsonfield
108+
88109
Test:
89-
needs: [PEP8, PyLint, MyPy, Black]
110+
needs: [PEP8, PyLint, MyPy, Black, Refurb] # isort is broken
90111
runs-on: ${{ matrix.os }}
91112
strategy:
92113
max-parallel: 6
93114
matrix:
94-
os: ["ubuntu-latest", "windows-latest"]
95-
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
115+
os: [ubuntu-latest, windows-latest]
116+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
96117
include:
97118
- os: "ubuntu-latest"
98119
python-version: "pypy3.9"
99120

100121
steps:
101-
- uses: actions/checkout@v4.1.1
122+
- uses: actions/checkout@v4
102123
- name: Set up Python ${{ matrix.python-version }}
103-
uses: actions/setup-python@v4.7.1
124+
uses: actions/setup-python@v4
104125
with:
105126
python-version: ${{ matrix.python-version }}
106127
cache: 'pip'
@@ -112,37 +133,97 @@ jobs:
112133
python -m pip install --upgrade pip wheel
113134
pip install --upgrade -r CI_REQUIREMENTS.txt
114135
pip install --upgrade -r pytest_requirements.txt
115-
- name: Build package and install develop
136+
- name: Install develop
116137
run: |
117138
pip install -e .
118139
- name: Test with pytest
119140
run: py.test --cov-report= --cov=sqlalchemy_jsonfield test
120141
- name: Report coverage
121142
run: |
122143
coverage report -m
144+
coverage xml
123145
# coverage report -m --fail-under 85
146+
- name: Coveralls Parallel
147+
uses: coverallsapp/github-action@v2
148+
with:
149+
flag-name: run-${{ matrix.python-version }}-${{ matrix.os }}
150+
parallel: true
151+
file: coverage.xml
124152

125-
Deploy:
126-
needs: [Test]
127-
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
153+
UploadCoverage:
154+
name: Upload coverage to Coveralls
155+
needs: [ Test ]
156+
if: ${{ always() }}
128157
runs-on: ubuntu-latest
129158
steps:
130-
- uses: actions/[email protected]
159+
- name: Coveralls Finished
160+
uses: coverallsapp/github-action@v2
161+
with:
162+
parallel-finished: true
163+
164+
Build:
165+
needs: [ Test ]
166+
runs-on: ubuntu-latest
167+
steps:
168+
- uses: actions/checkout@v4
169+
with:
170+
fetch-depth: 0 # need for setuptools_scm
131171
- name: Set up Python
132-
uses: actions/setup-python@v4.7.1
172+
uses: actions/setup-python@v4
133173
with:
134174
python-version: '3.x'
135-
cache: 'pip'
136175
- name: Install dependencies
137176
run: |
138177
python -m pip install --upgrade pip
139178
pip install --upgrade twine build
140179
- name: Build package
141180
run: |
142181
python -m build
143-
- name: Deploy
144-
env:
145-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
146-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
182+
- uses: actions/upload-artifact@v3
183+
with:
184+
path: dist/*
185+
name: wheels
186+
187+
Metadata:
188+
name: Validate metadata
189+
runs-on: ubuntu-latest
190+
needs: [ Build ]
191+
steps:
192+
- uses: actions/checkout@v4
193+
- name: Set up Python
194+
uses: actions/setup-python@v4
195+
with:
196+
python-version: '3.x'
197+
cache: 'pip'
198+
- name: Install dependencies
147199
run: |
148-
twine upload --skip-existing dist/*
200+
python -m pip install --upgrade pip
201+
pip install --upgrade twine
202+
- uses: actions/download-artifact@v3
203+
with:
204+
# unpacks default artifact into dist/
205+
# if `name: wheels` is omitted, the action will create extra parent dir
206+
name: wheels
207+
path: dist
208+
- name: Validate metadata
209+
run: |
210+
twine check dist/*
211+
212+
Deploy:
213+
needs: [Build, Metadata]
214+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
215+
runs-on: ubuntu-latest
216+
environment:
217+
name: pypi
218+
url: https://pypi.org/p/SQLAlchemy-JSONField
219+
permissions:
220+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
221+
steps:
222+
- uses: actions/download-artifact@v3
223+
with:
224+
# unpacks default artifact into dist/
225+
# if `name: artifact` is omitted, the action will create extra parent dir
226+
name: wheels
227+
path: dist
228+
- name: Publish package distributions to PyPI
229+
uses: pypa/gh-action-pypi-publish@release/v1

.pydocstyle.ini

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

0 commit comments

Comments
 (0)