Skip to content

Commit 4b98823

Browse files
[deps] Add support for django 3.2 and 4.0 #263
* [fix] Fix docker-compose not working * [deps] Added python 3.6 back to support * [docs] Updated compatibility table and updated dependency monitoring Closes #263
1 parent 7bf70eb commit 4b98823

File tree

9 files changed

+108
-86
lines changed

9 files changed

+108
-86
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,16 @@ jobs:
6161
TOXENV: py38-django31-djangorestframework312
6262
- python: 3.9
6363
TOXENV: py39-django31-djangorestframework312
64+
- python: 3.7
65+
TOXENV: py37-django32-djangorestframework312
66+
- python: 3.8
67+
TOXENV: py38-django32-djangorestframework312
68+
- python: 3.9
69+
TOXENV: py39-django32-djangorestframework312
70+
- python: 3.8
71+
TOXENV: py38-django40-djangorestframework_master
72+
- python: 3.9
73+
TOXENV: py39-django40-djangorestframework_master
6474
steps:
6575
- uses: actions/checkout@v2
6676
with:
@@ -78,7 +88,7 @@ jobs:
7888
7989
- name: Install python dependencies
8090
run: |
81-
pip install -U "pip==20.2.4" wheel setuptools
91+
pip install -U pip wheel setuptools
8292
pip install -U -r requirements-test.txt
8393
pip install tox docutils pygments
8494

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.7-alpine3.8
1+
FROM python:3.7-alpine
22

33
# postgresql-client is required by psql
44
# postgresql-dev musl-dev gcc are required by psycopg

README.rst

Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -37,35 +37,36 @@ Add ``rest_framework_gis`` in ``settings.INSTALLED_APPS``, after ``rest_framewor
3737
Compatibility with DRF, Django and Python
3838
-----------------------------------------
3939

