Skip to content

Commit

Permalink
Python 3.10 compatibility (#1350)
Browse files Browse the repository at this point in the history
Co-authored-by: Cyrille Pontvieux <[email protected]>
  • Loading branch information
jkimbo and jrd authored Jul 16, 2021
1 parent aba771b commit 0845aa9
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: ["2.7", "3.6", "3.7", "3.8", "3.9"]
python-version: ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10-dev"]

steps:
- uses: actions/checkout@v2
Expand Down
8 changes: 7 additions & 1 deletion graphene/relay/connection.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import re
from collections import Iterable, OrderedDict
from collections import OrderedDict

try:
from collections.abc import Iterable
except ImportError:
from collections import Iterable

from functools import partial

from graphql_relay import connection_from_list
Expand Down
8 changes: 7 additions & 1 deletion graphene/types/field.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import inspect
from collections import Mapping, OrderedDict
from collections import OrderedDict

try:
from collections.abc import Mapping
except ImportError:
from collections import Mapping

from functools import partial

from .argument import Argument, to_arguments
Expand Down
6 changes: 5 additions & 1 deletion graphene/utils/crunch.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import json
from collections import Mapping

try:
from collections.abc import Mapping
except ImportError:
from collections import Mapping


def to_key(value):
Expand Down
7 changes: 6 additions & 1 deletion graphene/utils/deduplicator.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
from collections import Mapping, OrderedDict
from collections import OrderedDict

try:
from collections.abc import Mapping
except ImportError:
from collections import Mapping


def deflate(node, index=None, path=None):
Expand Down
7 changes: 4 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -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 =
Expand All @@ -8,18 +8,19 @@ python =
3.7: py37
3.8: py38
3.9: py39
3.10-dev: 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 =
Expand Down

0 comments on commit 0845aa9

Please sign in to comment.