METADATA 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. Metadata-Version: 2.1
  2. Name: contextlib2
  3. Version: 21.6.0
  4. Summary: Backports and enhancements for the contextlib module
  5. Home-page: http://contextlib2.readthedocs.org
  6. Author: Nick Coghlan
  7. Author-email: ncoghlan@gmail.com
  8. License: PSF License
  9. Platform: UNKNOWN
  10. Classifier: Development Status :: 5 - Production/Stable
  11. Classifier: License :: OSI Approved :: Apache Software License
  12. Classifier: License :: OSI Approved :: Python Software Foundation License
  13. Classifier: Programming Language :: Python :: 3
  14. Classifier: Programming Language :: Python :: 3.6
  15. Classifier: Programming Language :: Python :: 3.7
  16. Classifier: Programming Language :: Python :: 3.8
  17. Classifier: Programming Language :: Python :: 3.9
  18. Classifier: Programming Language :: Python :: 3.10
  19. Requires-Python: >=3.6
  20. License-File: LICENSE.txt
  21. .. image:: https://jazzband.co/static/img/badge.svg
  22. :target: https://jazzband.co/
  23. :alt: Jazzband
  24. .. image:: https://github.com/jazzband/contextlib2/workflows/Test/badge.svg
  25. :target: https://github.com/jazzband/contextlib2/actions
  26. :alt: Tests
  27. .. image:: https://codecov.io/gh/jazzband/contextlib2/branch/master/graph/badge.svg
  28. :target: https://codecov.io/gh/jazzband/contextlib2
  29. :alt: Coverage
  30. .. image:: https://readthedocs.org/projects/contextlib2/badge/?version=latest
  31. :target: https://contextlib2.readthedocs.org/
  32. :alt: Latest Docs
  33. contextlib2 is a backport of the `standard library's contextlib
  34. module <https://docs.python.org/3/library/contextlib.html>`_ to
  35. earlier Python versions.
  36. It also sometimes serves as a real world proving ground for possible future
  37. enhancements to the standard library version.
  38. Licensing
  39. ---------
  40. As a backport of Python standard library software, the implementation, test
  41. suite and other supporting files for this project are distributed under the
  42. Python Software License used for the CPython reference implementation.
  43. The one exception is the included type hints file, which comes from the
  44. ``typeshed`` project, and is hence distributed under the Apache License 2.0.
  45. Development
  46. -----------
  47. contextlib2 has no runtime dependencies, but requires ``setuptools`` and
  48. ``wheel`` at build time to generate universal wheel archives.
  49. Local testing is a matter of running::
  50. python3 -m unittest discover -t . -s test
  51. You can test against multiple versions of Python with
  52. `tox <https://tox.testrun.org/>`_::
  53. pip install tox
  54. tox
  55. Versions currently tested in both tox and GitHub Actions are:
  56. * CPython 3.6
  57. * CPython 3.7
  58. * CPython 3.8
  59. * CPython 3.9
  60. * CPython 3.10
  61. * PyPy3
  62. Updating to a new stdlib reference version
  63. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  64. As of Python 3.10, 4 files needed to be copied from the CPython reference
  65. implementation to contextlib2:
  66. * ``Doc/contextlib.rst`` -> ``docs/contextlib2.rst``
  67. * ``Lib/contextlib.py`` -> ``contextlib2/__init__.py``
  68. * ``Lib/test/test_contextlib.py`` -> ``test/test_contextlib.py``
  69. * ``Lib/test/test_contextlib_async.py`` -> ``test/test_contextlib_async.py``
  70. The corresponding version of ``contextlib2/__init__.pyi`` also needs to be
  71. retrieved from the ``typeshed`` project::
  72. wget https://raw.githubusercontent.com/python/typeshed/master/stdlib/contextlib.pyi
  73. For the 3.10 sync, the only changes needed to the test files were to import from
  74. ``contextlib2`` rather than ``contextlib``. The test directory is laid out so
  75. that the test suite's imports from ``test.support`` work the same way they do in
  76. the main CPython test suite.
  77. The following patch files are saved in the ``dev`` directory:
  78. * changes made to ``contextlib2/__init__.py`` to get it to run on the older
  79. versions (and to add back in the deprecated APIs that never graduated to
  80. the standard library version)
  81. * changes made to ``contextlib2/__init__.pyi`` to make the Python version
  82. guards unconditional (since the ``contextlib2`` API is the same on all
  83. supported versions)
  84. * changes made to ``docs/contextlib2.rst`` to use ``contextlib2`` version
  85. numbers in the version added/changed notes and to integrate the module
  86. documentation with the rest of the project documentation