From 9b016d12cd5a1d5f9c4e5d9699040ea75162c1e2 Mon Sep 17 00:00:00 2001 From: Cyrille Pontvieux Date: Thu, 1 Jul 2021 12:43:38 +0200 Subject: [PATCH] Python 3.10 compatibility tox.ini updated to also run tests on python 3.8, 3.9 and 3.10 --- graphene/relay/connection.py | 3 ++- graphene/types/field.py | 3 ++- graphene/utils/crunch.py | 2 +- graphene/utils/deduplicator.py | 3 ++- tox.ini | 7 ++++--- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/graphene/relay/connection.py b/graphene/relay/connection.py index 047f2b4d..d8cc1c07 100644 --- a/graphene/relay/connection.py +++ b/graphene/relay/connection.py @@ -1,5 +1,6 @@ import re -from collections import Iterable, OrderedDict +from collections import OrderedDict +from collections.abc import Iterable from functools import partial from graphql_relay import connection_from_list diff --git a/graphene/types/field.py b/graphene/types/field.py index 7f63a853..fa013aa3 100644 --- a/graphene/types/field.py +++ b/graphene/types/field.py @@ -1,5 +1,6 @@ import inspect -from collections import Mapping, OrderedDict +from collections import OrderedDict +from collections.abc import Mapping from functools import partial from .argument import Argument, to_arguments diff --git a/graphene/utils/crunch.py b/graphene/utils/crunch.py index 57fcb77f..b27d3718 100644 --- a/graphene/utils/crunch.py +++ b/graphene/utils/crunch.py @@ -1,5 +1,5 @@ import json -from collections import Mapping +from collections.abc import Mapping def to_key(value): diff --git a/graphene/utils/deduplicator.py b/graphene/utils/deduplicator.py index 13c1cb16..d8128a8c 100644 --- a/graphene/utils/deduplicator.py +++ b/graphene/utils/deduplicator.py @@ -1,4 +1,5 @@ -from collections import Mapping, OrderedDict +from collections import OrderedDict +from collections.abc import Mapping def deflate(node, index=None, path=None): diff --git a/tox.ini b/tox.ini index 4e1cc9dc..43766eca 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py{27,36,37,38,39},flake8,pre-commit,mypy +envlist = py{27,36,37,38,39,310},flake8,pre-commit,mypy [gh-actions] python = @@ -8,18 +8,19 @@ python = 3.7: py37 3.8: py38 3.9: py39 + 3.10: py310 [testenv] passenv = * usedevelop = True deps = -e.[test] - py{36,37,38,39}: pytest-asyncio + py{36,37,38,39,310}: pytest-asyncio setenv = PYTHONPATH = .:{envdir} commands = py{27}: py.test --cov=graphene graphene examples {posargs} - py{36,37,38,39}: py.test --cov=graphene graphene examples tests_asyncio tests_py36 {posargs} + py{36,37,38,39,310}: py.test --cov=graphene graphene examples tests_asyncio tests_py36 {posargs} [testenv:pre-commit] deps =