Skip to content

Commit 2f6df04

Browse files
authored
[deps/ci] QA reformat, updated CI, updated deps
- Formatted code with black - Updated CI configuration (consistent with other OpenWISP repos) - PostgreSQL 15 for testing - Upgraded psycopg2~=2.9.0 - Dropped support for EOL Python and Django versions - Dropped support for Python 3.6 and 3.7 - Dropped support for Django 2.2, 3.0, 3.1 and 4.0 - Dropped support for djangorestframework < 3.12 - Pinned djangorestframework>=3.12,<3.15 and django-filters~=23.5 - Added Django 5.0, Django 5.1 & DRF 3.15.X to tox conf - Added GitHub workflow for publishing PyPI packages --------- Signed-off-by: Gagan Deep <[email protected]>
1 parent 110abaa commit 2f6df04

20 files changed

+302
-192
lines changed

.coveragerc

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

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,9 @@ updates:
1111
interval: "monthly"
1212
commit-message:
1313
prefix: "[deps] "
14+
- package-ecosystem: "github-actions" # Check for GitHub Actions updates
15+
directory: "/"
16+
schedule:
17+
interval: "monthly" # Check for updates weekly
18+
commit-message:
19+
prefix: "[ci] "

.github/workflows/ci.yml

Lines changed: 60 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616

1717
services:
1818
postgres:
19-
image: postgis/postgis:10-2.5
19+
image: postgis/postgis:15-3.4-alpine
2020
env:
2121
POSTGRES_PASSWORD: postgres
2222
POSTGRES_USER: postgres
@@ -29,97 +29,89 @@ jobs:
2929
fail-fast: false
3030
matrix:
3131
env:
32-
- python: 3.6
33-
TOXENV: py36-django22-djangorestframework310
34-
- python: 3.7
35-
TOXENV: py37-django22-djangorestframework310
36-
- python: 3.8
37-
TOXENV: py38-django22-djangorestframework310
38-
- python: 3.9
39-
TOXENV: py39-django22-djangorestframework310
40-
- python: 3.6
41-
TOXENV: py36-django22-djangorestframework312
42-
- python: 3.7
43-
TOXENV: py37-django22-djangorestframework312
44-
- python: 3.8
45-
TOXENV: py38-django22-djangorestframework312
46-
- python: 3.9
47-
TOXENV: py39-django22-djangorestframework312
48-
- python: 3.6
49-
TOXENV: py36-django30-djangorestframework312
50-
- python: 3.7
51-
TOXENV: py37-django30-djangorestframework312
52-
- python: 3.8
53-
TOXENV: py38-django30-djangorestframework312
54-
- python: 3.9
55-
TOXENV: py39-django30-djangorestframework312
56-
- python: 3.6
57-
TOXENV: py36-django31-djangorestframework312
58-
- python: 3.7
59-
TOXENV: py37-django31-djangorestframework312
60-
- python: 3.8
61-
TOXENV: py38-django31-djangorestframework312
62-
- python: 3.9
63-
TOXENV: py39-django31-djangorestframework312
64-
- python: 3.7
65-
TOXENV: py37-django32-djangorestframework312
66-
- python: 3.8
32+
- python: '3.8'
6733
TOXENV: py38-django32-djangorestframework312
68-
- python: 3.9
34+
- python: '3.8'
35+
TOXENV: py38-django32-djangorestframework313
36+
- python: '3.8'
37+
TOXENV: py38-django32-djangorestframework314
38+
- python: '3.8'
39+
TOXENV: py38-django42-djangorestframework314
40+
- python: '3.9'
6941
TOXENV: py39-django32-djangorestframework312
70-
- python: 3.8
71-
TOXENV: py38-django40-djangorestframework313
72-
- python: 3.9
73-
TOXENV: py39-django40-djangorestframework313
42+
- python: '3.9'
43+
TOXENV: py39-django32-djangorestframework313
44+
- python: '3.9'
45+
TOXENV: py39-django32-djangorestframework314
46+
- python: '3.9'
47+
TOXENV: py39-django42-djangorestframework314
48+
- python: '3.10'
49+
TOXENV: py310-django32-djangorestframework312
50+
- python: '3.10'
51+
TOXENV: py310-django32-djangorestframework313
52+
- python: '3.10'
53+
TOXENV: py310-django32-djangorestframework314
54+
- python: '3.10'
55+
TOXENV: py310-django42-djangorestframework314
56+
- python: '3.11'
57+
TOXENV: py311-django42-djangorestframework314
58+
- python: '3.11'
59+
TOXENV: py311-django50-djangorestframework315
60+
- python: '3.12'
61+
TOXENV: py312-django50-djangorestframework315
62+
- python: '3.11'
63+
TOXENV: py311-django51-djangorestframework315
64+
- python: '3.12'
65+
TOXENV: py312-django51-djangorestframework315
7466
steps:
75-
- uses: actions/checkout@v2
67+
- uses: actions/checkout@v4
7668
with:
7769
ref: ${{ github.event.pull_request.head.sha }}
7870

