backports/py3-flask-limiter: move from user

This commit is contained in:
Antoine Martin 2023-08-30 13:38:47 -04:00
parent 09363bd7d7
commit a42582583b
3 changed files with 72 additions and 34 deletions

View file

@ -0,0 +1,50 @@
# Contributor: Lauren N. Liberda <lauren@selfisekai.rocks>
# Maintainer: Lauren N. Liberda <lauren@selfisekai.rocks>
pkgname=py3-flask-limiter
pkgver=3.3.1
pkgrel=0
pkgdesc="Rate Limiting extension for Flask"
url="https://github.com/alisaifee/flask-limiter"
arch="noarch"
license="MIT"
depends="
py3-flask
py3-limits
py3-ordered-set
py3-rich
python3
"
makedepends="py3-setuptools"
checkdepends="
py3-flask-restful
py3-flask-restx
py3-limits-mongodb
py3-limits-redis
py3-pytest
py3-pytest-cov
"
options="!check" # tests depend on unpackaged modules
subpackages="$pkgname-pyc"
source="
https://github.com/alisaifee/flask-limiter/archive/refs/tags/$pkgver/flask-limiter-$pkgver.tar.gz
our-std-is-good-enough.patch
"
builddir="$srcdir/flask-limiter-$pkgver"
build() {
python3 setup.py build
}
check() {
pytest
}
package() {
python3 setup.py install --prefix=/usr --root="$pkgdir"
}
sha512sums="
3de2e4a3d94fe2788c0896cb2d42ec04307d6ed929985c636810d6b6fd2633419e8b8832de9541e44877cab354283cdc03912ae9cc15f124297ad13bde14e781 flask-limiter-3.3.1.tar.gz
1b90e9134076cda249695d5ea741db9d205a2ae452c7d6edfe01eb37a221ce6f64b0e8ddcdbbee9b0e0fb16a28e5eabf14f1c1e41e965c7e3b93ea4f42caf553 our-std-is-good-enough.patch
"

View file

@ -0,0 +1,22 @@
--- ./flask_limiter/typing.py.orig
+++ ./flask_limiter/typing.py
@@ -11,7 +11,7 @@
cast,
)
-from typing_extensions import ParamSpec
+from typing import ParamSpec
R = TypeVar("R")
P = ParamSpec("P")
--- ./flask_limiter/commands.py.orig
+++ ./flask_limiter/commands.py
@@ -14,7 +14,7 @@
from rich.table import Table
from rich.theme import Theme
from rich.tree import Tree
-from typing_extensions import TypedDict
+from typing import TypedDict
from werkzeug.exceptions import MethodNotAllowed, NotFound
from werkzeug.routing import Rule

View file

@ -1,34 +0,0 @@
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
_pyname=Flask-Limiter
pkgname=py3-flask-limiter
pkgver=3.3.0
pkgrel=0
arch="noarch"
pkgdesc="Flask-Limiter adds rate limiting to Flask applications."
url="https://pypi.python.org/project/$_pyname"
license="MIT"
depends="python3"
makedepends="py3-setuptools py3-wheel py3-pip"
options="!check" # Missing py3-hiro
checkdepends="py3-pytest py3-flask-restful py3-hiro"
source="$pkgname-$pkgver.tar.gz::https://pypi.io/packages/source/${_pyname:0:1}/$_pyname/$_pyname-$pkgver.tar.gz"
builddir="$srcdir"/$_pyname-$pkgver
build() {
python3 setup.py build
}
check() {
pyver=$(python3 -c "import sys; print('{}.{}'.format(*sys.version_info[:2]))")
python3 setup.py install --prefix=/usr --root="$srcdir"/tmp_install --optimize=1
PYTHONPATH="$srcdir"/tmp_install/usr/lib/python$pyver/site-packages pytest || true
}
package() {
python3 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1
}
sha512sums="
9dc94a6177a512d13f934339212b93b52c601fc8bbf939b07dd6fc15c8646161d2746435a87f49bc412843311b1d3a57527206dc5b0a516ffff492dc3fe3607e py3-flask-limiter-3.3.0.tar.gz
"