From 19d1053fc57cc8d80fb13c2d5eada7ee6d104b92 Mon Sep 17 00:00:00 2001 From: Paul Zander Date: Thu, 12 Mar 2026 16:01:02 +0100 Subject: [PATCH] dev-python/litestar: new package, add 2.21.1 Signed-off-by: Alfred Wingate Signed-off-by: Paul Zander --- dev-python/litestar/Manifest | 1 + .../files/litestar-2.19.0-no-valkey.patch | 98 ++++++++++++ dev-python/litestar/litestar-2.21.1.ebuild | 151 ++++++++++++++++++ dev-python/litestar/metadata.xml | 14 ++ 4 files changed, 264 insertions(+) create mode 100644 dev-python/litestar/Manifest create mode 100644 dev-python/litestar/files/litestar-2.19.0-no-valkey.patch create mode 100644 dev-python/litestar/litestar-2.21.1.ebuild create mode 100644 dev-python/litestar/metadata.xml diff --git a/dev-python/litestar/Manifest b/dev-python/litestar/Manifest new file mode 100644 index 0000000000..b09c8baafd --- /dev/null +++ b/dev-python/litestar/Manifest @@ -0,0 +1 @@ +DIST litestar-2.21.1.gh.tar.gz 2954454 BLAKE2B e25249995e390027266bf94eac23feb73a6b4730d71f8e4384e22ddb80ecb4d7df9710b27e54a5eb3bdb5b6aeb44aef7d390a9db849280f11419c283a0c77d2a SHA512 214989cf82d49feb57a1bfcc6ac57604088b544e6ccb10492269f207490ce019e73432982644707028baaee3067ee905106f93607f33776b13b4b2ef4575a566 diff --git a/dev-python/litestar/files/litestar-2.19.0-no-valkey.patch b/dev-python/litestar/files/litestar-2.19.0-no-valkey.patch new file mode 100644 index 0000000000..c788e3962b --- /dev/null +++ b/dev-python/litestar/files/litestar-2.19.0-no-valkey.patch @@ -0,0 +1,98 @@ +diff --git a/tests/conftest.py b/tests/conftest.py +index 846899814..9f0df8bc1 100644 +--- a/tests/conftest.py ++++ b/tests/conftest.py +@@ -18,8 +18,6 @@ from pytest_lazy_fixtures import lf + from redis.asyncio import Redis as AsyncRedis + from redis.client import Redis + from time_machine import Coordinates, travel +-from valkey.asyncio import Valkey as AsyncValkey +-from valkey.client import Valkey + + from litestar.logging import LoggingConfig + from litestar.middleware.session import SessionMiddleware +@@ -31,7 +29,6 @@ from litestar.stores.base import Store + from litestar.stores.file import FileStore + from litestar.stores.memory import MemoryStore + from litestar.stores.redis import RedisStore +-from litestar.stores.valkey import ValkeyStore + from litestar.testing import RequestFactory + from tests.helpers import not_none + +@@ -85,11 +82,6 @@ def redis_store(redis_client: AsyncRedis) -> RedisStore: + return RedisStore(redis=redis_client) + + +-@pytest.fixture() +-def valkey_store(valkey_client: AsyncValkey) -> ValkeyStore: +- return ValkeyStore(valkey=valkey_client) +- +- + @pytest.fixture() + def memory_store() -> MemoryStore: + return MemoryStore() +@@ -115,7 +107,6 @@ def file_store_create_directories_flag_false(tmp_path: Path) -> FileStore: + @pytest.fixture( + params=[ + pytest.param("redis_store", marks=pytest.mark.xdist_group("redis")), +- pytest.param("valkey_store", marks=pytest.mark.xdist_group("valkey")), + "memory_store", + "file_store", + ] +@@ -341,20 +332,6 @@ async def redis_client(docker_ip: str, redis_service: None) -> AsyncGenerator[As + pass + + +-@pytest.fixture() +-async def valkey_client(docker_ip: str, valkey_service: None) -> AsyncGenerator[AsyncValkey, None]: +- # this is to get around some weirdness with pytest-asyncio and valkey interaction +- # on 3.8 and 3.9 +- +- Valkey(host=docker_ip, port=6381).flushall() +- client: AsyncValkey = AsyncValkey(host=docker_ip, port=6381) +- yield client +- try: +- await client.aclose() +- except RuntimeError: +- pass +- +- + @pytest.fixture(autouse=True) + def _patch_openapi_config(monkeypatch: pytest.MonkeyPatch) -> None: + monkeypatch.setattr("litestar.app.DEFAULT_OPENAPI_CONFIG", OpenAPIConfig(title="Litestar API", version="1.0.0")) +diff --git a/tests/docker_service_fixtures.py b/tests/docker_service_fixtures.py +index 84e78d48e..6efca3697 100644 +--- a/tests/docker_service_fixtures.py ++++ b/tests/docker_service_fixtures.py +@@ -13,8 +13,6 @@ import asyncpg + import pytest + from redis.asyncio import Redis as AsyncRedis + from redis.exceptions import ConnectionError as RedisConnectionError +-from valkey.asyncio import Valkey as AsyncValkey +-from valkey.exceptions import ConnectionError as ValkeyConnectionError + + from litestar.utils import ensure_async_callable + +@@ -129,21 +127,6 @@ async def redis_service(docker_services: DockerServiceRegistry) -> None: + await docker_services.start("redis", check=redis_responsive) + + +-async def valkey_responsive(host: str) -> bool: +- client: AsyncValkey = AsyncValkey(host=host, port=6381) +- try: +- return await client.ping() +- except (ConnectionError, ValkeyConnectionError): +- return False +- finally: +- await client.aclose() +- +- +-@pytest.fixture() +-async def valkey_service(docker_services: DockerServiceRegistry) -> None: +- await docker_services.start("valkey", check=valkey_responsive) +- +- + async def postgres_responsive(host: str) -> bool: + try: + conn = await asyncpg.connect( + diff --git a/dev-python/litestar/litestar-2.21.1.ebuild b/dev-python/litestar/litestar-2.21.1.ebuild new file mode 100644 index 0000000000..3bbcccdacd --- /dev/null +++ b/dev-python/litestar/litestar-2.21.1.ebuild @@ -0,0 +1,151 @@ +# Copyright 2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=hatchling +PYTHON_COMPAT=( python3_{12..14} ) + +inherit distutils-r1 #pypi + +DESCRIPTION="Light, flexible and extensible ASGI framework" +HOMEPAGE=" + https://github.com/litestar-org/litestar/ + https://pypi.org/project/litestar/ +" +# no tests in sdist +SRC_URI=" + https://github.com/litestar-org/litestar/archive/refs/tags/v${PV}.tar.gz + -> ${P}.gh.tar.gz +" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64" + +RDEPEND=" + >=dev-python/anyio-3[${PYTHON_USEDEP}] + dev-python/click[${PYTHON_USEDEP}] + >=dev-python/httpx-0.22[${PYTHON_USEDEP}] + >=dev-python/litestar-htmx-0.4.0[${PYTHON_USEDEP}] + >=dev-python/msgspec-0.18.2[${PYTHON_USEDEP}] + >=dev-python/multidict-6.0.2[${PYTHON_USEDEP}] + >=dev-python/multipart-1.2.0[${PYTHON_USEDEP}] + >=dev-python/polyfactory-2.6.3[${PYTHON_USEDEP}] + dev-python/pyyaml[${PYTHON_USEDEP}] + >=dev-python/rich-13.0.0[${PYTHON_USEDEP}] + dev-python/rich-click[${PYTHON_USEDEP}] + >=dev-python/sniffio-1.3.1[${PYTHON_USEDEP}] + dev-python/typing-extensions[${PYTHON_USEDEP}] +" +BDEPEND=" + test? ( + app-arch/brotli[python,${PYTHON_USEDEP}] + dev-python/aiosqlite[${PYTHON_USEDEP}] + >=dev-python/asyncpg-0.29.0[${PYTHON_USEDEP}] + dev-python/beautifulsoup4[${PYTHON_USEDEP}] + dev-python/fsspec[${PYTHON_USEDEP}] + dev-python/greenlet[${PYTHON_USEDEP}] + dev-python/httpx-sse[${PYTHON_USEDEP}] + dev-python/httpx[${PYTHON_USEDEP}] + dev-python/hypercorn[${PYTHON_USEDEP}] + dev-python/hypothesis[${PYTHON_USEDEP}] + dev-python/prometheus-client[${PYTHON_USEDEP}] + dev-python/psutil[${PYTHON_USEDEP}] + dev-python/psycopg:0[${PYTHON_USEDEP}] + dev-python/pydantic-extra-types[${PYTHON_USEDEP}] + dev-python/redis[${PYTHON_USEDEP}] + dev-python/starlette[${PYTHON_USEDEP}] + dev-python/structlog[${PYTHON_USEDEP}] + + + + + negril.nx+gentoo@gmail.com + Paul Zander + + + + https://docs.litestar.dev/latest/ + litestar-org/litestar + litestar + +