[arch-commits] Commit in python-starlette/trunk (PKGBUILD jinja-3.1.patch)

David Runge dvzrv at gemini.archlinux.org
Tue Jul 12 10:53:23 UTC 2022


    Date: Tuesday, July 12, 2022 @ 10:53:22
  Author: dvzrv
Revision: 1250384

upgpkg: python-starlette 0.20.4-1: Upgrade to 0.20.4.

Remove unnecessary quotes and curly braces.
Remove unneeded patch.
Add descriptions to all optdepends.
Consolidate checkdepends.
Switch to PEP517.
Add 'filterwarnings' as known markers so pytest can use them.

Modified:
  python-starlette/trunk/PKGBUILD
Deleted:
  python-starlette/trunk/jinja-3.1.patch

-----------------+
 PKGBUILD        |   87 +++++++++++++++++++++++++-----------------------------
 jinja-3.1.patch |   35 ---------------------
 2 files changed, 41 insertions(+), 81 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2022-07-12 10:51:10 UTC (rev 1250383)
+++ PKGBUILD	2022-07-12 10:53:22 UTC (rev 1250384)
@@ -1,60 +1,55 @@
+# Maintainer: David Runge <dvzrv at archlinux.org>
 # Maintainer: Filipe Laíns (FFY00) <lains at archlinux.org>
 
-_pkgname=starlette
-pkgname=python-$_pkgname
-pkgver=0.14.2
-pkgrel=4
+_name=starlette
+pkgname=python-$_name
+pkgver=0.20.4
+pkgrel=1
 pkgdesc='The little ASGI framework that shines'
-arch=('any')
-url='https://github.com/encode/starlette'
-license=('BSD')
-depends=('python' 'python-anyio')
-optdepends=('python-aiofiles' 'python-graphene' 'python-itsdangerous' 'python-jinja'
-            'python-yaml' 'python-requests' 'python-ujson' 'python-python-multipart')
-makedepends=('python-setuptools')
-checkdepends=('python-pytest' 'python-trio' 'python-pytest-asyncio'
-              'python-aiofiles' 'python-graphene' 'python-itsdangerous' 'python-jinja'
-              'python-yaml' 'python-requests' 'python-ujson'
-              'python-unidecode' 'python-python-multipart')
-source=("$pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz"
-        jinja-3.1.patch)
-sha512sums=('4321d3d1890c49dea53d7923b456772ecc9d28083d28392e0e9cd1f39f33180cc1cb28914bee443849fa8c87015dd99610ea18e03f0101b0eaf3f8df56249fab'
-            '92a2cddcdc91b2e0569df3250490a343631fd455e639be29aa475b438ad854ef76082c3da8ae9d4594ff13fd8b35dd20def6714782ff3285e7f23bb3dca1318a')
+arch=(any)
+url="https://github.com/encode/starlette"
+license=(BSD)
+depends=(python python-anyio)
+optdepends=(
+  'python-itsdangerous: for session middleware support'
+  'python-jinja: for jinja templates'
+  'python-python-multipart: for form parsing'
+  'python-pyyaml: for schema generator'
+  'python-requests: for test client'
+)
+makedepends=(python-build python-installer python-setuptools python-wheel)
+checkdepends=(
+  python-aiosqlite
+  python-databases
+  python-pytest
+  python-trio
 
-prepare() {
-  cd $_pkgname-$pkgver
+  # optdepends
+  python-itsdangerous
+  python-jinja
+  python-python-multipart
+  python-pyyaml
+  python-requests
 
-  patch -Np1 -i ../jinja-3.1.patch
+  # not specified,but required
+  python-sqlalchemy
+)
+source=($_name-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz)
+sha512sums=('481a095ada3140164abae89026da36c90657d8ccabb0a6753094bf7fdf47ce6f789320ed15e94d15dedffaf302691e204cb541c26a4c779848aa6505dfe52b2f')
+b2sums=('265ef6b88ebc5cee4361601198891cbab9e92e354942a06622bdac46dc63d2644557bef952730b455157ee83b15035016039f8a88f17e673487e9a3571d6180c')
 
-  # remove pytest-cov usage
-  sed -i '/^  --cov.*/d' setup.cfg
-
-  # needs python-multipart
-  rm tests/test_formparsers.py
-
-  # needs python-databases
-  rm tests/test_database.py
-
-  # needs a different graphql version
-  rm tests/test_graphql.py
-}
-
 build() {
-  cd $_pkgname-$pkgver
-
-  python setup.py build
+  cd $_name-$pkgver
+  python -m build --wheel --no-isolation
 }
 
 check() {
-  cd $_pkgname-$pkgver
-
-  python -m pytest -p no:warnings
+  cd $_name-$pkgver
+  pytest -vv -o 'markers=filterwarnings' -p no:warnings
 }
 
 package() {
-  cd $_pkgname-$pkgver
-
-  python setup.py install --root="$pkgdir" --optimize=1 --skip-build
-
-  install -Dm 644 LICENSE.md "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
+  cd $_name-$pkgver
+  python -m installer --destdir="$pkgdir" dist/*.whl
+  install -vDm 644 LICENSE.md -t "$pkgdir/usr/share/licenses/$pkgname/"
 }

Deleted: jinja-3.1.patch
===================================================================
--- jinja-3.1.patch	2022-07-12 10:51:10 UTC (rev 1250383)
+++ jinja-3.1.patch	2022-07-12 10:53:22 UTC (rev 1250384)
@@ -1,35 +0,0 @@
-From d26f44b4aeaec63ae8ce0a4f34dea7439da48012 Mon Sep 17 00:00:00 2001
-From: Jamie Hewland <jhewland at gmail.com>
-Date: Thu, 13 May 2021 15:11:14 +0100
-Subject: [PATCH] Use non-deprecated jinja2.pass_context in Jinja 3.0+ (#1183)
-
----
- starlette/templating.py | 8 +++++++-
- 1 file changed, 7 insertions(+), 1 deletion(-)
-
-diff --git a/starlette/templating.py b/starlette/templating.py
-index 631b6bfee..64fdbd14f 100644
---- a/starlette/templating.py
-+++ b/starlette/templating.py
-@@ -6,6 +6,12 @@
- 
- try:
-     import jinja2
-+
-+    # @contextfunction renamed to @pass_context in Jinja 3.0, to be removed in 3.1
-+    if hasattr(jinja2, "pass_context"):
-+        pass_context = jinja2.pass_context
-+    else:  # pragma: nocover
-+        pass_context = jinja2.contextfunction
- except ImportError:  # pragma: nocover
-     jinja2 = None  # type: ignore
- 
-@@ -53,7 +59,7 @@ def __init__(self, directory: str) -> None:
-         self.env = self.get_env(directory)
- 
-     def get_env(self, directory: str) -> "jinja2.Environment":
--        @jinja2.contextfunction
-+        @pass_context
-         def url_for(context: dict, name: str, **path_params: typing.Any) -> str:
-             request = context["request"]
-             return request.url_for(name, **path_params)



More information about the arch-commits mailing list