From fad11ed21e50da29e8449fd4d62fb8d58427ce2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=9Clgen=20Sar=C4=B1kavak?= Date: Thu, 11 Mar 2021 05:27:09 +0300 Subject: [PATCH 1/6] Update Django's main branch name --- tox.ini | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tox.ini b/tox.ini index 4fd5a1bb3..175d689cc 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] envlist = - py{36,37,38}-django{22,30,31,master}, + py{36,37,38}-django{22,30,31,main}, black,flake8 [gh-actions] @@ -14,7 +14,7 @@ DJANGO = 2.2: django22 3.0: django30 3.1: django31 - master: djangomaster + main: djangomain [testenv] passenv = * @@ -31,7 +31,7 @@ deps = django22: Django>=2.2,<3.0 django30: Django>=3.0a1,<3.1 django31: Django>=3.1,<3.2 - djangomaster: https://github.com/django/django/archive/master.zip + djangomain: https://github.com/django/django/archive/main.zip commands = {posargs:py.test --cov=graphene_django graphene_django examples} [testenv:black] From 39cb1cb2d7e7ac384c716ff8487a729d1e051d70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=9Clgen=20Sar=C4=B1kavak?= Date: Thu, 11 Mar 2021 05:28:18 +0300 Subject: [PATCH 2/6] Add Python 3.9 to tox --- .github/workflows/deploy.yml | 4 ++-- .github/workflows/lint.yml | 4 ++-- .github/workflows/tests.yml | 2 +- tox.ini | 7 ++++--- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 1cd101184..5cafd3880 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -11,10 +11,10 @@ jobs: steps: - uses: actions/checkout@v1 - - name: Set up Python 3.8 + - name: Set up Python 3.9 uses: actions/setup-python@v1 with: - python-version: 3.8 + python-version: 3.9 - name: Build wheel and source tarball run: | pip install wheel diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 20cf7fb33..ffe8c33af 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -8,10 +8,10 @@ jobs: steps: - uses: actions/checkout@v1 - - name: Set up Python 3.8 + - name: Set up Python 3.9 uses: actions/setup-python@v1 with: - python-version: 3.8 + python-version: 3.9 - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 90085c8ec..2887fb3fb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,7 +9,7 @@ jobs: max-parallel: 4 matrix: django: ["2.2", "3.0", "3.1"] - python-version: ["3.6", "3.7", "3.8"] + python-version: ["3.6", "3.7", "3.8", "3.9"] steps: - uses: actions/checkout@v1 diff --git a/tox.ini b/tox.ini index 175d689cc..9c104b353 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] envlist = - py{36,37,38}-django{22,30,31,main}, + py{36,37,38,39}-django{22,30,31,main}, black,flake8 [gh-actions] @@ -8,6 +8,7 @@ python = 3.6: py36 3.7: py37 3.8: py38 + 3.9: py39 [gh-actions:env] DJANGO = @@ -35,13 +36,13 @@ deps = commands = {posargs:py.test --cov=graphene_django graphene_django examples} [testenv:black] -basepython = python3.8 +basepython = python3.9 deps = -e.[dev] commands = black --exclude "/migrations/" graphene_django examples setup.py --check [testenv:flake8] -basepython = python3.8 +basepython = python3.9 deps = -e.[dev] commands = flake8 graphene_django examples setup.py From 491c6d1924eea5931a1b54b3a85b66299b83c354 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=9Clgen=20Sar=C4=B1kavak?= Date: Thu, 11 Mar 2021 05:40:53 +0300 Subject: [PATCH 3/6] Update base gh action versions --- .github/workflows/deploy.yml | 4 ++-- .github/workflows/lint.yml | 4 ++-- .github/workflows/tests.yml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 5cafd3880..07c0766f8 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -10,9 +10,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python 3.9 - uses: actions/setup-python@v1 + uses: actions/setup-python@v2 with: python-version: 3.9 - name: Build wheel and source tarball diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ffe8c33af..559326c41 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -7,9 +7,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python 3.9 - uses: actions/setup-python@v1 + uses: actions/setup-python@v2 with: python-version: 3.9 - name: Install dependencies diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2887fb3fb..8d0e6d8aa 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,9 +12,9 @@ jobs: python-version: ["3.6", "3.7", "3.8", "3.9"] steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - name: Install dependencies From e61552721c7ad7893db04b68b80b284f66655693 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=9Clgen=20Sar=C4=B1kavak?= Date: Thu, 11 Mar 2021 05:42:51 +0300 Subject: [PATCH 4/6] Add Django 3.2 to tests --- .github/workflows/tests.yml | 2 +- tox.ini | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8d0e6d8aa..2dbf8229f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -8,7 +8,7 @@ jobs: strategy: max-parallel: 4 matrix: - django: ["2.2", "3.0", "3.1"] + django: ["2.2", "3.0", "3.1", "3.2"] python-version: ["3.6", "3.7", "3.8", "3.9"] steps: diff --git a/tox.ini b/tox.ini index 9c104b353..d476ba7e9 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] envlist = - py{36,37,38,39}-django{22,30,31,main}, + py{36,37,38,39}-django{22,30,31,32,main}, black,flake8 [gh-actions] @@ -15,6 +15,7 @@ DJANGO = 2.2: django22 3.0: django30 3.1: django31 + 3.2: django32 main: djangomain [testenv] @@ -32,6 +33,7 @@ deps = django22: Django>=2.2,<3.0 django30: Django>=3.0a1,<3.1 django31: Django>=3.1,<3.2 + django32: Django>=3.2a1,<3.3 djangomain: https://github.com/django/django/archive/main.zip commands = {posargs:py.test --cov=graphene_django graphene_django examples} From d0c84608bede6ca420885284aa9981028281b527 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=9Clgen=20Sar=C4=B1kavak?= Date: Thu, 11 Mar 2021 05:48:56 +0300 Subject: [PATCH 5/6] Remove redundant Django 1.11 references --- docs/tutorial-relay.rst | 2 +- graphene_django/converter.py | 5 +---- graphene_django/settings.py | 5 +---- setup.py | 1 - tox.ini | 2 -- 5 files changed, 3 insertions(+), 12 deletions(-) diff --git a/docs/tutorial-relay.rst b/docs/tutorial-relay.rst index 8494da191..acc4b0d33 100644 --- a/docs/tutorial-relay.rst +++ b/docs/tutorial-relay.rst @@ -281,7 +281,7 @@ from the command line. $ python ./manage.py runserver Performing system checks... - Django version 1.11, using settings 'cookbook.settings' + Django version 3.1.7, using settings 'cookbook.settings' Starting development server at http://127.0.0.1:8000/ Quit the server with CONTROL-C. diff --git a/graphene_django/converter.py b/graphene_django/converter.py index 6bbf53452..da9616135 100644 --- a/graphene_django/converter.py +++ b/graphene_django/converter.py @@ -238,10 +238,7 @@ def dynamic_type(): if not _type: return - # We do this for a bug in Django 1.8, where null attr - # is not available in the OneToOneRel instance - null = getattr(field, "null", True) - return Field(_type, required=not null) + return Field(_type, required=not field.null) return Dynamic(dynamic_type) diff --git a/graphene_django/settings.py b/graphene_django/settings.py index c48712362..467c6a320 100644 --- a/graphene_django/settings.py +++ b/graphene_django/settings.py @@ -16,10 +16,7 @@ from django.conf import settings from django.test.signals import setting_changed -try: - import importlib # Available in Python 3.1+ -except ImportError: - from django.utils import importlib # Will be removed in Django 1.9 +import importlib # Available in Python 3.1+ # Copied shamelessly from Django REST Framework diff --git a/setup.py b/setup.py index 4750671cb..fbc7d50e0 100644 --- a/setup.py +++ b/setup.py @@ -51,7 +51,6 @@ "Programming Language :: Python :: 3.8", "Programming Language :: Python :: Implementation :: PyPy", "Framework :: Django", - "Framework :: Django :: 1.11", "Framework :: Django :: 2.2", "Framework :: Django :: 3.0", ], diff --git a/tox.ini b/tox.ini index d476ba7e9..7128afe09 100644 --- a/tox.ini +++ b/tox.ini @@ -26,8 +26,6 @@ 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 From 587058d34fbd647cc9e8e999e161dd577a0f3452 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=9Clgen=20Sar=C4=B1kavak?= Date: Thu, 11 Mar 2021 22:35:17 +0300 Subject: [PATCH 6/6] Update setup.py for new Django and Python versions --- setup.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/setup.py b/setup.py index fbc7d50e0..fd403c0df 100644 --- a/setup.py +++ b/setup.py @@ -49,10 +49,13 @@ "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", "Programming Language :: Python :: Implementation :: PyPy", "Framework :: Django", "Framework :: Django :: 2.2", "Framework :: Django :: 3.0", + "Framework :: Django :: 3.1", + "Framework :: Django :: 3.2", ], keywords="api graphql protocol rest relay graphene", packages=find_packages(exclude=["tests", "examples", "examples.*"]),