Registry / web-framework / pyramid-retry

pyramid-retry

JSON →
library2.1.1pypypiunverified

An execution policy for the Pyramid web framework that supports retrying requests after certain failure exceptions. Version 2.1.1 provides integration with Pyramid's tweens to automatically retry failed requests based on configurable policies. It is maintained by the Pylons project and has a stable release cadence.

pip install pyramid-retry
INSTALL
IMPORT
SIG · PYRAMID-RETRY
P
pyramid-retry
web-frameworkpythonv2.1.1
Install
2.7s avg
Import
Disk
26MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.1.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 24.2MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.7s · import 0.000s · 25MB
26MB installed
● package 26MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

RetryablePolicy
from pyramid_retry import RetryablePolicy
retry_tween_factory
from pyramid_retry import retry_tween_factory

Minimal example configures retries with default policy.

from wsgiref.simple_server import make_server from pyramid.config import Configurator from pyramid_retry import RetryablePolicy, retry_tween_factory def hello_world(request): return {'status': 'ok'} if __name__ == '__main__': with Configurator() as config: config.add_route('home', '/') config.add_view(hello_world, route_name='home', renderer='json') # Set retry policy config.add_tween('pyramid_retry.retry_tween_factory') config.add_settings({ 'retry.max_attempts': 3, 'retry.policies': [RetryablePolicy()], }) app = config.make_wsgi_app() server = make_server('0.0.0.0', 8080, app) server.serve_forever()
Debug
Known issues
breakingpyramid_retry 2.0 removed the 'retry_max' setting. Use 'retry.max_attempts' instead.
fix
Replace 'retry_max' with 'retry.max_attempts' in your Pyramid settings.
affects: >=2.0.0
gotchaRetry policies must be added as a list to 'retry.policies'. Forgetting the list wrapper causes a configuration error.
fix
Set 'retry.policies': [RetryablePolicy()] rather than just 'retry.policies': RetryablePolicy().
affects: all
gotchaThe retry tween factory must be added after pyramid_tm if you use transaction management; ordering matters.
fix
Use config.add_tween('pyramid_retry.retry_tween_factory', under='pyramid_tm.tm_tween_factory') if pyramid_tm is active.
affects: all
Upgrade
Version history
2.1.1latest on PyPI · released Mar 21, 2020
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
Resources
pyramid-retry — pip install pyramid-retry · libregistry