Skip to content

Commit

Permalink
3.8 is EOL
Browse files Browse the repository at this point in the history
  • Loading branch information
hynek committed Oct 8, 2024
1 parent ac587a7 commit 267fa1e
Show file tree
Hide file tree
Showing 16 changed files with 34 additions and 44 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ You can find our backwards-compatibility policy [here](https://github.com/hynek/

## [Unreleased](https://github.com/hynek/svcs/compare/24.1.0...HEAD)

### Added

- Python 3.13 support.


### Removed

- Python 3.8 support.


### Changed

- Flask: The registry is now stored on `app.extensions`, not `app.config`.
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/fastapi/simple_fastapi_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import os

from typing import AsyncGenerator
from collections.abc import AsyncGenerator

from fastapi import FastAPI

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/starlette/simple_starlette_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import os

from typing import AsyncGenerator
from collections.abc import AsyncGenerator

from starlette.applications import Starlette
from starlette.middleware import Middleware
Expand Down
10 changes: 2 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@ build-backend = "hatchling.build"
dynamic = ["version", "readme"]
name = "svcs"
description = "A Flexible Service Locator"
requires-python = ">=3.8"
license = "MIT"
authors = [{ name = "Hynek Schlawack", email = "[email protected]" }]
requires-python = ">=3.9"
classifiers = [
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
Expand All @@ -30,12 +29,7 @@ dependencies = [
]

[project.optional-dependencies]
tests = [
"pytest",
"pytest-asyncio",
"sybil>=6",
"typing-extensions; python_version<'3.9'",
]
tests = ["pytest", "pytest-asyncio", "sybil>=6"]
typing = ["mypy>=1.4", "fastapi", "flask", "starlette", "aiohttp", "pyramid"]
docs = [
"sphinx>=7.2.2",
Expand Down
4 changes: 2 additions & 2 deletions src/svcs/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import logging
import warnings

from collections.abc import Callable
from collections.abc import Awaitable, Callable
from contextlib import (
AbstractAsyncContextManager,
AbstractContextManager,
Expand All @@ -24,7 +24,7 @@
isgeneratorfunction,
)
from types import TracebackType
from typing import Any, Awaitable, TypeVar, overload
from typing import Any, TypeVar, overload

import attrs

Expand Down
10 changes: 2 additions & 8 deletions src/svcs/fastapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

import contextlib
import inspect
import sys

from typing import AsyncGenerator, Callable
from collections.abc import AsyncGenerator
from typing import Annotated, Callable

import attrs

Expand All @@ -19,12 +19,6 @@
from svcs._core import _KEY_REGISTRY


if sys.version_info < (3, 9):
from typing_extensions import Annotated
else:
from typing import Annotated


@attrs.define
class lifespan: # noqa: N801
"""
Expand Down
3 changes: 2 additions & 1 deletion src/svcs/starlette.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
import contextlib
import inspect

from typing import Any, AsyncGenerator, Callable, overload
from collections.abc import AsyncGenerator
from typing import Any, Callable, overload

import attrs

Expand Down
7 changes: 1 addition & 6 deletions tests/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,8 @@
#
# SPDX-License-Identifier: MIT

import sys


if sys.version_info >= (3, 9):
from typing import Annotated
else:
from typing_extensions import Annotated # noqa: F401
from typing import Annotated # noqa: F401


def nop(*_, **__):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_fake_factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import sys

from typing import AsyncGenerator, Generator
from collections.abc import AsyncGenerator, Generator

import pytest

Expand Down
3 changes: 2 additions & 1 deletion tests/typing/aiohttp.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
#
# SPDX-License-Identifier: MIT

from typing import Generator, Protocol
from collections.abc import Generator
from typing import Protocol

from aiohttp.web import Application, Request

Expand Down
3 changes: 2 additions & 1 deletion tests/typing/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
import contextlib
import sys

from typing import AsyncGenerator, Generator, NewType, Protocol
from collections.abc import AsyncGenerator, Generator
from typing import NewType, Protocol

import svcs

Expand Down
11 changes: 2 additions & 9 deletions tests/typing/fastapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,16 @@

from __future__ import annotations

import sys

from collections.abc import AsyncGenerator
from contextlib import asynccontextmanager
from typing import AsyncGenerator
from typing import Annotated

from fastapi import Depends, FastAPI
from fastapi.responses import JSONResponse

import svcs


if sys.version_info < (3, 9):
from typing_extensions import Annotated
else:
from typing import Annotated


@svcs.fastapi.lifespan
async def lifespan(
app: FastAPI, registry: svcs.Registry
Expand Down
2 changes: 1 addition & 1 deletion tests/typing/flask.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: MIT

from typing import Generator
from collections.abc import Generator

import flask

Expand Down
2 changes: 1 addition & 1 deletion tests/typing/pyramid.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from __future__ import annotations

from typing import Generator
from collections.abc import Generator

import pyramid

Expand Down
3 changes: 2 additions & 1 deletion tests/typing/starlette.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

from __future__ import annotations

from collections.abc import AsyncGenerator, Generator
from contextlib import asynccontextmanager
from typing import AsyncGenerator, Generator, Protocol
from typing import Protocol

from starlette.applications import Starlette
from starlette.middleware import Middleware
Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ env_list =
docs,
mypy-pkg,
pyright,
py3{8,9,10,11,12,13}-mypy
py3{8,9,10,11,12,13}-tests{,-optional},
py3{9,10,11,12,13}-mypy
py3{9,10,11,12,13}-tests{,-optional},
coverage-report


Expand Down

0 comments on commit 267fa1e

Please sign in to comment.