From 2220769b1dd99f5b10ea283dbfc92d9338e68b8a Mon Sep 17 00:00:00 2001 From: Jamie Hewland Date: Fri, 18 Jun 2021 11:08:20 +0100 Subject: [PATCH 1/5] Test on Python 3.10 --- .github/workflows/test-suite.yml | 2 +- conftest.py | 3 +++ requirements.txt | 2 +- setup.py | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 conftest.py diff --git a/.github/workflows/test-suite.yml b/.github/workflows/test-suite.yml index eed46850a..751c5193b 100644 --- a/.github/workflows/test-suite.yml +++ b/.github/workflows/test-suite.yml @@ -14,7 +14,7 @@ jobs: strategy: matrix: - python-version: ["3.6", "3.7", "3.8", "3.9"] + python-version: ["3.6", "3.7", "3.8", "3.9", "3.10.0-beta.3"] steps: - uses: "actions/checkout@v2" diff --git a/conftest.py b/conftest.py new file mode 100644 index 000000000..bfd09c6bf --- /dev/null +++ b/conftest.py @@ -0,0 +1,3 @@ +import sys + +collect_ignore = ["tests/test_graphql.py"] if sys.version_info >= (3, 10) else [] diff --git a/requirements.txt b/requirements.txt index 6ec5bf09e..c52188ee2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ # Optionals aiofiles -graphene +graphene; python_version<'3.10' itsdangerous jinja2 python-multipart diff --git a/setup.py b/setup.py index c48356370..19b2ca312 100644 --- a/setup.py +++ b/setup.py @@ -40,7 +40,7 @@ def get_long_description(): extras_require={ "full": [ "aiofiles", - "graphene", + "graphene; python_version<'3.10'", "itsdangerous", "jinja2", "python-multipart", From 652411ee9a3205ebab3509223fd6cb95927bb852 Mon Sep 17 00:00:00 2001 From: Jamie Hewland Date: Fri, 18 Jun 2021 11:09:17 +0100 Subject: [PATCH 2/5] Add Python 3.10 to trove classifiers --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 19b2ca312..cd0036b93 100644 --- a/setup.py +++ b/setup.py @@ -60,6 +60,7 @@ def get_long_description(): "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", ], zip_safe=False, ) From 6013784827fe9e3c48266fa6fe407a7a066a282d Mon Sep 17 00:00:00 2001 From: Jamie Hewland Date: Fri, 18 Jun 2021 15:56:54 +0100 Subject: [PATCH 3/5] Fold conftest.py files into one --- conftest.py | 3 --- tests/conftest.py | 4 ++++ 2 files changed, 4 insertions(+), 3 deletions(-) delete mode 100644 conftest.py diff --git a/conftest.py b/conftest.py deleted file mode 100644 index bfd09c6bf..000000000 --- a/conftest.py +++ /dev/null @@ -1,3 +0,0 @@ -import sys - -collect_ignore = ["tests/test_graphql.py"] if sys.version_info >= (3, 10) else [] diff --git a/tests/conftest.py b/tests/conftest.py index d1f3ba8e4..9ed420305 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,7 +1,11 @@ +import sys + import pytest from starlette.testclient import TestClient +collect_ignore = ["test_graphql.py"] if sys.version_info >= (3, 10) else [] + @pytest.fixture( params=[ From 893862a3d76c43c7cd4a6afb30f35f6465e655b6 Mon Sep 17 00:00:00 2001 From: Jamie Hewland Date: Sat, 19 Jun 2021 12:51:35 +0100 Subject: [PATCH 4/5] Ignore coverage for graphql --- setup.cfg | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/setup.cfg b/setup.cfg index 1f2db52f0..f59a72029 100644 --- a/setup.cfg +++ b/setup.cfg @@ -32,3 +32,8 @@ filterwarnings= [coverage:run] source_pkgs = starlette, tests +# GraphQLApp incompatible with and untested on Python 3.10. It's deprecated, let's just ignore +# coverage for it until it's gone. +omit = + starlette/graphql.py + tests/test_graphql.py From 9ee9a7d917689e7fbf7e201d65e9e4d292aaebd0 Mon Sep 17 00:00:00 2001 From: Jamie Hewland Date: Sat, 19 Jun 2021 12:56:28 +0100 Subject: [PATCH 5/5] Add note to docs about graphql incompatibility --- docs/graphql.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/graphql.md b/docs/graphql.md index 72b6478f8..281bdea85 100644 --- a/docs/graphql.md +++ b/docs/graphql.md @@ -2,9 +2,10 @@ !!! Warning GraphQL support in Starlette is **deprecated** as of version 0.15 and will - be removed in a future release. Please consider using a third-party library - to provide GraphQL support. This is usually done by mounting a GraphQL ASGI - application. See [#619](https://github.com/encode/starlette/issues/619). + be removed in a future release. It is also incompatible with Python 3.10+. + Please consider using a third-party library to provide GraphQL support. This + is usually done by mounting a GraphQL ASGI application. + See [#619](https://github.com/encode/starlette/issues/619). Some example libraries are: * [Ariadne](https://ariadnegraphql.org/docs/asgi)