From f743b1c10203907c9325eebbc20827c9a8af6be0 Mon Sep 17 00:00:00 2001 From: Federico Capoano Date: Mon, 9 May 2022 18:47:29 -0400 Subject: [PATCH] 1.0.0 release --- .github/workflows/ci.yml | 3 +-- CHANGES.rst | 15 +++++++++++++++ README.rst | 1 + requirements-test.txt | 2 +- rest_framework_gis/__init__.py | 2 +- setup.py | 5 ++++- .../serializers.py | 14 +++++++------- .../test_performance.py | 2 +- tests/django_restframework_gis_tests/tests.py | 17 +++++++++++------ 9 files changed, 42 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e9aa1e22..301b83d2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -90,7 +90,7 @@ jobs: run: | pip install -U pip wheel setuptools pip install -U -r requirements-test.txt - pip install tox docutils pygments + pip install tox docutils pygments twine - name: QA checks run: | @@ -99,7 +99,6 @@ jobs: - name: Tests run: | tox -e ${{ matrix.env.TOXENV }} - python setup.py check -r -s env: POSTGRES_HOST: localhost diff --git a/CHANGES.rst b/CHANGES.rst index f219c000..9fda27e6 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,6 +1,21 @@ Changelog ========= +Version 1.0.0 [2022-05-09] +-------------------------- + +Features +~~~~~~~~ + +- Added support Bounding Box to ``GeometryField`` via the ``auto_bbox`` + initialization argument + +Bugfixes +~~~~~~~~ + +- Avoid ``default_app_config`` Deprecation Warning in Django >= 3.2 +- Fixed deserialization of the ``id_field`` + Version 0.18.0 [2022-01-07] --------------------------- diff --git a/README.rst b/README.rst index 2c8cf8df..66b45310 100644 --- a/README.rst +++ b/README.rst @@ -39,6 +39,7 @@ Compatibility with DRF, Django and Python ======================== ============================ ==================== ================================== DRF-gis version DRF version Django version Python version +**1.0.x** **3.10** up to **3.13** **2.2 to 4.0** **3.6** to **3.9** **0.18.x** **3.10** up to **3.13** **2.2 to 4.0** **3.6** to **3.9** **0.17.x** **3.10** up to **3.12** **2.2 to 3.1** **3.6** to **3.8** **0.16.x** **3.10** **2.2 to 3.1** **3.6** to **3.8** diff --git a/requirements-test.txt b/requirements-test.txt index e249bd33..3c0aff2d 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -2,5 +2,5 @@ psycopg2~=2.8.0 django-filter>=2.0 contexttimer # QA checks -openwisp-utils[qa]~=0.7.0 +openwisp-utils[qa]~=1.0.0 packaging~=20.4 diff --git a/rest_framework_gis/__init__.py b/rest_framework_gis/__init__.py index 86f7262b..9a52eaa1 100644 --- a/rest_framework_gis/__init__.py +++ b/rest_framework_gis/__init__.py @@ -1,4 +1,4 @@ -VERSION = (0, 18, 0, 'final') +VERSION = (1, 0, 0, 'final') __version__ = VERSION # alias diff --git a/setup.py b/setup.py index c1115e40..1e9d7621 100644 --- a/setup.py +++ b/setup.py @@ -55,7 +55,10 @@ ], project_urls={ 'Bug Reports': 'https://github.com/openwisp/django-rest-framework-gis/issues', - 'Continuous Integration': 'https://travis-ci.org/openwisp/django-rest-framework-gis', + 'Continuous Integration': ( + 'https://github.com/openwisp/django-rest-framework-gis/actions?' + 'query=workflow%3A%22Django+Rest+Framework+Gis+CI+Build%22' + ), 'Mailing List': 'https://groups.google.com/forum/#!forum/django-rest-framework-gis', 'Code Coverage': 'https://coveralls.io/github/openwisp/django-rest-framework-gis', 'Source Code': 'https://github.com/openwisp/django-rest-framework-gis', diff --git a/tests/django_restframework_gis_tests/serializers.py b/tests/django_restframework_gis_tests/serializers.py index 348ae4de..95ef3371 100644 --- a/tests/django_restframework_gis_tests/serializers.py +++ b/tests/django_restframework_gis_tests/serializers.py @@ -43,7 +43,7 @@ class LocationGeoSerializer(serializers.ModelSerializer): - """ location geo serializer """ + """location geo serializer""" details = serializers.HyperlinkedIdentityField(view_name='api_location_details') @@ -59,7 +59,7 @@ class PaginatedLocationGeoSerializer(pagination.PageNumberPagination): class LocationGeoFeatureSerializer(gis_serializers.GeoFeatureModelSerializer): - """ location geo serializer """ + """location geo serializer""" details = serializers.HyperlinkedIdentityField( view_name='api_geojson_location_details' @@ -76,7 +76,7 @@ class Meta: class LocationGeoFeatureSlugSerializer(LocationGeoFeatureSerializer): - """ use slug as id attribute """ + """use slug as id attribute""" class Meta: model = Location @@ -86,7 +86,7 @@ class Meta: class LocationGeoFeatureFalseIdSerializer(LocationGeoFeatureSerializer): - """ id attribute set as False """ + """id attribute set as False""" class Meta: model = Location @@ -108,7 +108,7 @@ class Meta: class LocationGeoFeatureWritableIdSerializer(LocationGeoFeatureSerializer): - """ default id attribute """ + """default id attribute""" class Meta: model = Location @@ -119,7 +119,7 @@ class Meta: class LocatedFileGeoFeatureSerializer(gis_serializers.GeoFeatureModelSerializer): - """ located file geo serializer """ + """located file geo serializer""" details = serializers.HyperlinkedIdentityField( view_name='api_geojson_located_file_details' @@ -137,7 +137,7 @@ class Meta: class BoxedLocationGeoFeatureSerializer(gis_serializers.GeoFeatureModelSerializer): - """ location geo serializer """ + """location geo serializer""" details = serializers.HyperlinkedIdentityField( view_name='api_geojson_boxedlocation_details' diff --git a/tests/django_restframework_gis_tests/test_performance.py b/tests/django_restframework_gis_tests/test_performance.py index 3e5cd54f..b69cacfe 100644 --- a/tests/django_restframework_gis_tests/test_performance.py +++ b/tests/django_restframework_gis_tests/test_performance.py @@ -22,7 +22,7 @@ class TestRestFrameworkGisPerformance(TestCase): NUMBER_OF_LOCATIONS = 10000 def _create_data(self): - """ creates a bunch of gis models instances """ + """creates a bunch of gis models instances""" locations = [] name = 'l{0}' slug = 'l{0}' diff --git a/tests/django_restframework_gis_tests/tests.py b/tests/django_restframework_gis_tests/tests.py index 4bb4a1aa..d4305800 100644 --- a/tests/django_restframework_gis_tests/tests.py +++ b/tests/django_restframework_gis_tests/tests.py @@ -106,7 +106,7 @@ def test_post_location_list_geojson(self): self.assertEqual(Location.objects.count(), 2) def test_post_location_list_geojson_as_multipartformdata(self): - """ emulate sending geojson string in webform """ + """emulate sending geojson string in webform""" self.assertEqual(Location.objects.count(), 0) data = { "name": "geojson input test", @@ -278,7 +278,7 @@ def test_post_location_list_invalid_geojson(self): self.assertEqual(response.data['geometry'][0], self.gdal_error_message) def test_geojson_format(self): - """ test geojson format """ + """test geojson format""" location = Location.objects.create( name='geojson test', geometry='POINT (135.0 45.0)' ) @@ -339,7 +339,9 @@ def test_post_geojson_id_attribute(self): } url = reverse('api_geojson_location_writable_id_list') response = self.client.post( - url, data=json.dumps(data), content_type='application/json', + url, + data=json.dumps(data), + content_type='application/json', ) self.assertEqual(response.status_code, 201) self.assertEqual(Location.objects.count(), 1) @@ -489,7 +491,7 @@ def test_geofeatured_model_serializer_compatible_with_geomodel_serializer(self): self.assertEqual(Location.objects.count(), 1) def test_geofeatured_model_post_as_multipartformdata(self): - """ emulate sending geojson string in webform """ + """emulate sending geojson string in webform""" self.assertEqual(Location.objects.count(), 0) data = { "name": "geojson input test", @@ -716,14 +718,17 @@ def test_geojson_pagination(self): def test_pickle(self): geometry = GEOSGeometry('POINT (30 10)') geojsondict = GeoJsonDict( - (('type', geometry.geom_type), ('coordinates', geometry.coords),) + ( + ('type', geometry.geom_type), + ('coordinates', geometry.coords), + ) ) pickled = pickle.dumps(geojsondict) restored = pickle.loads(pickled) self.assertEqual(restored, geojsondict) def test_geometrycollection_geojson(self): - """ test geometry collection geojson behaviour """ + """test geometry collection geojson behaviour""" location = Location.objects.create( name='geometry collection geojson test', geometry='GEOMETRYCOLLECTION ('