METADATA 4.0 KB

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