Skip to content

Commit

Permalink
gh-93963: Document importlib.abc deprecations (#94546)
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Jul 25, 2022
1 parent ccd7c7a commit 10b12dd
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Doc/library/importlib.resources.abc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@

.. versionadded:: 3.7

.. deprecated-removed:: 3.12 3.14

This comment has been minimized.

Copy link
@jaraco

jaraco Jul 27, 2022

Member

To my understanding, the ResourceReader class is not deprecated and not slated for removal.

Use :class:`importlib.resources.abc.TraversableResources` instead.

.. abstractmethod:: open_resource(resource)

Returns an opened, :term:`file-like object` for binary reading
Expand Down Expand Up @@ -91,6 +94,9 @@

.. versionadded:: 3.9

.. deprecated-removed:: 3.12 3.14
Use :class:`importlib.resources.abc.Traversable` instead.

This comment has been minimized.

Copy link
@jaraco

jaraco Jul 27, 2022

Member

I believe this is the doc for importlib.resources.abc, so it doesn't make sense to mark it as deprecated or removed here. Unless I don't understand what this line (and TraversableResources) is attempting to communicate.


.. attribute:: name

Abstract. The base name of this object without any parent references.
Expand Down Expand Up @@ -146,6 +152,9 @@

.. versionadded:: 3.9

.. deprecated-removed:: 3.12 3.14
Use :class:`importlib.resources.abc.TraversableResources` instead.

This comment has been minimized.

Copy link
@graingert

graingert Jun 1, 2023

Contributor

This comment has been minimized.

Copy link
@hugovk

hugovk Jun 1, 2023

Author Member

Well spotted, would you like to create a PR to fix it?

This comment has been minimized.

Copy link
@graingert

graingert Jun 2, 2023

Contributor

issue opened here #105189


.. abstractmethod:: files()

Returns a :class:`importlib.resources.abc.Traversable` object for the loaded
Expand Down
18 changes: 18 additions & 0 deletions Doc/whatsnew/3.12.rst
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,24 @@ APIs:
* :func:`unittest.getTestCaseNames` (:gh:`50096`)
* :class:`webbrowser.MacOSX` (:gh:`86421`)

Pending Removal in Python 3.14
==============================

* Deprecated the following :mod:`importlib.abc` classes, scheduled for removal in
Python 3.14:

* :class:`importlib.abc.ResourceReader`
* :class:`importlib.abc.Traversable`
* :class:`importlib.abc.TraversableResources`

Use :mod:`importlib.resources.abc` classes instead:

* :class:`importlib.resources.abc.TraversableResources`
* :class:`importlib.resources.abc.Traversable`
* :class:`importlib.resources.abc.TraversableResources`

(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)

Pending Removal in Future Versions
----------------------------------

Expand Down

0 comments on commit 10b12dd

Please sign in to comment.