diff options
| author | Liguros - Gitlab CI/CD [develop] <gitlab@liguros.net> | 2025-08-09 19:00:54 +0000 |
|---|---|---|
| committer | Liguros - Gitlab CI/CD [develop] <gitlab@liguros.net> | 2025-08-09 19:00:54 +0000 |
| commit | a4b8d4937c712fb3f2c823bae14ffb7c8e08ae67 (patch) | |
| tree | 06455377eab71d276b313a408b26a9d90b7e35fb /dev-python/backoff | |
| parent | e1f32c4b7fb97dbe3418966200e1df602b23b573 (diff) | |
| download | baldeagleos-repo-a4b8d4937c712fb3f2c823bae14ffb7c8e08ae67.tar.gz baldeagleos-repo-a4b8d4937c712fb3f2c823bae14ffb7c8e08ae67.tar.xz baldeagleos-repo-a4b8d4937c712fb3f2c823bae14ffb7c8e08ae67.zip | |
Adding metadata
Diffstat (limited to 'dev-python/backoff')
| -rw-r--r-- | dev-python/backoff/Manifest | 1 | ||||
| -rw-r--r-- | dev-python/backoff/backoff-2.2.1.ebuild | 39 | ||||
| -rw-r--r-- | dev-python/backoff/files/backoff-2.2.1-pytest-asyncio-compat.patch | 85 | ||||
| -rw-r--r-- | dev-python/backoff/metadata.xml | 11 |
4 files changed, 136 insertions, 0 deletions
diff --git a/dev-python/backoff/Manifest b/dev-python/backoff/Manifest new file mode 100644 index 000000000000..3ce60acc86ea --- /dev/null +++ b/dev-python/backoff/Manifest @@ -0,0 +1 @@ +DIST backoff-2.2.1.gh.tar.gz 20194 BLAKE2B a137ad67574b20535d5c29fad5781d0f7baaeeead23a5c8ccc3f1c48a952bf4436e75753e329861fb20bdc6fbe2b5e6d75b30d0fdca9908edfa540a593b3b353 SHA512 ed98c50d544d4ac3214b03005e5d183b0aeefd568c89769b59115ecc67ba7f7ea29a58e6ebf8488026a95ff2a1155e798782b04bebc9315c6a3682540bb38dff diff --git a/dev-python/backoff/backoff-2.2.1.ebuild b/dev-python/backoff/backoff-2.2.1.ebuild new file mode 100644 index 000000000000..c450f177d84b --- /dev/null +++ b/dev-python/backoff/backoff-2.2.1.ebuild @@ -0,0 +1,39 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=poetry +PYTHON_COMPAT=( python3_{11..14} ) + +inherit distutils-r1 + +DESCRIPTION="Function decoration for backoff and retry" +HOMEPAGE=" + https://github.com/litl/backoff/ + https://pypi.org/project/backoff/ +" +SRC_URI=" + https://github.com/litl/backoff/archive/v${PV}.tar.gz + -> ${P}.gh.tar.gz +" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64" + +DOCS=( README.rst ) + +BDEPEND=" + test? ( + dev-python/requests[${PYTHON_USEDEP}] + dev-python/responses[${PYTHON_USEDEP}] + ) +" + +PATCHES=( + "${FILESDIR}/${P}-pytest-asyncio-compat.patch" +) + +EPYTEST_PLUGINS=( pytest-asyncio ) +distutils_enable_tests pytest diff --git a/dev-python/backoff/files/backoff-2.2.1-pytest-asyncio-compat.patch b/dev-python/backoff/files/backoff-2.2.1-pytest-asyncio-compat.patch new file mode 100644 index 000000000000..f9fae4696cca --- /dev/null +++ b/dev-python/backoff/files/backoff-2.2.1-pytest-asyncio-compat.patch @@ -0,0 +1,85 @@ +https://github.com/litl/backoff/pull/224 +Adapt test cases to pytest-asyncio 1.0 compatibility + +- Remove deprecated event_loop fixture + https://pytest-asyncio.readthedocs.io/en/stable/reference/changelog.html#removed +- Drop *_without_event_loop tests + These incompatible tests (*1) are no longer needed since the + underlying code has already been removed (introduced in a460156, + removed in 5d714ccd). + +*1: asyncio.get_event_loop() now raises a RuntimeError in Python 3.14 + when no loop exists. + https://docs.python.org/3.14/whatsnew/3.14.html#id7 +--- a/tests/test_backoff_async.py ++++ b/tests/test_backoff_async.py +@@ -665,7 +665,7 @@ async def exceptor(): + + + @pytest.mark.asyncio +-async def test_on_exception_coro_cancelling(event_loop): ++async def test_on_exception_coro_cancelling(): + sleep_started_event = asyncio.Event() + + @backoff.on_predicate(backoff.expo) +@@ -679,59 +679,10 @@ async def coro(): + + return False + +- task = event_loop.create_task(coro()) ++ task = asyncio.create_task(coro()) + + await sleep_started_event.wait() + + task.cancel() + + assert (await task) +- +- +-def test_on_predicate_on_regular_function_without_event_loop(monkeypatch): +- monkeypatch.setattr('time.sleep', lambda x: None) +- +- # Set default event loop to None. +- loop = asyncio.get_event_loop() +- asyncio.set_event_loop(None) +- +- try: +- @backoff.on_predicate(backoff.expo) +- def return_true(log, n): +- val = (len(log) == n - 1) +- log.append(val) +- return val +- +- log = [] +- ret = return_true(log, 3) +- assert ret is True +- assert 3 == len(log) +- +- finally: +- # Restore event loop. +- asyncio.set_event_loop(loop) +- +- +-def test_on_exception_on_regular_function_without_event_loop(monkeypatch): +- monkeypatch.setattr('time.sleep', lambda x: None) +- +- # Set default event loop to None. +- loop = asyncio.get_event_loop() +- asyncio.set_event_loop(None) +- +- try: +- @backoff.on_exception(backoff.expo, KeyError) +- def keyerror_then_true(log, n): +- if len(log) == n: +- return True +- e = KeyError() +- log.append(e) +- raise e +- +- log = [] +- assert keyerror_then_true(log, 3) is True +- assert 3 == len(log) +- +- finally: +- # Restore event loop. +- asyncio.set_event_loop(loop) diff --git a/dev-python/backoff/metadata.xml b/dev-python/backoff/metadata.xml new file mode 100644 index 000000000000..b6bec3f8330e --- /dev/null +++ b/dev-python/backoff/metadata.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://liguros.gitlab.io/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>pastalian46@gmail.com</email> + <name>Takuya Wakazono</name> + </maintainer> + + <origin>gentoo-guru-overlay</origin> + <stabilize-allarches/> +</pkgmetadata>
\ No newline at end of file |
