mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2026-04-06 13:10:33 +02:00
gnu: Add python-flask-limiter.
* gnu/packages/python-web.scm (python-flask-limiter): New variable. Change-Id: I0730a509835e8a655bffeace8869e550c9e015c0 Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
This commit is contained in:
committed by
Liliana Marie Prikler
parent
92e10c3337
commit
881cfbba6d
@@ -1234,6 +1234,70 @@ fort ok https://github.com/thadeusb/flask-cache.")
|
||||
inspired by Ruby's will_paginate library. It supports several CSS frameworks.")
|
||||
(license license:bsd-3)))
|
||||
|
||||
(define-public python-flask-limiter
|
||||
(package
|
||||
(name "python-flask-limiter")
|
||||
(version "4.1.1")
|
||||
(source
|
||||
(origin
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
(url "https://github.com/alisaifee/flask-limiter")
|
||||
(commit version)))
|
||||
(file-name (git-file-name name version))
|
||||
(sha256
|
||||
(base32 "18n12iayzw6qqys26824j5lfbphfcammpmyrvys1k0rn4xcbifln"))))
|
||||
(build-system pyproject-build-system)
|
||||
(arguments
|
||||
(list
|
||||
;; tests: 155 passed, 620 deselected
|
||||
#:test-flags
|
||||
#~(list "-k" (simple-format #f "not (~a)"
|
||||
(string-join
|
||||
(append
|
||||
;; The test suite spawns storages in Docker.
|
||||
'("memcache" "reset_unsupported")
|
||||
'("mongo")
|
||||
'("redis" "clear_limits"
|
||||
"constructor_arguments_over_config"
|
||||
"custom_key_prefix" "fallback_to_memory"))
|
||||
" or ")))
|
||||
#:phases
|
||||
#~(modify-phases %standard-phases
|
||||
(add-before 'check 'adjust-tests
|
||||
(lambda _
|
||||
(substitute* "pytest.ini"
|
||||
((".*--cov=.*") ""))
|
||||
(substitute* (find-files "tests" "\\.py$")
|
||||
(("import pymemcache.*") "")
|
||||
(("import pymongo.*") "")
|
||||
(("import redis.*") "")))))))
|
||||
(native-inputs (list python-flask-restful
|
||||
python-hatch-vcs
|
||||
python-hatchling
|
||||
python-hiro
|
||||
python-pytest
|
||||
python-pytest-check
|
||||
python-pytest-mock))
|
||||
(propagated-inputs (list python-flask
|
||||
python-limits
|
||||
python-ordered-set
|
||||
python-rich))
|
||||
(home-page "https://flask-limiter.readthedocs.org/")
|
||||
(synopsis "Rate limiting for Flask applications")
|
||||
(description
|
||||
"Flask-Limiter adds rate limiting to Flask applications.
|
||||
Rate limits can be configured at different levels such as:
|
||||
|
||||
@itemize
|
||||
@item Application wide global limits per user
|
||||
@item Default limits per route
|
||||
@item By blueprints
|
||||
@item By class-based views
|
||||
@item By individual routes
|
||||
@end itemize")
|
||||
(license license:expat)))
|
||||
|
||||
(define-public python-gdown
|
||||
(package
|
||||
(name "python-gdown")
|
||||
|
||||
Reference in New Issue
Block a user