Skip to content

Commit

Permalink
feat: drop support for Python 3.8 (#3730)
Browse files Browse the repository at this point in the history
  • Loading branch information
bellini666 authored Dec 21, 2024
1 parent 0981661 commit 5c6f367
Show file tree
Hide file tree
Showing 304 changed files with 1,982 additions and 2,330 deletions.
1 change: 0 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: |
3.8
3.9
3.10
3.11
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.9
rev: v0.8.3
hooks:
- id: ruff-format
exclude: ^tests/\w+/snapshots/
Expand Down
7 changes: 7 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Release type: minor

This release drops support for Python 3.8, which reached its end-of-life (EOL)
in October 2024. The minimum supported Python version is now 3.9.

We strongly recommend upgrading to Python 3.9 or a newer version, as older
versions are no longer maintained and may contain security vulnerabilities.
6 changes: 3 additions & 3 deletions federation-compatibility/schema.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any, List, Optional
from typing import Any, Optional

import strawberry
from strawberry.schema_directive import Location
Expand Down Expand Up @@ -252,7 +252,7 @@ def created_by(self) -> Optional[User]:
return User(**user)

notes: Optional[str] = strawberry.federation.field(tags=["internal"])
research: List[ProductResearch]
research: list[ProductResearch]

@classmethod
def from_data(cls, data: dict) -> "Product":
Expand Down Expand Up @@ -290,7 +290,7 @@ def resolve_reference(cls, **data: Any) -> Optional["Product"]:
@strawberry.federation.interface_object(keys=["id"])
class Inventory:
id: strawberry.ID
deprecated_products: List[DeprecatedProduct]
deprecated_products: list[DeprecatedProduct]

@classmethod
def resolve_reference(cls, id: strawberry.ID) -> "Inventory":
Expand Down
6 changes: 3 additions & 3 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import itertools
from typing import Any, Callable, List
from typing import Any, Callable

import nox
from nox_poetry import Session, session
Expand All @@ -8,7 +8,7 @@
nox.options.error_on_external_run = True
nox.options.default_venv_backend = "uv"

PYTHON_VERSIONS = ["3.13", "3.12", "3.11", "3.10", "3.9", "3.8"]
PYTHON_VERSIONS = ["3.13", "3.12", "3.11", "3.10", "3.9"]

GQL_CORE_VERSIONS = [
"3.2.3",
Expand Down Expand Up @@ -54,7 +54,7 @@ def _install_gql_core(session: Session, version: str) -> None:
)


def with_gql_core_parametrize(name: str, params: List[str]) -> Callable[[Any], Any]:
def with_gql_core_parametrize(name: str, params: list[str]) -> Callable[[Any], Any]:
# github cache doesn't support comma in the name, this is a workaround.
arg_names = f"{name}, gql_core"
combinations = list(itertools.product(params, GQL_CORE_VERSIONS))
Expand Down
88 changes: 3 additions & 85 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 4 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ requires = ["poetry-core>=1.6"]
build-backend = "poetry.core.masonry.api"

[tool.poetry.dependencies]
python = "^3.8"
python = "^3.9"
graphql-core = ">=3.2.0,<3.4.0"
typing-extensions = ">=4.5.0"
python-dateutil = "^2.7.0"
Expand All @@ -54,13 +54,11 @@ python-multipart = {version = ">=0.0.7", optional = true}
sanic = {version = ">=20.12.2", optional = true}
aiohttp = {version = "^3.7.4.post0", optional = true}
fastapi = {version = ">=0.65.2", optional = true}
litestar = {version = ">=2", optional = true, python = ">=3.8"}
litestar = {version = ">=2", optional = true}
channels = {version = ">=3.0.5", optional = true}
astunparse = {version = "^1.6.3", python = "<3.9"}
libcst = {version = ">=0.4.7", optional = true}
rich = {version = ">=12.0.0", optional = true}
pyinstrument = {version = ">=4.0.0", optional = true}
graphlib_backport = {version = "*", python = "<3.9", optional = true}

[tool.poetry.group.dev.dependencies]
asgiref = "^3.2"
Expand Down Expand Up @@ -195,12 +193,12 @@ append-github-contributor = true
exclude = ["**/__pycache__",]
reportMissingImports = true
reportMissingTypeStubs = false
pythonVersion = "3.8"
pythonVersion = "3.9"
stubPath = ""

[tool.ruff]
line-length = 88
target-version = "py38"
target-version = "py39"
fix = true
exclude = [
".bzr",
Expand Down Expand Up @@ -240,9 +238,7 @@ ignore = [
"S102",
"S104",
"S324",
"ANN101", # missing annotation for self?
# definitely enable these, maybe not in tests
"ANN102",
"ANN401",
"PGH003",
"PGH004",
Expand Down Expand Up @@ -287,7 +283,6 @@ ignore = [

# enable these, we have some in tests
"B006",
"PT004",
"PT007",
"PT011",
"PT012",
Expand Down
18 changes: 9 additions & 9 deletions strawberry/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,39 +18,39 @@
from .types.info import Info
from .types.lazy_type import LazyType, lazy
from .types.mutation import mutation, subscription
from .types.object_type import asdict, input, interface, type
from .types.object_type import asdict, input, interface, type # noqa: A004
from .types.private import Private
from .types.scalar import scalar
from .types.union import union
from .types.unset import UNSET

__all__ = [
"BasePermission",
"experimental",
"ID",
"Info",
"UNSET",
"lazy",
"BasePermission",
"Info",
"LazyType",
"Parent",
"Private",
"Schema",
"argument",
"asdict",
"auto",
"directive",
"directive_field",
"schema_directive",
"enum",
"enum_value",
"experimental",
"federation",
"field",
"input",
"interface",
"lazy",
"mutation",
"relay",
"scalar",
"schema_directive",
"subscription",
"type",
"union",
"auto",
"asdict",
"relay",
]
18 changes: 10 additions & 8 deletions strawberry/aiohttp/test/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,25 @@

import warnings
from typing import (
TYPE_CHECKING,
Any,
Dict,
Mapping,
Optional,
)

from strawberry.test.client import BaseGraphQLTestClient, Response

if TYPE_CHECKING:
from collections.abc import Mapping


class GraphQLTestClient(BaseGraphQLTestClient):
async def query(
self,
query: str,
variables: Optional[Dict[str, Mapping]] = None,
headers: Optional[Dict[str, object]] = None,
variables: Optional[dict[str, Mapping]] = None,
headers: Optional[dict[str, object]] = None,
asserts_errors: Optional[bool] = None,
files: Optional[Dict[str, object]] = None,
files: Optional[dict[str, object]] = None,
assert_no_errors: Optional[bool] = True,
) -> Response:
body = self._build_body(query, variables, files)
Expand Down Expand Up @@ -51,9 +53,9 @@ async def query(

async def request(
self,
body: Dict[str, object],
headers: Optional[Dict[str, object]] = None,
files: Optional[Dict[str, object]] = None,
body: dict[str, object],
headers: Optional[dict[str, object]] = None,
files: Optional[dict[str, object]] = None,
) -> Any:
response = await self._client.post(
self.url,
Expand Down
Loading

0 comments on commit 5c6f367

Please sign in to comment.