METADATA 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. Metadata-Version: 2.4
  2. Name: jaraco.context
  3. Version: 6.1.0
  4. Summary: Useful decorators and context managers
  5. Author-email: "Jason R. Coombs" <jaraco@jaraco.com>
  6. License-Expression: MIT
  7. Project-URL: Source, https://github.com/jaraco/jaraco.context
  8. Classifier: Development Status :: 5 - Production/Stable
  9. Classifier: Intended Audience :: Developers
  10. Classifier: Programming Language :: Python :: 3
  11. Classifier: Programming Language :: Python :: 3 :: Only
  12. Requires-Python: >=3.9
  13. Description-Content-Type: text/x-rst
  14. License-File: LICENSE
  15. Requires-Dist: backports.tarfile; python_version < "3.12"
  16. Provides-Extra: test
  17. Requires-Dist: pytest!=8.1.*,>=6; extra == "test"
  18. Requires-Dist: jaraco.test>=5.6.0; extra == "test"
  19. Requires-Dist: portend; extra == "test"
  20. Provides-Extra: doc
  21. Requires-Dist: sphinx>=3.5; extra == "doc"
  22. Requires-Dist: jaraco.packaging>=9.3; extra == "doc"
  23. Requires-Dist: rst.linker>=1.9; extra == "doc"
  24. Requires-Dist: furo; extra == "doc"
  25. Requires-Dist: sphinx-lint; extra == "doc"
  26. Requires-Dist: jaraco.tidelift>=1.4; extra == "doc"
  27. Provides-Extra: check
  28. Requires-Dist: pytest-checkdocs>=2.4; extra == "check"
  29. Requires-Dist: pytest-ruff>=0.2.1; sys_platform != "cygwin" and extra == "check"
  30. Provides-Extra: cover
  31. Requires-Dist: pytest-cov; extra == "cover"
  32. Provides-Extra: enabler
  33. Requires-Dist: pytest-enabler>=3.4; extra == "enabler"
  34. Provides-Extra: type
  35. Requires-Dist: pytest-mypy>=1.0.1; extra == "type"
  36. Requires-Dist: mypy<1.19; platform_python_implementation == "PyPy" and extra == "type"
  37. Dynamic: license-file
  38. .. image:: https://img.shields.io/pypi/v/jaraco.context.svg
  39. :target: https://pypi.org/project/jaraco.context
  40. .. image:: https://img.shields.io/pypi/pyversions/jaraco.context.svg
  41. .. image:: https://github.com/jaraco/jaraco.context/actions/workflows/main.yml/badge.svg
  42. :target: https://github.com/jaraco/jaraco.context/actions?query=workflow%3A%22tests%22
  43. :alt: tests
  44. .. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
  45. :target: https://github.com/astral-sh/ruff
  46. :alt: Ruff
  47. .. image:: https://readthedocs.org/projects/jaracocontext/badge/?version=latest
  48. :target: https://jaracocontext.readthedocs.io/en/latest/?badge=latest
  49. .. image:: https://img.shields.io/badge/skeleton-2025-informational
  50. :target: https://blog.jaraco.com/skeleton
  51. .. image:: https://tidelift.com/badges/package/pypi/jaraco.context
  52. :target: https://tidelift.com/subscription/pkg/pypi-jaraco.context?utm_source=pypi-jaraco.context&utm_medium=readme
  53. Highlights
  54. ==========
  55. See the docs linked from the badge above for the full details, but here are some features that may be of interest.
  56. - ``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.
  57. - ``suppress`` simply enables ``contextlib.suppress`` as a decorator.
  58. - ``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>`_.
  59. - ``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.
  60. - ``tarball`` will download a tarball, extract it, change directory, yield, then clean up after. Convenient when working with web assets.
  61. - ``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.
  62. For Enterprise
  63. ==============
  64. Available as part of the Tidelift Subscription.
  65. 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.
  66. `Learn more <https://tidelift.com/subscription/pkg/pypi-jaraco.context?utm_source=pypi-jaraco.context&utm_medium=referral&utm_campaign=github>`_.