Skip to content

Commit

Permalink
Support Django 4.0
Browse files Browse the repository at this point in the history
Replace calls to deprecated methods

Fix test config & Replace additional methods removed in django 4.0

Update tox for official Django 4 release
  • Loading branch information
MisterGlass authored and tim-schilling committed Dec 9, 2021
1 parent e7f7d8d commit 82b2d06
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 12 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ jobs:
matrix:
django: ["2.2", "3.0", "3.1", "3.2"]
python-version: ["3.6", "3.7", "3.8", "3.9"]

include:
- django: "3.2"
python-version: "3.10"
- django: "4.0"
python-version: "3.10"
- django: "main"
python-version: "3.10"
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand Down
6 changes: 3 additions & 3 deletions graphene_django/tests/urls.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from django.conf.urls import url
from django.urls import re_path

from ..views import GraphQLView

urlpatterns = [
url(r"^graphql/batch", GraphQLView.as_view(batch=True)),
url(r"^graphql", GraphQLView.as_view(graphiql=True)),
re_path(r"^graphql/batch", GraphQLView.as_view(batch=True)),
re_path(r"^graphql", GraphQLView.as_view(graphiql=True)),
]
4 changes: 2 additions & 2 deletions graphene_django/tests/urls_inherited.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from django.conf.urls import url
from django.urls import re_path

from ..views import GraphQLView
from .schema_view import schema
Expand All @@ -10,4 +10,4 @@ class CustomGraphQLView(GraphQLView):
pretty = True


urlpatterns = [url(r"^graphql/inherited/$", CustomGraphQLView.as_view())]
urlpatterns = [re_path(r"^graphql/inherited/$", CustomGraphQLView.as_view())]
4 changes: 2 additions & 2 deletions graphene_django/tests/urls_pretty.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django.conf.urls import url
from django.urls import re_path

from ..views import GraphQLView
from .schema_view import schema

urlpatterns = [url(r"^graphql", GraphQLView.as_view(schema=schema, pretty=True))]
urlpatterns = [re_path(r"^graphql", GraphQLView.as_view(schema=schema, pretty=True))]
12 changes: 8 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[tox]
envlist =
py{36,37,38,39}-django{22,30,31,32,main},
py{36,37,38,39}-django{22,30,31},
py{36,37,38,39,310}-django32,
py{38,39,310}-django{40,main},
black,flake8

[gh-actions]
Expand All @@ -9,13 +11,15 @@ python =
3.7: py37
3.8: py38
3.9: py39
3.10: py310

[gh-actions:env]
DJANGO =
2.2: django22
3.0: django30
3.1: django31
3.2: django32
4.0: django40
main: djangomain

[testenv]
Expand All @@ -26,13 +30,13 @@ setenv =
deps =
-e.[test]
psycopg2-binary
django20: Django>=2.0,<2.1
django21: Django>=2.1,<2.2
django22: Django>=2.2,<3.0
django30: Django>=3.0a1,<3.1
django30: Django>=3.0,<3.1
django31: Django>=3.1,<3.2
django32: Django>=3.2a1,<3.3
djangomain: https://github.com/django/django/archive/main.zip
django32: Django>=3.2,<4.0
django40: Django>=4.0,<4.1
commands = {posargs:py.test --cov=graphene_django graphene_django examples}

[testenv:black]
Expand Down

0 comments on commit 82b2d06

Please sign in to comment.