Skip to content

Commit d39f889

Browse files
committed
[chores] Formatted code, updated CI configuration
Use PostgreSQL 15 for testing
1 parent 110abaa commit d39f889

File tree

15 files changed

+213
-113
lines changed

15 files changed

+213
-113
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: 22 additions & 24 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
@@ -72,54 +72,52 @@ jobs:
7272
- python: 3.9
7373
TOXENV: py39-django40-djangorestframework313
7474
steps:
75-
- uses: actions/checkout@v2
75+
- uses: actions/checkout@v4
7676
with:
7777
ref: ${{ github.event.pull_request.head.sha }}
7878

7979
- name: Set up Python ${{ matrix.env.python }}
80-
uses: actions/setup-python@v2
80+
uses: actions/setup-python@v5
8181
with:
8282
python-version: ${{ matrix.env.python }}
83+
cache: 'pip'
84+
cache-dependency-path: |
85+
**/requirements*.txt
8386
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
87+
- name: Install Dependencies
9088
run: |
89+
sudo apt -qq update
90+
sudo apt -qq -y install binutils libproj-dev gdal-bin
9191
pip install -U pip wheel setuptools
9292
pip install -U -r requirements-test.txt
9393
pip install tox docutils pygments twine
9494
9595
- name: Tests
9696
run: |
9797
tox -e ${{ matrix.env.TOXENV }}
98+
coverage combine
99+
coverage xml
98100
env:
99101
POSTGRES_HOST: localhost
100102

101103
- 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
104+
uses: coverallsapp/github-action@v2
105+
with:
106+
parallel: true
107+
format: cobertura
108+
flag-name: python-${{ matrix.env.env }}
109+
github-token: ${{ secrets.GITHUB_TOKEN }}
110+
108111

109112
- name: QA checks
110113
run: |
111-
pip install "importlib-metadata<5.0" # remove when flake8 is upgraded
112114
./run-qa-checks
113115
114116
coveralls:
115-
name: Finish Coveralls
116117
needs: build
117118
runs-on: ubuntu-latest
118-
container: python:3-slim
119119
steps:
120-
- name: Finished
121-
run: |
122-
pip3 install --upgrade coveralls
123-
coveralls --finish
124-
env:
125-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
120+
- name: Coveralls Finished
121+
uses: coverallsapp/github-action@v2
122+
with:
123+
parallel-finished: true

CHANGES.rst

Lines changed: 147 additions & 64 deletions
Large diffs are not rendered by default.

CONTRIBUTING.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
Contributing
22
============
33

4-
Thanks for your interest! We love contributions, so please feel free to fix bugs, improve things, provide documentation. Just `follow the
5-
guidelines <https://github.com/openwisp/django-rest-framework-gis#contributing>`_ and submit a PR.
4+
Thanks for your interest! We love contributions, so please feel free to
5+
fix bugs, improve things, provide documentation. Just `follow the
6+
guidelines
7+
<https://github.com/openwisp/django-rest-framework-gis#contributing>`_ and
8+
submit a PR.

docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ services:
2020
command: sh -c "pip install -e . && python ./tests/manage.py test tests/django_restframework_gis_tests && ./run-qa-checks"
2121

2222
postgres:
23-
image: mdillon/postgis:10-alpine
23+
image: postgis/postgis:15-3.4-alpine
2424
environment:
2525
POSTGRES_PASSWORD: postgres
2626
POSTGRES_USER: postgres
2727
POSTGRES_DB: django_restframework_gis
28-
ports:
28+
ports:
2929
- 5432:5432
3030
volumes:
3131
- postgres_data:/var/lib/postgresql/data

performance_tests.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
Average of 5 measurements for python2 and python3.
22

3-
Launch the performance test with::
3+
Launch the performance test with:
4+
5+
::
46

57
cd tests
68
./manage.py test --keepdb django_restframework_gis_tests.test_performance
79

8-
For more information regarding how the measurement is performed read the code in
9-
`test_performance.py <https://github.com/openwisp/django-rest-framework-gis/blob/master/tests/django_restframework_gis_tests/test_performance.py>`__.
10+
For more information regarding how the measurement is performed read the
11+
code in `test_performance.py
12+
<https://github.com/openwisp/django-rest-framework-gis/blob/master/tests/django_restframework_gis_tests/test_performance.py>`__.
1013

1114
0.9.2
1215
=====

pyproject.toml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[tool.coverage.run]
2+
source = ["rest_framework_gis"]
3+
parallel = true
4+
concurrency = ["multiprocessing"]
5+
omit = [
6+
"rest_framework_gis/__init__.py",
7+
"*/tests/*",
8+
"*/migrations/*",
9+
]
10+
11+
[tool.docstrfmt]
12+
extend_exclude = ["**/*.py", "README.rst"]
13+
14+
[tool.isort]
15+
known_third_party = ["django", "rest_framework"]
16+
default_section = "THIRDPARTY"
17+
line_length = 88
18+
multi_line_output = 3
19+
use_parentheses = true
20+
include_trailing_comma = true
21+
force_grid_wrap = 0
22+

requirements-test.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@ psycopg2~=2.8.0
22
django-filter>=2.0
33
contexttimer
44
# QA checks
5-
openwisp-utils[qa]~=1.0.5
6-
packaging~=20.4
5+
openwisp-utils[qa] @ https://github.com/openwisp/openwisp-utils/tarball/master

rest_framework_gis/fields.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def to_internal_value(self, value):
6565
value = json.dumps(value)
6666
try:
6767
return GEOSGeometry(value)
68-
except (GEOSException):
68+
except GEOSException:
6969
raise ValidationError(
7070
_(
7171
'Invalid format: string or unicode input unrecognized as GeoJSON, WKT EWKT or HEXEWKB.'

0 commit comments

Comments
 (0)