40-
=============== ============================ ==================== ==================================
41-
DRF-gis version DRF version Django version Python version
42-
**0.17.x** **3.10** up to **3.12** **2.2 to 3.1** **3.6** to **3.8**
43-
**0.16.x** **3.10** **2.2 to 3.1** **3.6** to **3.8**
44-
**0.15.x** **3.10** **1.11, 2.2 to 3.0** **3.5** to **3.8**
45-
**0.14.x** **3.3** to **3.9** **1.11** to **2.1** **3.4** to **3.7**
46-
**0.13.x** **3.3** to **3.8** **1.11** to **2.0** **2.7** to **3.6**
47-
**0.12.x** **3.1** to **3.7** **1.11** to **2.0** **2.7** to **3.6**
48-
**0.11.x** **3.1** to **3.6** **1.7** to **1.11** **2.7** to **3.6**
49-
**0.10.x** **3.1** to **3.3** **1.7** to **1.9** **2.7** to **3.5**
50-
**0.9.6** **3.1** to **3.2** **1.5** to **1.8** **2.6** to **3.5**
51-
**0.9.5** **3.1** to **3.2** **1.5** to **1.8** **2.6** to **3.4**
52-
**0.9.4** **3.1** to **3.2** **1.5** to **1.8** **2.6** to **3.4**
53-
**0.9.3** **3.1** **1.5** to **1.8** **2.6** to **3.4**
54-
**0.9.2** **3.1** **1.5** to **1.8** **2.6** to **3.4**
55-
**0.9.1** **3.1** **1.5** to **1.8** **2.6** to **3.4**
56-
**0.9** **3.1** **1.5** to **1.8** **2.6**, **2.7**, **3.3**, **3.4**
57-
**0.9** **3.1** **1.5** to **1.8** **2.6**, **2.7**, **3.3**, **3.4**
58-
**0.9** **3.1** **1.5** to **1.8** **2.6**, **2.7**, **3.3**, **3.4**
59-
**0.8.2** **3.0.4** to **3.1.1** **1.5** to **1.8** **2.6**, **2.7**, **3.3**, **3.4**
60-
**0.8.1** **3.0.4** to **3.1.1** **1.5** to **1.8** **2.6**, **2.7**, **3.3**, **3.4**
61-
**0.8** **3.0.4** **1.5** to **1.7** **2.6**, **2.7**, **3.3**, **3.4**
62-
**0.7** **2.4.3** **1.5** to **1.7** **2.6**, **2.7**, **3.3**, **3.4**
63-
**0.6** **2.4.3** **1.5** to **1.7** **2.6**, **2.7**, **3.3**, **3.4**
64-
**0.5** from **2.3.14** to **2.4.2** **1.5** to **1.7** **2.6**, **2.7**, **3.3**, **3.4**
65-
**0.4** from **2.3.14** to **2.4.2** **1.5** to **1.7** **2.6**, **2.7**, **3.3**, **3.4**
66-
**0.3** from **2.3.14** to **2.4.2** **1.5**, **1.6** **2.6**, **2.7**
67-
**0.2** from **2.2.2** to **2.3.13** **1.5**, **1.6** **2.6**, **2.7**
68-
=============== ============================ ==================== ==================================
40+
======================== ============================ ==================== ==================================
41+
DRF-gis version DRF version Django version Python version
42+
**0.18.x (unreleased)** **3.10** up to **3.12** **2.2 to 4.0** **3.6** to **3.9**
43+
**0.17.x** **3.10** up to **3.12** **2.2 to 3.1** **3.6** to **3.8**
44+
**0.16.x** **3.10** **2.2 to 3.1** **3.6** to **3.8**
45+
**0.15.x** **3.10** **1.11, 2.2 to 3.0** **3.5** to **3.8**
46+
**0.14.x** **3.3** to **3.9** **1.11** to **2.1** **3.4** to **3.7**
47+
**0.13.x** **3.3** to **3.8** **1.11** to **2.0** **2.7** to **3.6**
48+
**0.12.x** **3.1** to **3.7** **1.11** to **2.0** **2.7** to **3.6**
49+
**0.11.x** **3.1** to **3.6** **1.7** to **1.11** **2.7** to **3.6**
50+
**0.10.x** **3.1** to **3.3** **1.7** to **1.9** **2.7** to **3.5**
51+
**0.9.6** **3.1** to **3.2** **1.5** to **1.8** **2.6** to **3.5**
52+
**0.9.5** **3.1** to **3.2** **1.5** to **1.8** **2.6** to **3.4**
53+
**0.9.4** **3.1** to **3.2** **1.5** to **1.8** **2.6** to **3.4**
54+
**0.9.3** **3.1** **1.5** to **1.8** **2.6** to **3.4**
55+
**0.9.2** **3.1** **1.5** to **1.8** **2.6** to **3.4**
56+
**0.9.1** **3.1** **1.5** to **1.8** **2.6** to **3.4**
57+
**0.9** **3.1** **1.5** to **1.8** **2.6**, **2.7**, **3.3**, **3.4**
58+
**0.9** **3.1** **1.5** to **1.8** **2.6**, **2.7**, **3.3**, **3.4**
59+
**0.9** **3.1** **1.5** to **1.8** **2.6**, **2.7**, **3.3**, **3.4**
60+
**0.8.2** **3.0.4** to **3.1.1** **1.5** to **1.8** **2.6**, **2.7**, **3.3**, **3.4**
61+
**0.8.1** **3.0.4** to **3.1.1** **1.5** to **1.8** **2.6**, **2.7**, **3.3**, **3.4**
62+
**0.8** **3.0.4** **1.5** to **1.7** **2.6**, **2.7**, **3.3**, **3.4**
63+
**0.7** **2.4.3** **1.5** to **1.7** **2.6**, **2.7**, **3.3**, **3.4**
64+
**0.6** **2.4.3** **1.5** to **1.7** **2.6**, **2.7**, **3.3**, **3.4**
65+
**0.5** from **2.3.14** to **2.4.2** **1.5** to **1.7** **2.6**, **2.7**, **3.3**, **3.4**
66+
**0.4** from **2.3.14** to **2.4.2** **1.5** to **1.7** **2.6**, **2.7**, **3.3**, **3.4**
67+
**0.3** from **2.3.14** to **2.4.2** **1.5**, **1.6** **2.6**, **2.7**
68+
**0.2** from **2.2.2** to **2.3.13** **1.5**, **1.6** **2.6**, **2.7**
69+
======================== ============================ ==================== ==================================
6970

7071
Fields
7172
------
@@ -754,8 +755,9 @@ Contributing
754755
:target: https://github.com/openwisp/django-rest-framework-gis/actions?query=workflow%3A%22Django+Rest+Framework+Gis+CI+Build%22
755756
.. |Coverage Status| image:: https://coveralls.io/repos/openwisp/django-rest-framework-gis/badge.svg
756757
:target: https://coveralls.io/r/openwisp/django-rest-framework-gis
757-
.. |Requirements Status| image:: https://requires.io/github/openwisp/django-rest-framework-gis/requirements.svg?branch=master
758-
:target: https://requires.io/github/openwisp/django-rest-framework-gis/requirements/?branch=master
758+
.. |Requirements Status| image:: https://img.shields.io/librariesio/release/github/openwisp/django-rest-framework-gis
759+
:target: https://libraries.io/github/openwisp/django-rest-framework-gis#repository_dependencies
760+
:alt: Dependency monitoring
759761
.. |PyPI version| image:: https://badge.fury.io/py/djangorestframework-gis.svg
760762
:target: http://badge.fury.io/py/djangorestframework-gis
761763
.. |PyPI downloads| image:: https://pepy.tech/badge/djangorestframework-gis/month

