From 9a00c8c7fee6efaddf69458c978352f1ca6167d3 Mon Sep 17 00:00:00 2001 From: Yair Silbermintz Date: Wed, 1 Dec 2021 12:51:52 -0500 Subject: [PATCH 1/8] Replace calls to deprecated methods --- graphene_django/utils/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/graphene_django/utils/utils.py b/graphene_django/utils/utils.py index b1c9a7d0c..ff3b7f3ca 100644 --- a/graphene_django/utils/utils.py +++ b/graphene_django/utils/utils.py @@ -3,7 +3,7 @@ import six from django.db import connection, models, transaction from django.db.models.manager import Manager -from django.utils.encoding import force_text +from django.utils.encoding import force_str from django.utils.functional import Promise from graphene.utils.str_converters import to_camel_case @@ -26,7 +26,7 @@ def isiterable(value): def _camelize_django_str(s): if isinstance(s, Promise): - s = force_text(s) + s = force_str(s) return to_camel_case(s) if isinstance(s, six.string_types) else s From 72aaed5734b78b392304f31ccd608c63a9f1088b Mon Sep 17 00:00:00 2001 From: Yair Silbermintz Date: Wed, 1 Dec 2021 16:52:20 -0500 Subject: [PATCH 2/8] Fix test config & Replace additional methods removed in django 4.0 --- .github/workflows/tests.yml | 27 ++++++++++++++++++++----- graphene_django/tests/models.py | 2 +- graphene_django/tests/test_converter.py | 2 +- graphene_django/tests/urls.py | 6 +++--- graphene_django/tests/urls_inherited.py | 4 ++-- graphene_django/tests/urls_pretty.py | 4 ++-- tox.ini | 23 +++++++++++---------- 7 files changed, 43 insertions(+), 25 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b9e57b519..b4f023f3f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -8,12 +8,29 @@ jobs: strategy: max-parallel: 4 matrix: - django: ["1.11", "2.2", "3.0", "3.1"] - python-version: ["3.6", "3.7", "3.8"] + django: ["2.2", "3.0", "3.1", "3.2", "4.0"] + python-version: ["3.8", "3.9"] include: - - django: "1.11" - python-version: "2.7" - + - django: "2.2" + python-version: "3.6" + - django: "2.2" + python-version: "3.7" + - django: "3.0" + python-version: "3.6" + - django: "3.0" + python-version: "3.7" + - django: "3.1" + python-version: "3.6" + - django: "3.1" + python-version: "3.7" + - django: "3.2" + python-version: "3.6" + - django: "3.2" + python-version: "3.7" + - django: "3.2" + python-version: "3.10" + - django: "4.0" + python-version: "3.10" steps: - uses: actions/checkout@v1 - name: Set up Python ${{ matrix.python-version }} diff --git a/graphene_django/tests/models.py b/graphene_django/tests/models.py index 9e7be29e5..659cf6df4 100644 --- a/graphene_django/tests/models.py +++ b/graphene_django/tests/models.py @@ -1,7 +1,7 @@ from __future__ import absolute_import from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ CHOICES = ((1, "this"), (2, _("that"))) diff --git a/graphene_django/tests/test_converter.py b/graphene_django/tests/test_converter.py index df3771c4e..7b38a45fd 100644 --- a/graphene_django/tests/test_converter.py +++ b/graphene_django/tests/test_converter.py @@ -2,7 +2,7 @@ import pytest from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from py.test import raises import graphene diff --git a/graphene_django/tests/urls.py b/graphene_django/tests/urls.py index 66b3fc4d2..f2faae2bd 100644 --- a/graphene_django/tests/urls.py +++ b/graphene_django/tests/urls.py @@ -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)), ] diff --git a/graphene_django/tests/urls_inherited.py b/graphene_django/tests/urls_inherited.py index 6fa801916..815d04db8 100644 --- a/graphene_django/tests/urls_inherited.py +++ b/graphene_django/tests/urls_inherited.py @@ -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 @@ -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())] diff --git a/graphene_django/tests/urls_pretty.py b/graphene_django/tests/urls_pretty.py index 1133c870f..635d4f390 100644 --- a/graphene_django/tests/urls_pretty.py +++ b/graphene_django/tests/urls_pretty.py @@ -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))] diff --git a/tox.ini b/tox.ini index d2d3065f3..ac21878e9 100644 --- a/tox.ini +++ b/tox.ini @@ -1,24 +1,27 @@ [tox] envlist = - py{27,35,36,37,38}-django{111,20,21,22,master}, - py{36,37,38}-django{30,31}, + py{35,36,37,38,39}-django22, + py{36,37,38,39}-django{30,31}, + py{36,37,38,39,310}-django32, + py{38,39,310}-django{40,master}, black,flake8 [gh-actions] python = - 2.7: py27 3.6: py36 3.7: py37 3.8: py38 + 3.9: py39 + 3.10: py310 [gh-actions:env] DJANGO = - 1.11: django111 - 2.0: django20 - 2.1: django21 2.2: django22 3.0: django30 3.1: django31 + 3.2: django32 + 3.2: django32 + 4.0: django40 master: djangomaster [testenv] @@ -29,13 +32,11 @@ setenv = deps = -e.[test] psycopg2-binary - django111: Django>=1.11,<2.0 - django111: djangorestframework<3.12 - 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.2,<4 + django40: https://github.com/django/django/archive/refs/tags/4.0rc1.zip djangomaster: https://github.com/django/django/archive/master.zip commands = {posargs:py.test --cov=graphene_django graphene_django examples} From 6e145bd76a2a14e86b76a44772b0e9ce747c9b5c Mon Sep 17 00:00:00 2001 From: Yair Silbermintz Date: Tue, 7 Dec 2021 18:47:57 -0500 Subject: [PATCH 3/8] Update tox for official Django 4 release --- tox.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index ac21878e9..bdf4eca08 100644 --- a/tox.ini +++ b/tox.ini @@ -35,8 +35,8 @@ deps = django22: Django>=2.2,<3.0 django30: Django>=3.0,<3.1 django31: Django>=3.1,<3.2 - django32: Django>=3.2,<4 - django40: https://github.com/django/django/archive/refs/tags/4.0rc1.zip + django32: Django>=3.2,<4.0 + django40: Django>=4.0,<5.0 djangomaster: https://github.com/django/django/archive/master.zip commands = {posargs:py.test --cov=graphene_django graphene_django examples} From 71a1e4b6e5770e0f1a433abc71a0f1a756282b03 Mon Sep 17 00:00:00 2001 From: Yair Silbermintz Date: Sat, 11 Dec 2021 18:27:36 -0500 Subject: [PATCH 4/8] 2.16.0 --- graphene_django/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphene_django/__init__.py b/graphene_django/__init__.py index 7472a06e0..c5db5ae4f 100644 --- a/graphene_django/__init__.py +++ b/graphene_django/__init__.py @@ -1,7 +1,7 @@ from .fields import DjangoConnectionField, DjangoListField from .types import DjangoObjectType -__version__ = "2.15.0" +__version__ = "2.16.0" __all__ = [ "__version__", From 4be00301bf933fe50e6538d93259b3bca74571ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=9Clgen=20Sar=C4=B1kavak?= Date: Mon, 7 Feb 2022 17:08:22 +0300 Subject: [PATCH 5/8] Revert version update --- graphene_django/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphene_django/__init__.py b/graphene_django/__init__.py index c5db5ae4f..7472a06e0 100644 --- a/graphene_django/__init__.py +++ b/graphene_django/__init__.py @@ -1,7 +1,7 @@ from .fields import DjangoConnectionField, DjangoListField from .types import DjangoObjectType -__version__ = "2.16.0" +__version__ = "2.15.0" __all__ = [ "__version__", From 56d6ab07105974cfc241ed521b4b6d03a0baf7e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=9Clgen=20Sar=C4=B1kavak?= Date: Mon, 7 Feb 2022 17:09:18 +0300 Subject: [PATCH 6/8] Remove duplicate entry Co-authored-by: Jeremy Stretch --- tox.ini | 1 - 1 file changed, 1 deletion(-) diff --git a/tox.ini b/tox.ini index bdf4eca08..c8cc43a1f 100644 --- a/tox.ini +++ b/tox.ini @@ -20,7 +20,6 @@ DJANGO = 3.0: django30 3.1: django31 3.2: django32 - 3.2: django32 4.0: django40 master: djangomaster From ff9eee080422ded018c0b551bdd67c5f21645e1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=9Clgen=20Sar=C4=B1kavak?= Date: Mon, 7 Feb 2022 17:09:35 +0300 Subject: [PATCH 7/8] Limit max Django version Co-authored-by: Jeremy Stretch --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index c8cc43a1f..4915c1d04 100644 --- a/tox.ini +++ b/tox.ini @@ -35,7 +35,7 @@ deps = django30: Django>=3.0,<3.1 django31: Django>=3.1,<3.2 django32: Django>=3.2,<4.0 - django40: Django>=4.0,<5.0 + django40: Django>=4.0,<4.1 djangomaster: https://github.com/django/django/archive/master.zip commands = {posargs:py.test --cov=graphene_django graphene_django examples} From 616977a6ea0d036f33e68b0d06659ce0039604ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=9Clgen=20Sar=C4=B1kavak?= Date: Mon, 7 Feb 2022 17:10:04 +0300 Subject: [PATCH 8/8] Remove Python 3.5 (deprecated) from tox Co-authored-by: Jeremy Stretch --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 4915c1d04..e8d01881d 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] envlist = - py{35,36,37,38,39}-django22, + py{36,37,38,39}-django22, py{36,37,38,39}-django{30,31}, py{36,37,38,39,310}-django32, py{38,39,310}-django{40,master},