Skip to content

Commit d2d5030

Browse files
committed
Remove support for Python 3.6
Note that Python 3.6 is not officially supported any more since 2022.
1 parent 6c5ab13 commit d2d5030

File tree

9 files changed

+48
-114
lines changed

9 files changed

+48
-114
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88

99
strategy:
1010
matrix:
11-
python: ['3.6', '3.7', '3.8', '3.9', '3.10', 'pypy3']
11+
python: ['3.7', '3.8', '3.9', '3.10', 'pypy3']
1212

1313
steps:
1414
- uses: actions/checkout@v2

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
#
6969
# This is also used if you do content translation via gettext catalogs.
7070
# Usually you set "language" from the command line for these cases.
71-
language = None
71+
language = 'en'
7272

7373
# There are two options for replacing |today|: either, you set today to some
7474
# non-false value, then it is used:

pyproject.toml

Lines changed: 10 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ classifiers = [
1818
"Intended Audience :: Developers",
1919
"License :: OSI Approved :: MIT License",
2020
"Programming Language :: Python :: 3",
21-
"Programming Language :: Python :: 3.6",
2221
"Programming Language :: Python :: 3.7",
2322
"Programming Language :: Python :: 3.8",
2423
"Programming Language :: Python :: 3.9",
@@ -43,47 +42,30 @@ packages = [
4342
]
4443

4544
[tool.poetry.dependencies]
46-
python = "^3.6"
45+
python = "^3.7"
4746
typing-extensions = [
48-
{ version = "^4.3", python = ">=3.7,<3.8" },
49-
{ version = "^4.1", python = "<3.7" }
47+
{ version = "^4.3", python = "<3.8" },
5048
]
5149

5250
[tool.poetry.dev-dependencies]
53-
pytest = "^6.2"
54-
pytest-asyncio = [
55-
{version=">=0.19,<1", python = ">=3.7" },
56-
{version=">=0.16,<0.17", python = "<3.7" },
57-
]
51+
pytest = "^7.1"
52+
pytest-asyncio = ">=0.19,<1"
5853
pytest-benchmark = "^3.4"
5954
pytest-cov = "^3.0"
6055
pytest-describe = "^2.0"
6156
pytest-timeout = "^2.1"
62-
black = [
63-
{version = "22.8.0", python = ">=3.6.2"},
64-
{version = "20.8b1", python = "<3.6.2"}
65-
]
66-
flake8 = [
67-
{version = "^5.0", python = ">=3.6.1"},
68-
{version = "^4.0", python = "<3.6.1"}
69-
]
57+
black = "22.8.0"
58+
flake8 = "^5.0"
7059
mypy = "0.971"
71-
sphinx = "^4.3"
60+
sphinx = "^5.1"
7261
sphinx_rtd_theme = ">=1,<2"
7362
check-manifest = ">=0.48,<1"
7463
bump2version = ">=1.0,<2"
75-
tomli = [
76-
{version="^2", python = ">=3.7"},
77-
{version="^1.2", python = "<3.7"}
78-
]
79-
tox = [
80-
{version = "^3.26", python = ">=3.7"},
81-
{version = "3.25", python = "<3.7"}
82-
]
64+
tox = "^3.26"
8365

8466
[tool.black]
85-
target-version = ['py36', 'py37', 'py38', 'py39', 'py310']
67+
target-version = ['py37', 'py38', 'py39', 'py310']
8668

8769
[build-system]
88-
requires = ["poetry_core>=1,<2", "setuptools>=59,<70"]
70+
requires = ["poetry_core>=1,<2", "setuptools>=65,<70"]
8971
build-backend = "poetry.core.masonry.api"

setup.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,15 @@
2626
"License :: OSI Approved :: MIT License",
2727
"Programming Language :: Python :: 3",
2828
"Programming Language :: Python :: 3 :: Only",
29-
"Programming Language :: Python :: 3.6",
3029
"Programming Language :: Python :: 3.7",
3130
"Programming Language :: Python :: 3.8",
3231
"Programming Language :: Python :: 3.9",
3332
"Programming Language :: Python :: 3.10",
3433
],
3534
install_requires=[
36-
"typing-extensions>=4.2,<5; python_version < '3.8'",
35+
"typing-extensions>=4.3,<5; python_version < '3.8'",
3736
],
38-
python_requires=">=3.6,<4",
37+
python_requires=">=3.7,<4",
3938
packages=find_packages("src"),
4039
package_dir={"": "src"},
4140
# PEP-561: https://www.python.org/dev/peps/pep-0561/
Lines changed: 20 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,33 @@
11
__all__ = ["is_digit", "is_letter", "is_name_start", "is_name_continue"]
22

3-
try:
4-
"string".isascii()
5-
except AttributeError: # Python < 3.7
63

7-
def is_digit(char: str) -> bool:
8-
"""Check whether char is a digit
4+
def is_digit(char: str) -> bool:
5+
"""Check whether char is a digit
96
10-
For internal use by the lexer only.
11-
"""
12-
return "0" <= char <= "9"
7+
For internal use by the lexer only.
8+
"""
9+
return char.isascii() and char.isdigit()
1310

14-
def is_letter(char: str) -> bool:
15-
"""Check whether char is a plain ASCII letter
1611

17-
For internal use by the lexer only.
18-
"""
19-
return "a" <= char <= "z" or "A" <= char <= "Z"
12+
def is_letter(char: str) -> bool:
13+
"""Check whether char is a plain ASCII letter
2014
21-
def is_name_start(char: str) -> bool:
22-
"""Check whether char is allowed at the beginning of a GraphQL name
15+
For internal use by the lexer only.
16+
"""
17+
return char.isascii() and char.isalpha()
2318

24-
For internal use by the lexer only.
25-
"""
26-
return "a" <= char <= "z" or "A" <= char <= "Z" or char == "_"
2719

