jaraco.context


توضیحات

Useful decorators and context managers
ویژگی مقدار
سیستم عامل -
نام فایل jaraco.context-6.1.2
نام jaraco.context
نسخه کتابخانه 6.1.2
نگهدارنده []
ایمیل نگهدارنده []
نویسنده -
ایمیل نویسنده "Jason R. Coombs" <jaraco@jaraco.com>
آدرس صفحه اصلی -
آدرس اینترنتی https://pypi.org/project/jaraco.context/
مجوز -
.. image:: https://img.shields.io/pypi/v/jaraco.context.svg :target: https://pypi.org/project/jaraco.context .. image:: https://img.shields.io/pypi/pyversions/jaraco.context.svg .. image:: https://github.com/jaraco/jaraco.context/actions/workflows/main.yml/badge.svg :target: https://github.com/jaraco/jaraco.context/actions?query=workflow%3A%22tests%22 :alt: tests .. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json :target: https://github.com/astral-sh/ruff :alt: Ruff .. image:: https://readthedocs.org/projects/jaracocontext/badge/?version=latest :target: https://jaracocontext.readthedocs.io/en/latest/?badge=latest .. image:: https://img.shields.io/badge/skeleton-2025-informational :target: https://blog.jaraco.com/skeleton .. image:: https://tidelift.com/badges/package/pypi/jaraco.context :target: https://tidelift.com/subscription/pkg/pypi-jaraco.context?utm_source=pypi-jaraco.context&utm_medium=readme 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 <https://github.com/jaraco/keyring/commit/a85a7cbc6c909f8121660ed1f7b487f99a1c2bf7>`_ 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 <https://github.com/Lucretiel/autocommand/issues/18>`_. - ``pushd`` is similar to pytest's ``monkeypatch.chdir`` or path's `default context <https://path.readthedocs.io/en/latest/api.html>`_, 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 <https://tidelift.com/subscription/pkg/pypi-jaraco.context?utm_source=pypi-jaraco.context&utm_medium=referral&utm_campaign=github>`_.


نیازمندی

مقدار نام
ython_versio backports.tarfile;
xtr pytest!=8.1.*,>=6;
xtr jaraco.test>=5.6.0;
xtr portend;
xtr sphinx>=3.5;
xtr jaraco.packaging>=9.3;
xtr rst.linker>=1.9;
xtr furo;
xtr sphinx-lint;
xtr jaraco.tidelift>=1.4;
xtr pytest-checkdocs>=2.14;
ys_platfor pytest-ruff>=0.2.1;
xtr pytest-cov;
xtr pytest-enabler>=3.4;
latform_python_implementatio pytest-mypy>=1.0.1;


زبان مورد نیاز

مقدار نام
>=3.10 Python


نحوه نصب


نصب پکیج whl jaraco.context-6.1.2:

    pip install jaraco.context.whl


نصب پکیج tar.gz jaraco.context-6.1.2:

    pip install jaraco.context.tar.gz