diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 020fd078..6e5c0f2c 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.8'] + python-version: ['3.9'] steps: - uses: actions/checkout@v4 @@ -32,18 +32,21 @@ jobs: flake8 geostore test_geostore build: - runs-on: ubuntu-20.04 - #TODO: Fix when github action do not show failed for the workflow with continue-on-error - # continue-on-error: true + runs-on: ubuntu-latest needs: [lint] strategy: matrix: - python-version: ['3.8', '3.10', '3.12'] - django-version: ['3.2.*', '4.2.*', '5.0.*'] + python-version: ['3.9', '3.10', '3.13'] + django-version: ['4.2.*', '5.1.*'] postgis-image: ['postgis/postgis:12-2.5'] exclude: - - python-version: '3.8' - django-version: '5.0.*' + - postgis-image: 'postgis/postgis:12-2.5' + django-version: '5.1.*' + - python-version: '3.9' + django-version: '5.1.*' + include: + - postgis-image: 'postgis/postgis:13-3.1' + django-version: '5.1.*' services: postgres: @@ -84,7 +87,8 @@ jobs: coverage run -a ./manage.py test --settings=test_geostore.settings_with_customs geostore.tests.test_views.test_async_exports coverage xml -o coverage.xml - - uses: codecov/codecov-action@v3 + - uses: codecov/codecov-action@v4 with: files: ./coverage.xml - fail_ci_if_error: true \ No newline at end of file + fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file diff --git a/CHANGES.md b/CHANGES.md index 0d30318b..987022cb 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,15 @@ CHANGELOG ========= +1.0.0+dev (XXXX-XX-XX) +--------------------------- + +* Add support for django 5.1 +* Add support for python 3.13 +* Drop support for django 3.2 +* Drop support for python 3.8 + + 1.0.0 (2024-01-12) --------------------------- diff --git a/Dockerfile b/Dockerfile index ab9746df..bb71569c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,21 @@ -FROM makinacorpus/geodjango:bionic-3.8 +FROM python:3.9-bookworm +ENV PYTHONUNBUFFERED=1 +ENV DEBIAN_FRONTEND=noninteractive +ENV LANG=C.UTF-8 + +RUN apt-get update -qq && apt-get -y upgrade && apt-get install -y -qq \ + # std libs + git less nano curl \ + ca-certificates \ + wget build-essential\ + # python basic libs + gettext \ + # geodjango + gdal-bin binutils libproj-dev libgdal-dev \ + # postgresql + libpq-dev postgresql-client && \ + apt-get clean all && rm -rf /var/apt/lists/* && rm -rf /var/cache/apt/* RUN mkdir -p /code/src RUN useradd -ms /bin/bash django @@ -8,7 +24,7 @@ COPY entrypoint.sh /usr/local/bin/entrypoint.sh USER django -RUN python3.8 -m venv /code/venv +RUN python3.9 -m venv /code/venv RUN /code/venv/bin/pip install --no-cache-dir pip setuptools wheel -U COPY . /code/src diff --git a/docker-compose.yml b/docker-compose.yml index 0b0c07e3..f1d4d95a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,3 @@ -version: "3" services: postgres: image: postgis/postgis:12-2.5 diff --git a/geostore/tests/test_commands/test_import_osm.py b/geostore/tests/test_commands/test_import_osm.py index bfcfae82..78296e4d 100644 --- a/geostore/tests/test_commands/test_import_osm.py +++ b/geostore/tests/test_commands/test_import_osm.py @@ -59,7 +59,6 @@ def test_good_query(self, mocked_get): type=type_feature, verbosity=1, stderr=output) - self.assertIn("Warning 1", output.getvalue()) self.assertEqual(Feature.objects.count(), 2) @mock.patch('requests.get') @@ -77,7 +76,6 @@ def test_good_query_on_existing_layer(self, mocked_get): type=type_feature, verbosity=1, stderr=output) - self.assertIn("Warning 1", output.getvalue()) self.assertEqual(layer.features.count(), 2) @mock.patch('requests.get') diff --git a/geostore/tests/test_views/test_async_exports.py b/geostore/tests/test_views/test_async_exports.py index 731aa3d8..98f3e410 100644 --- a/geostore/tests/test_views/test_async_exports.py +++ b/geostore/tests/test_views/test_async_exports.py @@ -133,8 +133,9 @@ def side_effect_now(): with default_storage.open(path_export) as fp: geojson = json.loads(fp.read()) feature = geojson['features'][0]['geometry'] - feature_geom = GEOSGeometry(json.dumps(feature)).ewkt - self.assertEqual(feature_geom, 'SRID=4326;POINT (2.4609375 45.58328975600632)') + feature_geom = GEOSGeometry(json.dumps(feature)) + self.assertAlmostEqual(feature_geom.x, 2.4609375) + self.assertAlmostEqual(feature_geom.y, 45.58328975600632) self.assertEqual(status.HTTP_202_ACCEPTED, response.status_code) diff --git a/geostore/tests/test_views/test_schemas.py b/geostore/tests/test_views/test_schemas.py index 770eb8fd..af61f398 100644 --- a/geostore/tests/test_views/test_schemas.py +++ b/geostore/tests/test_views/test_schemas.py @@ -71,16 +71,16 @@ def test_schema_property_match_good(self): def test_schema_property_match_bad(self): """ - If schema defined, deny unvalid data + If schema defined, deny invalid data """ response = self.client.post(reverse('feature-list', args=[self.property_schema_layer.pk, ]), data={"geom": "POINT(0 0)", "properties": {"name": 20, - "age": "wrong data"}}) + "age": 10}}) response_json = response.json() self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) self.assertIn("properties", response_json) - self.assertIn("wrong data", response_json['properties'][0]) + self.assertIn("20 is not of type 'string'", response_json['properties'][0]) def test_schema_property_doesnt_match(self): """