From f7359fd03612d86be27a525a66a2f8a3a3bf7efb Mon Sep 17 00:00:00 2001 From: Gagaro Date: Mon, 17 Oct 2022 10:16:49 +0200 Subject: [PATCH] Remove support for Django < 3.2 --- .github/workflows/main.yml | 31 +++++++++-------------- CHANGES | 4 +-- djgeojson/tests.py | 4 --- tox.ini | 50 ++++++++++++++++++++++++++------------ 4 files changed, 49 insertions(+), 40 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f0ffea6..8cd489b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,11 +3,7 @@ name: Python application -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] +on: [push, pull_request] jobs: tests_python: @@ -15,21 +11,17 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - django_version: [ '2.2', '3.0', '3.1', '3.2' ] - python_version: [ '3.5', '3.6', '3.7', '3.8', '3.9' ] + django_version: [ '3.2', '4.0', '4.1' ] + python_version: [ '3.7', '3.8', '3.9', '3.10' ] exclude: - - django_version: '3.0' - python_version: '3.5' - - django_version: '3.1' - python_version: '3.5' + - django_version: '4.0' + python_version: '3.7' - - django_version: '3.2' - python_version: '3.5' + - django_version: '4.1' + python_version: '3.7' env: - SPATIALITE_LIBRARY_PATH: 'mod_spatialite.so' GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} steps: - uses: actions/checkout@v2 @@ -49,14 +41,15 @@ jobs: sudo apt-get install -y libproj-dev libgeos-dev gdal-bin libgdal-dev libsqlite3-mod-spatialite python -m pip install --upgrade pip pip install -U flake8 coveralls argparse jsonfield - pip install -U Django~=${{ matrix.django_version }}.0 + pip install -U Django~=${{ matrix.django_version }} - name: Lint with flake8 run: | flake8 --ignore=E501,W504 djgeojson - - name: Test + - name: Test Django run: | - python -W error::DeprecationWarning -W error::PendingDeprecationWarning -m coverage run ./quicktest.py djgeojson + python -m coverage run ./quicktest.py djgeojson +# python -W error::DeprecationWarning -W error::PendingDeprecationWarning -m coverage run ./quicktest.py djgeojson - name: Coverage if: ${{ success() }} run: | - coveralls + coveralls --service=github diff --git a/CHANGES b/CHANGES index 1ef0de7..ef500a6 100644 --- a/CHANGES +++ b/CHANGES @@ -2,10 +2,10 @@ CHANGELOG ========= -3.2.2 (unreleased) +3.3.0 (unreleased) ================== -- +- Drop support for Python < 3.7 / Django < 3.2 3.2.1 (2022-02-21) ================== diff --git a/djgeojson/tests.py b/djgeojson/tests.py index ddb0723..11960e1 100644 --- a/djgeojson/tests.py +++ b/djgeojson/tests.py @@ -153,8 +153,6 @@ def test_basic(self): self.assertEqual(actual_geojson_with_prop, {"crs": {"type": "link", "properties": {"href": "http://spatialreference.org/ref/epsg/4326/", "type": "proj4"}}, "type": "FeatureCollection", "features": [{"geometry": {"type": "LineString", "coordinates": [[0.0, 0.0], [1.0, 1.0]]}, "type": "Feature", "properties": {"picture": "image.png", "model": "djgeojson.route", "upper_name": "GREEN", "name": "green"}, "id": route1.pk}, {"geometry": {"type": "LineString", "coordinates": [[0.0, 0.0], [1.0, 1.0]]}, "type": "Feature", "properties": {"picture": "image.png", "model": "djgeojson.route", "upper_name": "BLUE", "name": "blue"}, "id": route2.pk}, {"geometry": {"type": "LineString", "coordinates": [[0.0, 0.0], [1.0, 1.0]]}, "type": "Feature", "properties": {"picture": "image.png", "model": "djgeojson.route", "upper_name": "RED", "name": "red"}, "id": route3.pk}]}) - # x y are reversed on CI - @unittest.expectedFailure def test_precision(self): serializer = Serializer() features = json.loads(serializer.serialize( @@ -677,8 +675,6 @@ def setUp(self): self.p1 = FixedSridPoint.objects.create(geom=Point(253286, 531490)) self.p2 = FixedSridPoint.objects.create(geom=Point(253442, 532897)) - # x y are reversed on CI - @unittest.expectedFailure def test_within_viewport(self): self.view.args = [12, 2125, 1338] response = self.view.render_to_response(context={}) diff --git a/tox.ini b/tox.ini index b06c8c0..d6ba5a5 100644 --- a/tox.ini +++ b/tox.ini @@ -1,21 +1,41 @@ -# Tox (http://tox.testrun.org/) is a tool for running tests -# in multiple virtualenvs. This configuration file will run the -# test suite on all supported python versions. To use it, "pip install tox" -# and then run "tox" from this directory. - [tox] +skipsdist = True envlist = - py35-django{22} - py36-django{22,30,31,32} - py37-django{22,30,31,32} - py38-django{22,30,31,32} - py39-django{22,30,31,32} + {py37}-django-{32} + {py38}-django-{32,40,41} + {py39}-django-{32,40,41} + {py310}-django-{32,40,41} + {py310}-isort + {py310}-flake8 [testenv] -commands = python -W error::DeprecationWarning -W error::PendingDeprecationWarning -W ignore:::site -W ignore:::distutils quicktest.py djgeojson +setenv = + PYTHONPATH = {toxinidir}:{toxinidir} deps = - django22: django>=2.2,<3.0 - django30: django>=3.0,<3.1 - django31: django>=3.1,<3.2 - django32: django>=3.2,<4.0 jsonfield + flake8: flake8>=2.0,<3.0 + django-32: Django>=3.2,<3.3 + django-40: Django>=4.0,<4.1 + django-41: Django>=4.1,<4.2 + isort: isort +commands = + isort: isort . + flake8: flake8 safedelete --ignore=E501 +# django: python -W error::DeprecationWarning -W error::PendingDeprecationWarning -W ignore:::site -W ignore:::distutils {toxinidir}/quicktest.py djgeojson + django: python {toxinidir}/quicktest.py djgeojson + +[testenv:docs] +basepython = python +changedir = docs +deps = + sphinx + sphinx_rtd_theme + Django>=3.2,<4.1 +commands = + sphinx-build -W -b html -d build/doctrees . build/html + +[isort] +skip_gitignore = true +include_trailing_comma = true +multi_line_output = 3 +line_length = 80