Skip to content

Commit c6360e8

Browse files
committedSep 2, 2024··
Update dependencies and support newer Python versions
Remove dev-dependencies because they cannot be installed together with poetry. The test requirements are specified in tox.ini instead.
·
v3.2.6v3.2.4
1 parent 430ee89 commit c6360e8

File tree

11 files changed

+105
-1566
lines changed

11 files changed

+105
-1566
lines changed
 

‎.github/workflows/lint.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ jobs:
77
runs-on: ubuntu-latest
88

99
steps:
10-
- uses: actions/checkout@v2
10+
- uses: actions/checkout@v4
1111

12-
- name: Set up Python 3.9
13-
uses: actions/setup-python@v2
12+
- name: Set up Python 3.11
13+
uses: actions/setup-python@v5
1414
with:
15-
python-version: 3.9
15+
python-version: 3.11
1616

1717
- name: Install dependencies
1818
run: |

‎.github/workflows/publish.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ jobs:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v4
1414

15-
- name: Set up Python 3.9
16-
uses: actions/setup-python@v2
15+
- name: Set up Python 3.11
16+
uses: actions/setup-python@v5
1717
with:
18-
python-version: 3.9
18+
python-version: 3.11
1919

2020
- name: Build wheel and source tarball
2121
run: |

‎.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ 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', '3.11', '3.12', 'pypy3.9', 'pypy3.10']
1212

1313
steps:
14-
- uses: actions/checkout@v2
14+
- uses: actions/checkout@v4
1515

1616
- name: Set up Python ${{ matrix.python-version }}
17-
uses: actions/setup-python@v2
17+
uses: actions/setup-python@v5
1818
with:
1919
python-version: ${{ matrix.python-version }}
2020

‎.vscode/launch.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "Python Debugger: Current File with Arguments",
9+
"type": "debugpy",
10+
"request": "launch",
11+
"program": "${file}",
12+
"console": "integratedTerminal",
13+
"args": "${command:pickArgs}"
14+
}
15+
]
16+
}

‎.vscode/settings.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"editor.rulers": [88],
3+
"[python]": {
4+
"editor.defaultFormatter": "ms-python.black-formatter",
5+
"editor.formatOnSave": true,
6+
},
7+
"python.testing.pytestArgs": [
8+
"tests"
9+
],
10+
"python.testing.unittestEnabled": false,
11+
"python.testing.pytestEnabled": true,
12+
"pythonTestExplorer.testFramework": "pytest",
13+
"testExplorer.useNativeTesting": false,
14+
"testExplorer.sort": "byLocationWithSuitesFirst",
15+
"testExplorer.showExpandButton": 5,
16+
"testExplorer.addToEditorContextMenu": true,
17+
"rust-analyzer.testExplorer": false,
18+
"pythonTestExplorer.testplanUseLegacyDiscovery": false,
19+
"testExplorer.mergeSuites": false,
20+
"python.analysis.typeCheckingMode": "off"
21+
}

‎poetry.lock

Lines changed: 7 additions & 1489 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎pyproject.toml

Lines changed: 5 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ classifiers = [
2222
"Programming Language :: Python :: 3.7",
2323
"Programming Language :: Python :: 3.8",
2424
"Programming Language :: Python :: 3.9",
25-
"Programming Language :: Python :: 3.10"
25+
"Programming Language :: Python :: 3.10",
26+
"Programming Language :: Python :: 3.11",
27+
"Programming Language :: Python :: 3.12"
2628
]
2729
packages = [
2830
{ include = "graphql", from = "src" },
@@ -45,44 +47,11 @@ packages = [
4547
[tool.poetry.dependencies]
4648
python = "^3.6"
4749
typing-extensions = [
48-
{ version = "^4.3", python = ">=3.7,<3.8" },
49-
{ version = "^4.1", python = "<3.7" }
50-
]
51-
52-
[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-
]
58-
pytest-benchmark = "^3.4"
59-
pytest-cov = "^3.0"
60-
pytest-describe = "^2.0"
61-
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-
]
70-
mypy = "0.971"
71-
sphinx = "^4.3"
72-
sphinx_rtd_theme = ">=1,<2"
73-
check-manifest = ">=0.48,<1"
74-
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"}
50+
{ version = ">=4,<5", python = "<3.10" }
8251
]
8352

8453
[tool.black]
85-
target-version = ['py36', 'py37', 'py38', 'py39', 'py310']
54+
target-version = ['py36', 'py37', 'py38', 'py39', 'py310', 'py311', 'py312']
8655

8756
[build-system]
8857
requires = ["poetry_core>=1,<2", "setuptools>=59,<70"]

‎tests/execution/test_map_async_iterator.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
import platform
12
import sys
23
from asyncio import CancelledError, Event, ensure_future, sleep
34

4-
from pytest import mark, raises
5-
65
from graphql.execution import MapAsyncIterator
6+
from pytest import mark, raises
77

8+
is_pypy = platform.python_implementation() == "PyPy"
89

910
try: # pragma: no cover
1011
anext
@@ -344,6 +345,10 @@ def double(x):
344345
with raises(StopAsyncIteration):
345346
await anext(doubles)
346347

