[arch-commits] Commit in python-starlette/repos/community-any (3 files)

Evangelos Foutras foutrelis at gemini.archlinux.org
Tue May 24 12:53:55 UTC 2022


    Date: Tuesday, May 24, 2022 @ 12:53:55
  Author: foutrelis
Revision: 1210196

archrelease: copy trunk to community-any

Added:
  python-starlette/repos/community-any/PKGBUILD
    (from rev 1210195, python-starlette/trunk/PKGBUILD)
  python-starlette/repos/community-any/jinja-3.1.patch
    (from rev 1210195, python-starlette/trunk/jinja-3.1.patch)
Deleted:
  python-starlette/repos/community-any/PKGBUILD

-----------------+
 PKGBUILD        |  116 +++++++++++++++++++++++++++---------------------------
 jinja-3.1.patch |   35 ++++++++++++++++
 2 files changed, 95 insertions(+), 56 deletions(-)

Deleted: PKGBUILD
===================================================================
--- PKGBUILD	2022-05-24 12:53:51 UTC (rev 1210195)
+++ PKGBUILD	2022-05-24 12:53:55 UTC (rev 1210196)
@@ -1,56 +0,0 @@
-# Maintainer: Filipe Laíns (FFY00) <lains at archlinux.org>
-
-_pkgname=starlette
-pkgname=python-$_pkgname
-pkgver=0.14.2
-pkgrel=3
-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")
-sha512sums=('4321d3d1890c49dea53d7923b456772ecc9d28083d28392e0e9cd1f39f33180cc1cb28914bee443849fa8c87015dd99610ea18e03f0101b0eaf3f8df56249fab')
-
-prepare() {
-  cd $_pkgname-$pkgver
-
-  # 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
-}
-
-check() {
-  cd $_pkgname-$pkgver
-
-  python -m pytest -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
-}

Copied: python-starlette/repos/community-any/PKGBUILD (from rev 1210195, python-starlette/trunk/PKGBUILD)
===================================================================
--- PKGBUILD	                        (rev 0)
+++ PKGBUILD	2022-05-24 12:53:55 UTC (rev 1210196)
@@ -0,0 +1,60 @@
+# Maintainer: Filipe Laíns (FFY00) <lains at archlinux.org>
+
+_pkgname=starlette
+pkgname=python-$_pkgname
+pkgver=0.14.2
+pkgrel=4
+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')
+
+prepare() {
+  cd $_pkgname-$pkgver
+
+  patch -Np1 -i ../jinja-3.1.patch
+
+  # 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
+}
+
+check() {
+  cd $_pkgname-$pkgver
+
+  python -m pytest -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
+}

Copied: python-starlette/repos/community-any/jinja-3.1.patch (from rev 1210195, python-starlette/trunk/jinja-3.1.patch)
===================================================================
--- jinja-3.1.patch	                        (rev 0)
+++ jinja-3.1.patch	2022-05-24 12:53:55 UTC (rev 1210196)
@@ -0,0 +1,35 @@
+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