commit:     b52eac772e7272e15c48c63688166b438a063a51
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 21 12:59:23 2024 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Jul 21 14:53:13 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b52eac77

dev-python/starlette: Bump to 0.38.0

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/starlette/Manifest                      |  1 +
 .../starlette/files/starlette-0.38.0-py313.patch   | 35 ++++++++++++++
 dev-python/starlette/starlette-0.38.0.ebuild       | 55 ++++++++++++++++++++++
 3 files changed, 91 insertions(+)

diff --git a/dev-python/starlette/Manifest b/dev-python/starlette/Manifest
index 1c0a3afa328c..4960f00bb2ac 100644
--- a/dev-python/starlette/Manifest
+++ b/dev-python/starlette/Manifest
@@ -1 +1,2 @@
 DIST starlette-0.37.2.gh.tar.gz 2846433 BLAKE2B 
489fe0d3148f8f006d32d3e52e82cc2c07d9b1a8e3a3cadabe2aa2eb9dd7e00b35e2093dc1de0cb4a6a4606395ed4d19b26778686216a7f8b55a15e61701c9da
 SHA512 
27240c706553e610da05cfc92f818c61e97a891ea7c960fef925a122100a61931cbca973a0995aa1e79d192cda2250139f471929a3f4a7b0f4600d00b6287744
+DIST starlette-0.38.0.gh.tar.gz 2847354 BLAKE2B 
edcaa8d360f8316fc91f8e32efe778c74bad491c044e2cf5577878a27b840303b34a8f0aa0cc518165a54f28049fb9ed27af4f7e260dc6fc4fbf1f61897237e6
 SHA512 
89b79f8e3daf1567bc69a2f1f6710a0e981a6633cd462eaa1e014e514f4dbdc98fcb592a3750a1055f08bad28908fc763267e7902479553513e96e2db566b63f

diff --git a/dev-python/starlette/files/starlette-0.38.0-py313.patch 
b/dev-python/starlette/files/starlette-0.38.0-py313.patch
new file mode 100644
index 000000000000..c63b13444847
--- /dev/null
+++ b/dev-python/starlette/files/starlette-0.38.0-py313.patch
@@ -0,0 +1,35 @@
+From 70ade1b6a4987cb92126b5eec534266f4499f2c0 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <[email protected]>
+Date: Sun, 21 Jul 2024 14:14:31 +0200
+Subject: [PATCH] Fix `routing.get_name()` not to assume all routines have
+ `__name__`
+
+Fix `routing.get_name()` to use the `__name__` attribute only if it is
+actually present, rather than assuming that all routine and class types
+have it, and use the fallback to class name otherwise.  This is
+necessary for `functools.partial()` that's not guaranteed to have
+a `__name__`, and in fact does not have one starting with Python
+3.13.0b3.  Given that the `__name__` used to be `partial` before, this
+change effectively preserves the old behavior for `partial`s across all
+Python implementations.
+
+Fixes #2638
+---
+ starlette/routing.py | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/starlette/routing.py b/starlette/routing.py
+index 75a5ec3f3..481b13f5d 100644
+--- a/starlette/routing.py
++++ b/starlette/routing.py
+@@ -99,9 +99,7 @@ async def app(scope: Scope, receive: Receive, send: Send) -> 
None:
+ 
+ 
+ def get_name(endpoint: typing.Callable[..., typing.Any]) -> str:
+-    if inspect.isroutine(endpoint) or inspect.isclass(endpoint):
+-        return endpoint.__name__
+-    return endpoint.__class__.__name__
++    return getattr(endpoint, "__name__", endpoint.__class__.__name__)
+ 
+ 
+ def replace_params(

diff --git a/dev-python/starlette/starlette-0.38.0.ebuild 
b/dev-python/starlette/starlette-0.38.0.ebuild
new file mode 100644
index 000000000000..6b064cc4af3f
--- /dev/null
+++ b/dev-python/starlette/starlette-0.38.0.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=hatchling
+PYTHON_COMPAT=( pypy3 python3_{10..13} )
+
+inherit distutils-r1
+
+MY_P=${P/_p/.post}
+DESCRIPTION="The little ASGI framework that shines"
+HOMEPAGE="
+       https://www.starlette.io/
+       https://github.com/encode/starlette/
+       https://pypi.org/project/starlette/
+"
+# no docs or tests in sdist, as of 0.27.0
+SRC_URI="
+       https://github.com/encode/starlette/archive/${PV/_p/.post}.tar.gz
+               -> ${MY_P}.gh.tar.gz
+"
+S=${WORKDIR}/${MY_P}
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~ppc ~ppc64 ~riscv ~s390 
~sparc ~x86"
+
+RDEPEND="
+       <dev-python/anyio-5[${PYTHON_USEDEP}]
+       >=dev-python/anyio-3.4.0[${PYTHON_USEDEP}]
+       >=dev-python/httpx-0.22.0[${PYTHON_USEDEP}]
+       dev-python/itsdangerous[${PYTHON_USEDEP}]
+       dev-python/jinja[${PYTHON_USEDEP}]
+       >=dev-python/python-multipart-0.0.7[${PYTHON_USEDEP}]
+       >=dev-python/pytest-8[${PYTHON_USEDEP}]
+       dev-python/pyyaml[${PYTHON_USEDEP}]
+"
+BDEPEND="
+       test? (
+               dev-python/trio[${PYTHON_USEDEP}]
+       )
+"
+
+PATCHES=(
+       # https://github.com/encode/starlette/pull/2648
+       "${FILESDIR}/${P}-py313.patch"
+)
+
+EPYTEST_IGNORE=(
+       # Unpackaged 'databases' dependency
+       tests/test_database.py
+)
+
+distutils_enable_tests pytest

Reply via email to