348+
# no more exceptions should be thrown
349+
if is_pypy:
350+
# need to investigate why this is needed with PyPy
351+
await doubles.aclose() # pragma: no cover
347352
await doubles.athrow(RuntimeError("no more ouch"))
348353

349354
with raises(StopAsyncIteration):

‎tests/pyutils/test_frozen_dict.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
from copy import copy, deepcopy
22

3+
from graphql.pyutils import FrozenDict, FrozenError
34
from pytest import raises
45

5-
from graphql.pyutils import FrozenError, FrozenDict
6-
76

87
def describe_frozen_list():
98
def can_read():
@@ -59,7 +58,7 @@ def can_hash():
5958
fd2 = FrozenDict({1: 2, 3: 4})
6059
assert fd2 == fd1
6160
assert fd2 is not fd1
62-
assert hash(fd2) is not hash(fd1)
61+
assert hash(fd2) == hash(fd1)
6362
fd3 = FrozenDict({1: 2, 3: 5})
6463
assert fd3 != fd1
6564
assert hash(fd3) != hash(fd1)

‎tests/pyutils/test_is_awaitable.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import asyncio
2+
import sys
23
from inspect import isawaitable
34

4-
from pytest import mark
5-
65
from graphql.pyutils import is_awaitable
6+
from pytest import mark
77

88

99
def describe_is_awaitable():
@@ -76,7 +76,11 @@ async def some_coroutine():
7676
assert is_awaitable(some_coroutine())
7777

7878
@mark.filterwarnings("ignore::Warning") # Deprecation and Runtime
79-
def recognizes_an_old_style_coroutine():
79+
@mark.skipif(
80+
sys.version_info >= (3, 11),
81+
reason="Generator-based coroutines not supported after Python 3.11",
82+
)
83+
def recognizes_an_old_style_coroutine(): # pragma: no cover
8084
@asyncio.coroutine
8185
def some_old_style_coroutine():
8286
yield False # pragma: no cover

‎tox.ini

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

55
[gh-actions]
66
python =
7+
3: py310
78
3.6: py36
89
3.7: py37
910
3.8: py38
1011
3.9: py39
1112
3.10: py310
13+
3.11: py311
14+
3.12: py312
15+
pypy3.9: pypy39
16+
pypy3.10: pypy310
1217

1318
[testenv:black]
14-
basepython = python3.9
15-
deps = black==22.8.0
19+
basepython = python3.11
20+
deps = black==24.8.0
1621
commands =
17-
black src tests setup.py -t py39 --check
22+
black src tests setup.py -t py311 --check
1823

1924
[testenv:flake8]
20-
basepython = python3.9
21-
deps = flake8>=5,<6
25+
basepython = python3.11
26+
deps = flake8>=7,<8
2227
commands =
2328
flake8 src tests setup.py
2429

2530
[testenv:mypy]
26-
basepython = python3.9
31+
basepython = python3.11
2732
deps =
28-
mypy==0.971
29-
pytest>=6.2,<7
33+
mypy>=1.11,<2
34+
pytest>=8.3,<9
3035
commands =
3136
mypy src tests
3237

3338
[testenv:docs]
34-
basepython = python3.9
39+
basepython = python3.11
3540
deps =
36-
sphinx>=4.3,<5
37-
sphinx_rtd_theme>=1,<2
41+
sphinx>=7,<8
42+
sphinx_rtd_theme>=2.0,<3
3843
commands =
3944
sphinx-build -b html -nEW docs docs/_build/html
4045

4146
[testenv:manifest]
42-
basepython = python3.9
43-
deps = check-manifest>=0.48,<1
47+
basepython = python3.11
48+
deps = check-manifest>=0.49,<1
4449
commands =
4550
check-manifest -v
4651

4752
[testenv]
4853
deps =
49-
py37,py38,py39,py310: pytest>=7.1,<8
50-
py36: pytest>=6.2,<7
51-
pytest-asyncio>=0.16,<1
52-
pytest-benchmark>=3.4,<4
53-
pytest-cov>=3,<4
54+
pytest>=6.2,<9
55+
pytest-asyncio>=0.16,<0.24
56+
pytest-benchmark>=3.4,<5
57+
pytest-cov>=4,<6
5458
pytest-describe>=2,<3
5559
pytest-timeout>=2,<3
56-
py37: typing-extensions>=4.3,<5
57-
py36: typing-extensions>=4.1,<5
60+
py36,py37,38,py39,py310: typing-extensions>=4,<5
5861
commands =
59-
pytest tests {posargs: --cov-report=term-missing --cov=graphql --cov=tests --cov-fail-under=100}
62+
# to also run the time-consuming tests: tox -e py311 -- --run-slow
63+
# to run the benchmarks: tox -e py311 -- -k benchmarks --benchmark-enable
64+
py37,py38,py39,py310,py311,pypy39,pypy310: pytest tests {posargs}
65+
py312: pytest tests {posargs: --cov-report=term-missing --cov=graphql --cov=tests --cov-fail-under=100}
66+

0 commit comments

Comments
 (0)
Please sign in to comment.