docker-compose.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ services:
2121

2222
postgres:
2323
image: mdillon/postgis:10-alpine
24+
environment:
25+
POSTGRES_PASSWORD: postgres
26+
POSTGRES_USER: postgres
27+
POSTGRES_DB: django_restframework_gis
28+
ports:
29+
- 5432:5432
2430
volumes:
2531
- postgres_data:/var/lib/postgresql/data
2632

rest_framework_gis/fields.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from django.contrib.gis.gdal import GDALException
55
from django.contrib.gis.geos import GEOSException, GEOSGeometry
66
from django.core.exceptions import ValidationError
7-
from django.utils.translation import ugettext_lazy as _
7+
from django.utils.translation import gettext_lazy as _
88
from rest_framework.fields import Field, SerializerMethodField
99

1010
__all__ = ['GeometryField', 'GeometrySerializerMethodField']

tests/django_restframework_gis_tests/urls.py

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,108 +1,108 @@
1-
from django.conf.urls import url
1+
from django.urls import path
22

33
from . import views
44

55
urlpatterns = [
6-
url(r'^$', views.location_list, name='api_location_list'),
7-
url(r'^(?P<pk>[0-9]+)/$', views.location_details, name='api_location_details'),
6+
path('', views.location_list, name='api_location_list'),
7+
path('<int:pk>', views.location_details, name='api_location_details'),
88
# geojson
9-
url(r'^geojson/$', views.geojson_location_list, name='api_geojson_location_list'),
10-
url(
11-
r'^geojson/(?P<pk>[0-9]+)/$',
9+
path('geojson/', views.geojson_location_list, name='api_geojson_location_list'),
10+
path(
11+
'geojson/<int:pk>/',
1212
views.geojson_location_details,
1313
name='api_geojson_location_details',
1414
),
15-
url(
16-
r'^geojson-nullable/(?P<pk>[0-9]+)/$',
15+
path(
16+
'geojson-nullable/<int:pk>/',
1717
views.geojson_nullable_details,
1818
name='api_geojson_nullable_details',
1919
),
20-
url(
21-
r'^geojson_hidden/(?P<pk>[0-9]+)/$',
20+
path(
21+
'geojson_hidden/<int:pk>/',
2222
views.geojson_location_details_hidden,
2323
name='api_geojson_location_details_hidden',
2424
),
25-
url(
26-
r'^geojson_none/(?P<pk>[0-9]+)/$',
25+
path(
26+
'geojson_none/<int:pk>/',
2727
views.geojson_location_details_none,
2828
name='api_geojson_location_details_none',
2929
),
30-
url(
31-
r'^geojson/(?P<slug>[-\w]+)/$',
30+
path(
31+
'geojson/<slug:slug>/',
3232
views.geojson_location_slug_details,
3333
name='api_geojson_location_slug_details',
3434
),
35-
url(
36-
r'^geojson-falseid/(?P<pk>[0-9]+)/$',
35+
path(
36+
'geojson-falseid/<int:pk>/',
3737
views.geojson_location_falseid_details,
3838
name='api_geojson_location_falseid_details',
3939
),
40-
url(
41-
r'^geojson-noid/(?P<pk>[0-9]+)/$',
40+
path(
41+
'geojson-noid/<int:pk>/',
4242
views.geojson_location_noid_details,
4343
name='api_geojson_location_noid_details',
4444
),
4545
# file
46-
url(
47-
r'^geojson-file/(?P<pk>[0-9]+)/$',
46+
path(
47+
'geojson-file/<int:pk>/',
4848
views.geojson_located_file_details,
4949
name='api_geojson_located_file_details',
5050
),
5151
# geojson with bbox with its own geometry field
52-
url(
53-
r'^geojson-with-bbox/$',
52+
path(
53+
'geojson-with-bbox/',
5454
views.geojson_boxedlocation_list,
5555
name='api_geojson_boxedlocation_list',
5656
),
57-
url(
58-
r'^geojson-with-bbox/(?P<pk>[0-9]+)/$',
57+
path(
58+
'geojson-with-bbox/<int:pk>/',
5959
views.geojson_boxedlocation_details,
6060
name='api_geojson_boxedlocation_details',
6161
),
6262
# geojson with bbox with autogenerated bbox
63-
url(
64-
r'^geojson-with-auto-bbox/$',
63+
path(
64+
'geojson-with-auto-bbox/',
6565
views.geojson_location_bbox_list,
6666
name='api_geojson_location_bbox_list',
6767
),
6868
# Filters
69-
url(
70-
r'^filters/contained_in_bbox$',
69+
path(
70+
'filters/contained_in_bbox',
7171
views.geojson_location_contained_in_bbox_list,
7272
name='api_geojson_location_list_contained_in_bbox_filter',
7373
),
74-
url(
75-
r'^filters/overlaps_bbox$',
74+
path(
75+
'filters/overlaps_bbox',
7676
views.geojson_location_overlaps_bbox_list,
7777
name='api_geojson_location_list_overlaps_bbox_filter',
7878
),
79-
url(
80-
r'^filters/contained_in_geometry$',
79+
path(
80+
'filters/contained_in_geometry',
8181
views.geojson_contained_in_geometry,
8282
name='api_geojson_contained_in_geometry',
8383
),
84-
url(
85-
r'^filters/contained_in_tile$',
84+
path(
85+
'filters/contained_in_tile',
8686
views.geojson_location_contained_in_tile_list,
8787
name='api_geojson_location_list_contained_in_tile_filter',
8888
),
89-
url(
90-
r'^filters/overlaps_tile$',
89+
path(
90+
'filters/overlaps_tile',
9191
views.geojson_location_overlaps_tile_list,
9292
name='api_geojson_location_list_overlaps_tile_filter',
9393
),
94-
url(
95-
r'^filters/within_distance_of_point$',
94+
path(
95+
'filters/within_distance_of_point',
9696
views.geojson_location_within_distance_of_point_list,
9797
name='api_geojson_location_list_within_distance_of_point_filter',
9898
),
99-
url(
100-
r'^filters/within_degrees_of_point$',
99+
path(
100+
'filters/within_degrees_of_point',
101101
views.geojson_location_within_degrees_of_point_list,
102102
name='api_geojson_location_list_within_degrees_of_point_filter',
103103
),
104-
url(
105-
r'^filters/order_distance_to_point$',
104+
path(
105+
'filters/order_distance_to_point',
106106
views.geojson_location_order_distance_to_point_list,
107107
name='api_geojson_location_order_distance_to_point_list_filter',
108108
),

tests/settings.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
},
1717
}
1818

19+
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
20+
1921
SECRET_KEY = 'fn)t*+$)ugeyip6-#txyy$5wf2ervc0d2n#h)qb)y5@ly$t*@w'
2022

2123
INSTALLED_APPS = (
@@ -25,6 +27,7 @@
2527
'django.contrib.messages',
2628
'django.contrib.staticfiles',
2729
'django.contrib.admin',
30+
'django.contrib.gis',
2831
# rest framework
2932
'rest_framework',
3033
'rest_framework_gis',

tests/urls.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
1-
try:
2-
from django.urls import include, url
3-
except ImportError:
4-
from django.conf.urls import include, url
51
from django.contrib import admin
62
from django.contrib.staticfiles import views
3+
from django.urls import include, path
74

85
urlpatterns = [
96
# Uncomment the next line to enable the admin:
10-
url(r'^admin/', admin.site.urls),
7+
path('admin/', admin.site.urls),
118
# Uncomment the admin/doc line below to enable admin documentation:
12-
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
13-
url(r'', include('django_restframework_gis_tests.urls')),
14-
url(r'^static/(?P<path>.*)$', views.serve),
9+
# url('admin/doc/', include('django.contrib.admindocs.urls')),
10+
path('', include('django_restframework_gis_tests.urls')),
11+
path('static/<path>', views.serve),
1512
]

tox.ini

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
[tox]
22
envlist =
3-
py{36,37,38,39,py3}-django{22}-djangorestframework{310,312}{,-pytest}
4-
py{36,37,38,39,py3}-django{30,31}-djangorestframework{312}{,-pytest}
3+
py{37,38,39,py3}-django{22}-djangorestframework{310,312}{,-pytest}
4+
py{37,38,39,py3}-django{30,31,32}-djangorestframework{312}{,-pytest}
5+
py{38,39,py3}-django{40}-djangorestframework_master{,-pytest}
56

67
[testenv]
78
usedevelop = true
@@ -20,8 +21,11 @@ deps =
2021
django22: Django~=2.2.0
2122
django30: Django~=3.0.0
2223
django31: Django~=3.1.0
24+
django32: Django~=3.2.0
25+
django40: Django~=4.0.0
2326
djangorestframework310: djangorestframework~=3.10.0
2427
djangorestframework312: djangorestframework~=3.12.0
28+
djangorestframework_master: djangorestframework @ https://github.com/encode/django-rest-framework/tarball/master
2529
-rrequirements-test.txt
2630
pytest: pytest
2731
pytest: pytest-django

0 commit comments

Comments
 (0)