git: 22cbc384e0b7 - main - www/py-aiobreaker: Add new port
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 11 Dec 2025 20:59:20 UTC
The branch main has been updated by otis:
URL: https://cgit.FreeBSD.org/ports/commit/?id=22cbc384e0b7f39c4c4d5db8f13746b5fc484d6c
commit 22cbc384e0b7f39c4c4d5db8f13746b5fc484d6c
Author: Juraj Lutter <otis@FreeBSD.org>
AuthorDate: 2025-12-11 20:44:22 +0000
Commit: Juraj Lutter <otis@FreeBSD.org>
CommitDate: 2025-12-11 20:48:47 +0000
www/py-aiobreaker: Add new port
aiobreaker is a Python implementation of the Circuit Breaker pattern,
described in Michael T. Nygard's book Release It!_.
Circuit breakers exist to allow one subsystem to fail without destroying
the entire system. This is done by wrapping dangerous operations
(typically integration points) with a component that can circumvent
calls when the system is not healthy.
---
www/Makefile | 1 +
www/py-aiobreaker/Makefile | 21 ++++++++++
www/py-aiobreaker/distinfo | 3 ++
www/py-aiobreaker/files/patch-license.md | 30 +++++++++++++++
www/py-aiobreaker/files/patch-readme.rst | 66 ++++++++++++++++++++++++++++++++
www/py-aiobreaker/pkg-descr | 7 ++++
6 files changed, 128 insertions(+)
diff --git a/www/Makefile b/www/Makefile
index 1afb5e923f1a..0d7e721b0863 100644
--- a/www/Makefile
+++ b/www/Makefile
@@ -1486,6 +1486,7 @@
SUBDIR += py-WebFlash
SUBDIR += py-adblock
SUBDIR += py-advocate
+ SUBDIR += py-aiobreaker
SUBDIR += py-aioh2
SUBDIR += py-aiohttp
SUBDIR += py-aiohttp-jinja2
diff --git a/www/py-aiobreaker/Makefile b/www/py-aiobreaker/Makefile
new file mode 100644
index 000000000000..c38d6bf69c10
--- /dev/null
+++ b/www/py-aiobreaker/Makefile
@@ -0,0 +1,21 @@
+PORTNAME= aiobreaker
+PORTVERSION= 1.2.0
+CATEGORIES= www python
+MASTER_SITES= PYPI
+PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER= otis@FreeBSD.org
+COMMENT= AIO Circuit Breaker pattern
+WWW= https://pypi.org/project/aiobreaker/
+
+LICENSE= BSD3CLAUSE
+
+BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}setuptools>=0:devel/py-setuptools@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}wheel>=0:devel/py-wheel@${PY_FLAVOR}
+
+USES= python
+USE_PYTHON= autoplist concurrent distutils
+
+NO_ARCH= yes
+
+.include <bsd.port.mk>
diff --git a/www/py-aiobreaker/distinfo b/www/py-aiobreaker/distinfo
new file mode 100644
index 000000000000..55117b74f5df
--- /dev/null
+++ b/www/py-aiobreaker/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1757576651
+SHA256 (aiobreaker-1.2.0.tar.gz) = 217a9cfa12e520bb2dd1934bace281d1d7deb8d7630dd183a6295fd22e323ce7
+SIZE (aiobreaker-1.2.0.tar.gz) = 15947
diff --git a/www/py-aiobreaker/files/patch-license.md b/www/py-aiobreaker/files/patch-license.md
new file mode 100644
index 000000000000..5b2138040734
--- /dev/null
+++ b/www/py-aiobreaker/files/patch-license.md
@@ -0,0 +1,30 @@
+--- license.md.orig 2025-09-11 08:55:21 UTC
++++ license.md
+@@ -0,0 +1,27 @@
++Copyright (c) 2010-2014, Daniel Fernandes Martins
++All rights reserved.
++
++Redistribution and use in source and binary forms, with or without modification,
++are permitted provided that the following conditions are met:
++
++ 1. Redistributions of source code must retain the above copyright notice,
++ this list of conditions and the following disclaimer.
++
++ 2. Redistributions in binary form must reproduce the above copyright
++ notice, this list of conditions and the following disclaimer in the
++ documentation and/or other materials provided with the distribution.
++
++ 3. Neither the name of PyBreaker nor the names of its contributors may
++ be used to endorse or promote products derived from this software
++ software without specific prior written permission.
++
++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
++ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
++WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
++DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
++ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
++(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
++LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
++ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
++SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/www/py-aiobreaker/files/patch-readme.rst b/www/py-aiobreaker/files/patch-readme.rst
new file mode 100644
index 000000000000..48f624e0f6f1
--- /dev/null
+++ b/www/py-aiobreaker/files/patch-readme.rst
@@ -0,0 +1,66 @@
+--- readme.rst.orig 2025-09-11 08:55:00 UTC
++++ readme.rst
+@@ -0,0 +1,63 @@
++aiobreaker
++==========
++
++aiobreaker is a Python implementation of the Circuit Breaker pattern,
++described in Michael T. Nygard's book `Release It!`_.
++
++Circuit breakers exist to allow one subsystem to fail without destroying
++the entire system. This is done by wrapping dangerous operations
++(typically integration points) with a component that can circumvent
++calls when the system is not healthy.
++
++This project is a fork of pybreaker_ by Daniel Fernandes Martins that
++replaces tornado with native asyncio, originally so I could practice
++packaging and learn about that shiny new ``typing`` package.
++
++.. _`Release It!`: https://pragprog.com/titles/mnee2/release-it-second-edition/
++.. _pybreaker: https://github.com/danielfm/pybreaker
++
++Features
++--------
++
++- Configurable list of excluded exceptions (e.g. business exceptions)
++- Configurable failure threshold and reset timeout
++- Support for several event listeners per circuit breaker
++- Can guard generator functions
++- Functions and properties for easy monitoring and management
++- ``asyncio`` support
++- Optional redis backing
++- Synchronous and asynchronous event listeners
++
++Requirements
++------------
++
++All you need is ``python 3.6`` or higher.
++
++Installation
++------------
++
++To install, simply download from pypi:
++
++.. code:: bash
++
++ pip install aiobreaker
++
++Usage
++-----
++
++The first step is to create an instance of ``CircuitBreaker`` for each
++integration point you want to protect against.
++
++.. code:: python
++
++ from aiobreaker import CircuitBreaker
++
++ # Used in database integration points
++ db_breaker = CircuitBreaker(fail_max=5, reset_timeout=timedelta(seconds=60))
++
++ @db_breaker
++ async def outside_integration():
++ """Hits the api"""
++ ...
++
++At that point, go ahead and get familiar with the documentation.
diff --git a/www/py-aiobreaker/pkg-descr b/www/py-aiobreaker/pkg-descr
new file mode 100644
index 000000000000..484dc56a325c
--- /dev/null
+++ b/www/py-aiobreaker/pkg-descr
@@ -0,0 +1,7 @@
+aiobreaker is a Python implementation of the Circuit Breaker pattern, described
+in Michael T. Nygard's book Release It!.
+
+Circuit breakers exist to allow one subsystem to fail without destroying the
+entire system. This is done by wrapping dangerous operations (typically
+integration points) with a component that can circumvent calls when the system
+is not healthy.