28-
def is_name_continue(char: str) -> bool:
29-
"""Check whether char is allowed in the continuation of a GraphQL name
20+
def is_name_start(char: str) -> bool:
21+
"""Check whether char is allowed at the beginning of a GraphQL name
3022
31-
For internal use by the lexer only.
32-
"""
33-
return (
34-
"a" <= char <= "z"
35-
or "A" <= char <= "Z"
36-
or "0" <= char <= "9"
37-
or char == "_"
38-
)
23+
For internal use by the lexer only.
24+
"""
25+
return char.isascii() and (char.isalpha() or char == "_")
3926

40-
else:
4127

42-
def is_digit(char: str) -> bool:
43-
"""Check whether char is a digit
28+
def is_name_continue(char: str) -> bool:
29+
"""Check whether char is allowed in the continuation of a GraphQL name
4430
45-
For internal use by the lexer only.
46-
"""
47-
return char.isascii() and char.isdigit()
48-
49-
def is_letter(char: str) -> bool:
50-
"""Check whether char is a plain ASCII letter
51-
52-
For internal use by the lexer only.
53-
"""
54-
return char.isascii() and char.isalpha()
55-
56-
def is_name_start(char: str) -> bool:
57-
"""Check whether char is allowed at the beginning of a GraphQL name
58-
59-
For internal use by the lexer only.
60-
"""
61-
return char.isascii() and (char.isalpha() or char == "_")
62-
63-
def is_name_continue(char: str) -> bool:
64-
"""Check whether char is allowed in the continuation of a GraphQL name
65-
66-
For internal use by the lexer only.
67-
"""
68-
return char.isascii() and (char.isalnum() or char == "_")
31+
For internal use by the lexer only.
32+
"""
33+
return char.isascii() and (char.isalnum() or char == "_")

src/graphql/pyutils/simple_pub_sub.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22
from inspect import isawaitable
33
from typing import Any, AsyncIterator, Callable, Optional, Set
44

5-
try:
6-
from asyncio import get_running_loop
7-
except ImportError:
8-
from asyncio import get_event_loop as get_running_loop # Python < 3.7
5+
from asyncio import get_running_loop
96

107

118
__all__ = ["SimplePubSub", "SimplePubSubIterator"]

tests/test_docs.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -135,16 +135,13 @@ def executing_queries(capsys):
135135
async_query = queries.pop(0)
136136
assert "asyncio" in async_query and "graphql_sync" not in async_query
137137
assert "asyncio.run" in async_query
138-
try: # pragma: no cover
139-
from asyncio import run # noqa: F401
140-
except ImportError: # Python < 3.7
141-
assert "ExecutionResult" in expected_result(queries)
142-
else: # pragma: no cover
143-
exec(async_query, scope)
144-
out, err = capsys.readouterr()
145-
assert not err
146-
assert "R2-D2" in out
147-
assert out == expected_result(queries)
138+
from asyncio import run # noqa: F401
139+
140+
exec(async_query, scope)
141+
out, err = capsys.readouterr()
142+
assert not err
143+
assert "R2-D2" in out
144+
assert out == expected_result(queries)
148145

149146
sync_query = queries.pop(0)
150147
assert "graphql_sync" in sync_query and "asyncio" not in sync_query

tests/test_user_registry.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@
1010
from inspect import isawaitable
1111
from typing import Any, Dict, List, NamedTuple, Optional
1212

13-
try:
14-
from asyncio import create_task
15-
except ImportError: # Python < 3.7
16-
create_task = None # type: ignore
13+
from asyncio import create_task
1714

1815
from pytest import fixture, mark
1916

tox.ini

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
[tox]
2-
envlist = py3{6,7,8,9,10}, black, flake8, mypy, docs, manifest
2+
envlist = py3{7,8,9,10}, black, flake8, mypy, docs, manifest
33
isolated_build = true
44

55
[gh-actions]
66
python =
7-
3.6: py36
87
3.7: py37
98
3.8: py38
109
3.9: py39
@@ -26,14 +25,14 @@ commands =
2625
basepython = python3.9
2726
deps =
2827
mypy==0.971
29-
pytest>=6.2,<7
28+
pytest>=7.1,<8
3029
commands =
3130
mypy src tests
3231

3332
[testenv:docs]
3433
basepython = python3.9
3534
deps =
36-
sphinx>=4.3,<5
35+
sphinx>=5.1,<6
3736
sphinx_rtd_theme>=1,<2
3837
commands =
3938
sphinx-build -b html -nEW docs docs/_build/html
@@ -46,14 +45,12 @@ commands =
4645

4746
[testenv]
4847
deps =
49-
py37,py38,py39,py310: pytest>=7.1,<8
50-
py36: pytest>=6.2,<7
51-
pytest-asyncio>=0.16,<1
48+
pytest>=7.1,<8
49+
pytest-asyncio>=0.19,<1
5250
pytest-benchmark>=3.4,<4
5351
pytest-cov>=3,<4
5452
pytest-describe>=2,<3
5553
pytest-timeout>=2,<3
5654
py37: typing-extensions>=4.3,<5
57-
py36: typing-extensions>=4.1,<5
5855
commands =
5956
pytest tests {posargs: --cov-report=term-missing --cov=graphql --cov=tests --cov-fail-under=100}

0 commit comments

Comments
 (0)