Skip to content

Commit

Permalink
Remove support for Django < 3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Gagaro committed Oct 17, 2022
1 parent 062e5fe commit f7359fd
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 40 deletions.
31 changes: 12 additions & 19 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,25 @@

name: Python application

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
on: [push, pull_request]

jobs:
tests_python:
name: Test on Python ${{ matrix.python_version }} and Django ${{ matrix.django_version }}
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
Expand All @@ -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
4 changes: 2 additions & 2 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -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)
==================
Expand Down
4 changes: 0 additions & 4 deletions djgeojson/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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={})
Expand Down
50 changes: 35 additions & 15 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit f7359fd

Please sign in to comment.