git: 542e6eda3dd1 - main - devel/py-pyrate-limiter: Add py-pyrate-limiter 4.4.0
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 26 Jun 2026 20:49:28 UTC
The branch main has been updated by sunpoet:
URL: https://cgit.FreeBSD.org/ports/commit/?id=542e6eda3dd10fb5e559d3d6faab852da6c29569
commit 542e6eda3dd10fb5e559d3d6faab852da6c29569
Author: Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2026-06-26 20:42:59 +0000
Commit: Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2026-06-26 20:42:59 +0000
devel/py-pyrate-limiter: Add py-pyrate-limiter 4.4.0
PyrateLimiter is a fast, async-friendly rate limiter for Python -- Leaky-Bucket
algorithm with pluggable backends.
Features:
- Leaky-bucket algorithm: smooth, well-understood rate limiting.
- Multiple rates at once: e.g. 5/second and 1000/hour on the same key.
- Per-key limits: track different services, users, or resources independently.
- Pluggable backends: in-memory, SQLite, Redis (sync and async), Postgres, and
multiprocessing.
- Sync & async: the same API works in both; async paths never block the event
loop.
- Direct calls or decorators: limiter.try_acquire(...) or
@limiter.as_decorator(...).
- Blocking or non-blocking: wait for a permit (with optional timeout) or fail
fast.
---
devel/Makefile | 1 +
devel/py-pyrate-limiter/Makefile | 30 ++++++++++++++++++++++
devel/py-pyrate-limiter/distinfo | 3 +++
devel/py-pyrate-limiter/files/patch-pyproject.toml | 15 +++++++++++
devel/py-pyrate-limiter/pkg-descr | 15 +++++++++++
5 files changed, 64 insertions(+)
diff --git a/devel/Makefile b/devel/Makefile
index 18509df3c005..f1dbf4607e8f 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -5829,6 +5829,7 @@
SUBDIR += py-pyquery
SUBDIR += py-pyquil
SUBDIR += py-pyral
+ SUBDIR += py-pyrate-limiter
SUBDIR += py-pyrepl
SUBDIR += py-pyrfc3339
SUBDIR += py-pyright
diff --git a/devel/py-pyrate-limiter/Makefile b/devel/py-pyrate-limiter/Makefile
new file mode 100644
index 000000000000..5d7036d6ff4a
--- /dev/null
+++ b/devel/py-pyrate-limiter/Makefile
@@ -0,0 +1,30 @@
+PORTNAME= pyrate-limiter
+PORTVERSION= 4.4.0
+CATEGORIES= devel python
+MASTER_SITES= PYPI
+PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
+DISTNAME= pyrate_limiter-${PORTVERSION}
+
+MAINTAINER= sunpoet@FreeBSD.org
+COMMENT= Python Rate-Limiter using Leaky-Bucket Algorithm
+WWW= https://pyratelimiter.readthedocs.io/en/latest/ \
+ https://github.com/vutran1710/PyrateLimiter
+
+LICENSE= MIT
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}hatchling>=0:devel/py-hatchling@${PY_FLAVOR}
+
+USES= python
+USE_PYTHON= autoplist concurrent pep517
+
+NO_ARCH= yes
+
+OPTIONS_DEFINE= ALL
+ALL_DESC= All optional dependencies
+
+ALL_RUN_DEPENDS=${PYTHON_PKGNAMEPREFIX}filelock>=3.0:sysutils/py-filelock@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}psycopg>=3.2.9:databases/py-psycopg@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}redis>=6.2.0:databases/py-redis@${PY_FLAVOR}
+
+.include <bsd.port.mk>
diff --git a/devel/py-pyrate-limiter/distinfo b/devel/py-pyrate-limiter/distinfo
new file mode 100644
index 000000000000..49954dcaee8e
--- /dev/null
+++ b/devel/py-pyrate-limiter/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1780751894
+SHA256 (pyrate_limiter-4.4.0.tar.gz) = 2c0c720c4fa16c5d8199e4821bf34507fb49c007a25b786cec6fb94ffd0844aa
+SIZE (pyrate_limiter-4.4.0.tar.gz) = 90955
diff --git a/devel/py-pyrate-limiter/files/patch-pyproject.toml b/devel/py-pyrate-limiter/files/patch-pyproject.toml
new file mode 100644
index 000000000000..10e8a4352bf7
--- /dev/null
+++ b/devel/py-pyrate-limiter/files/patch-pyproject.toml
@@ -0,0 +1,15 @@
+--- pyproject.toml.orig 2020-02-02 00:00:00 UTC
++++ pyproject.toml
+@@ -95,11 +95,8 @@ context = 7
+ context = 7
+
+ [build-system]
+-requires = ["hatchling", "uv-dynamic-versioning"]
++requires = ["hatchling"]
+ build-backend = "hatchling.build"
+-
+-[tool.hatch.version]
+-source = "uv-dynamic-versioning"
+
+ [tool.hatch.build.targets.sdist]
+ include = [
diff --git a/devel/py-pyrate-limiter/pkg-descr b/devel/py-pyrate-limiter/pkg-descr
new file mode 100644
index 000000000000..e2f9e6101cbf
--- /dev/null
+++ b/devel/py-pyrate-limiter/pkg-descr
@@ -0,0 +1,15 @@
+PyrateLimiter is a fast, async-friendly rate limiter for Python -- Leaky-Bucket
+algorithm with pluggable backends.
+
+Features:
+- Leaky-bucket algorithm: smooth, well-understood rate limiting.
+- Multiple rates at once: e.g. 5/second and 1000/hour on the same key.
+- Per-key limits: track different services, users, or resources independently.
+- Pluggable backends: in-memory, SQLite, Redis (sync and async), Postgres, and
+ multiprocessing.
+- Sync & async: the same API works in both; async paths never block the event
+ loop.
+- Direct calls or decorators: limiter.try_acquire(...) or
+ @limiter.as_decorator(...).
+- Blocking or non-blocking: wait for a permit (with optional timeout) or fail
+ fast.