1
0

10 Commits

Author SHA256 Message Date
a04ae0bae8 Accepting request 1298950 from devel:languages:python
- Pass asyncio-mode to pytest.

OBS-URL: https://build.opensuse.org/request/show/1298950
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-circuitbreaker?expand=0&rev=5
2025-08-12 15:04:56 +00:00
51abe92c79 - Pass asyncio-mode to pytest.
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-circuitbreaker?expand=0&rev=10
2025-08-12 02:57:11 +00:00
97bc57f8ea Accepting request 1273166 from devel:languages:python
- update to 2.1.3:
  * fix datetime.utcnow deprecation
  * test with newer python versions
  * various build cleanups

OBS-URL: https://build.opensuse.org/request/show/1273166
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-circuitbreaker?expand=0&rev=4
2025-04-29 14:40:00 +00:00
37920866c4 - update to 2.1.3:
* fix datetime.utcnow deprecation
  * test with newer python versions
  * various build cleanups

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-circuitbreaker?expand=0&rev=8
2025-04-28 14:03:39 +00:00
0f79433cc6 Accepting request 1197814 from devel:languages:python
- update to 2.0.0:
  * Async Support
  * Python2 not supported anymore
  * Supported Python versions now are:  3.11, 3.10, 3.9, 3.8, 3.7
- version 1.4.0:
  * Fallback Function
  * Custom callable for handling exceptions
  * Monotonic clock
  * Circuitbreaker default name
  * the project is now built on Github Action instead of Travis CI
  * building for python 3.10
  * applied smaller flake8 fixes
- Drop use_stdlib_mock.patch merged upstream

OBS-URL: https://build.opensuse.org/request/show/1197814
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-circuitbreaker?expand=0&rev=3
2024-09-01 17:21:37 +00:00
8e39669d3a Accepting request 927838 from devel:languages:python
- Update to 1.3.2:
  - tests are included in the tarball

OBS-URL: https://build.opensuse.org/request/show/927838
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-circuitbreaker?expand=0&rev=2
2021-10-27 20:21:24 +00:00
5e4666e894 - Update to 1.3.2:
- tests are included in the tarball

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-circuitbreaker?expand=0&rev=4
2021-10-27 18:01:54 +00:00
f2831f7a6d Accepting request 927545 from devel:languages:python
Python implementation of the "Circuit Breaker" Pattern. Looks like it could be useful.

OBS-URL: https://build.opensuse.org/request/show/927545
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-circuitbreaker?expand=0&rev=1
2021-10-26 18:14:16 +00:00
3726f6bd98 - Add packaging of GitHub URL tarball and make tests running.
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-circuitbreaker?expand=0&rev=2
2021-10-26 14:08:18 +00:00
bba6d1ab7c Accepting request 927472 from home:glaubitz:branches:devel:languages:python
- Initial build
  + Version 1.3.1

OBS-URL: https://build.opensuse.org/request/show/927472
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-circuitbreaker?expand=0&rev=1
2021-10-26 13:36:35 +00:00
6 changed files with 26 additions and 76 deletions

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:747d4ced5c0797e2ab1d3e00a03b312db23e7ec65106148fc63beec25bbba50f
size 7946

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:28110761ca81a2accbd6b33186bc8c433e69b0933d85e89f280028dbb8c1dd14
size 10736

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1a4baee510f7bea3c91b194dcce7c07805fe96c4423ed5594b75af438531d084
size 10787

View File

@@ -1,3 +1,16 @@
-------------------------------------------------------------------
Tue Aug 12 02:56:56 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>
- Pass asyncio-mode to pytest.
-------------------------------------------------------------------
Mon Apr 28 14:00:11 UTC 2025 - Dirk Müller <dmueller@suse.com>
- update to 2.1.3:
* fix datetime.utcnow deprecation
* test with newer python versions
* various build cleanups
-------------------------------------------------------------------
Tue Aug 27 07:50:27 UTC 2024 - Frantisek Simorda <frantisek.simorda@suse.com>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-circuitbreaker
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2025 SUSE LLC and contributors
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
%define modname circuitbreaker
Name: python-circuitbreaker
Version: 2.0.0
Version: 2.1.3
Release: 0
Summary: Python implementation of the "Circuit Breaker" Pattern
License: BSD-3-Clause
@@ -26,11 +26,13 @@ URL: https://github.com/fabfuel/circuitbreaker
Source: https://files.pythonhosted.org/packages/source/c/%{modname}/%{modname}-%{version}.tar.gz
BuildRequires: %{python_module coverage}
BuildRequires: %{python_module flake8}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module pytest-asyncio}
BuildRequires: %{python_module pytest-cov}
BuildRequires: %{python_module pytest-mock}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Suggests: python-typing
@@ -44,18 +46,21 @@ Python implementation of the "Circuit Breaker" Pattern
%autosetup -p1 -n circuitbreaker-%{version}
%build
%python_build
%pyproject_wheel
%install
%python_install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
export PYTEST_ADDOPTS="--asyncio-mode=auto"
%pytest
%files %{python_files}
%doc README.rst
%license LICENSE.rst
%{python_sitelib}/*
%{python_sitelib}/circuitbreaker.py
%{python_sitelib}/circuitbreaker-%{version}.dist-info
%pycache_only %{python_sitelib}/__pycache__/circuitbreaker*
%changelog

View File

@@ -1,65 +0,0 @@
---
tests/test_functional.py | 5 ++++-
tests/test_unit.py | 15 +++++++--------
2 files changed, 11 insertions(+), 9 deletions(-)
--- a/tests/test_functional.py
+++ b/tests/test_functional.py
@@ -1,6 +1,9 @@
from time import sleep
-from mock.mock import patch, Mock
+try:
+ from unittest.mock import patch, Mock
+except (ImportError, ModuleNotFoundError):
+ from mock import patch, Mock
from pytest import raises
from circuitbreaker import CircuitBreaker, CircuitBreakerError, \
--- a/tests/test_unit.py
+++ b/tests/test_unit.py
@@ -1,9 +1,8 @@
try:
- from unittest.mock import Mock
-except ImportError:
- from mock import Mock
+ from unittest.mock import Mock, patch
+except (ImportError, ModuleNotFoundError):
+ from mock import Mock, patch
-from mock.mock import patch
from pytest import raises
from circuitbreaker import CircuitBreaker, CircuitBreakerError, circuit
@@ -50,7 +49,7 @@ def test_circuitbreaker_should_call_fall
func = Mock(return_value=False)
CircuitBreaker.opened = lambda self: True
-
+
cb = CircuitBreaker(name='WithFallback', fallback_function=fallback)
cb.call(func)
fallback.assert_called_once_with()
@@ -61,11 +60,11 @@ def test_circuitbreaker_should_not_call_
func = Mock(return_value=False)
CircuitBreaker.opened = lambda self: True
-
+
cb = CircuitBreaker(name='WithFallback', fallback_function=fallback)
assert cb.call(func) == fallback.return_value
assert not func.called
-
+
def mocked_function(*args, **kwargs):
pass
@@ -82,7 +81,7 @@ def test_circuitbreaker_call_fallback_fu
func_decorated('test2',test='test')
# check args and kwargs are getting correctly to fallback function
-
+
fallback.assert_called_once_with('test2', test='test')
@patch('circuitbreaker.CircuitBreaker.decorate')