7971
- name: Set up Python ${{ matrix.env.python }}
80-
uses: actions/setup-python@v2
72+
uses: actions/setup-python@v5
8173
with:
8274
python-version: ${{ matrix.env.python }}
75+
cache: 'pip'
76+
cache-dependency-path: |
77+
**/requirements*.txt
8378
84-
- name: Install system packages
85-
run: |
86-
sudo apt-get update
87-
sudo apt-get install binutils libproj-dev gdal-bin -y
88-
89-
- name: Install python dependencies
79+
- name: Install Dependencies
80+
id: deps
9081
run: |
82+
sudo apt -qq update
83+
sudo apt -qq -y install binutils libproj-dev gdal-bin
9184
pip install -U pip wheel setuptools
9285
pip install -U -r requirements-test.txt
9386
pip install tox docutils pygments twine
9487
88+
- name: QA checks
89+
run: |
90+
./run-qa-checks
91+
9592
- name: Tests
93+
if: ${{ !cancelled() && steps.deps.conclusion == 'success' }}
9694
run: |
9795
tox -e ${{ matrix.env.TOXENV }}
96+
coverage combine
97+
coverage xml
9898
env:
9999
POSTGRES_HOST: localhost
100100

101101
- name: Upload Coverage
102-
run: coveralls --service=github
103-
env:
104-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
105-
COVERALLS_FLAG_NAME: |
106-
python-${{ matrix.env.env }}
107-
COVERALLS_PARALLEL: true
108-
109-
- name: QA checks
110-
run: |
111-
pip install "importlib-metadata<5.0" # remove when flake8 is upgraded
112-
./run-qa-checks
102+
if: ${{ success() }}
103+
uses: coverallsapp/github-action@v2
104+
with:
105+
parallel: true
106+
format: cobertura
107+
flag-name: python-${{ matrix.env.env }}
108+
github-token: ${{ secrets.GITHUB_TOKEN }}
113109

114110
coveralls:
115-
name: Finish Coveralls
116111
needs: build
117112
runs-on: ubuntu-latest
118-
container: python:3-slim
119113
steps:
120-
- name: Finished
121-
run: |
122-
pip3 install --upgrade coveralls
123-
coveralls --finish
124-
env:
125-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
114+
- name: Coveralls Finished
115+
uses: coverallsapp/github-action@v2
116+
with:
117+
parallel-finished: true

.github/workflows/pypi.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Publish Python Package to Pypi.org
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
permissions:
8+
id-token: write
9+
10+
jobs:
11+
pypi-publish:
12+
name: Release Python Package on Pypi.org
13+
runs-on: ubuntu-latest
14+
environment:
15+
name: pypi
16+
url: https://pypi.org/p/djangorestframework-gis
17+
permissions:
18+
id-token: write
19+
steps:
20+
- uses: actions/checkout@v4
21+
- name: Set up Python
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: '3.10'
25+
- name: Install dependencies
26+
run: |
27+
pip install -U pip
28+
pip install build
29+
- name: Build package
30+
run: python -m build
31+
- name: Publish package distributions to PyPI
32+
uses: pypa/[email protected]

0 commit comments

Comments
 (0)