internal/tools/: jaraco-context-5.3.0 metadata and description

Homepage Simple index

Useful decorators and context managers

author Jason R. Coombs
author_email jaraco@jaraco.com
classifiers
  • Development Status :: 5 - Production/Stable
  • Intended Audience :: Developers
  • License :: OSI Approved :: MIT License
  • Programming Language :: Python :: 3
  • Programming Language :: Python :: 3 :: Only
provides_extras docs
requires_dist
  • backports.tarfile; python_version < "3.12"
  • pytest!=8.1.1,>=6; extra == "testing"
  • pytest-checkdocs>=2.4; extra == "testing"
  • pytest-cov; extra == "testing"
  • pytest-mypy; extra == "testing"
  • pytest-enabler>=2.2; extra == "testing"
  • pytest-ruff>=0.2.1; extra == "testing"
  • portend; extra == "testing"
  • sphinx>=3.5; extra == "docs"
  • jaraco.packaging>=9.3; extra == "docs"
  • rst.linker>=1.9; extra == "docs"
  • furo; extra == "docs"
  • sphinx-lint; extra == "docs"
  • jaraco.tidelift>=1.4; extra == "docs"
requires_python >=3.8
File Tox results History
jaraco.context-5.3.0-py3-none-any.whl
Size
6 KB
Type
Python Wheel
Python
3
jaraco.context-5.3.0.tar.gz
Size
13 KB
Type
Source
https://img.shields.io/pypi/v/jaraco.context.svg https://img.shields.io/pypi/pyversions/jaraco.context.svg tests Ruff https://readthedocs.org/projects/jaracocontext/badge/?version=latest https://img.shields.io/badge/skeleton-2024-informational https://tidelift.com/badges/package/pypi/jaraco.context

Highlights

See the docs linked from the badge above for the full details, but here are some features that may be of interest.

  • ExceptionTrap provides a general-purpose wrapper for trapping exceptions and then acting on the outcome. Includes passes and raises decorators to replace the result of a wrapped function by a boolean indicating the outcome of the exception trap. See this keyring commit for an example of it in production.

  • suppress simply enables contextlib.suppress as a decorator.

  • on_interrupt is a decorator used by CLI entry points to affect the handling of a KeyboardInterrupt. Inspired by Lucretiel/autocommand#18.

  • pushd is similar to pytest’s monkeypatch.chdir or path’s default context, changes the current working directory for the duration of the context.

  • tarball will download a tarball, extract it, change directory, yield, then clean up after. Convenient when working with web assets.

  • null is there for those times when one code branch needs a context and the other doesn’t; this null context provides symmetry across those branches.

For Enterprise

Available as part of the Tidelift Subscription.

This project and the maintainers of thousands of other packages are working with Tidelift to deliver one enterprise subscription that covers all of the open source you use.

Learn more.