GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Officially deprecate and remove abcs in importlib.abc moved to importlib.resources. · Issue #93963 · python/cpython

Officially deprecate and remove abcs in importlib.abc moved to importlib.resources. #93963

New issue
Copy link
New issue
Copy link
Closed
#93965
Closed
Officially deprecate and remove abcs in importlib.abc moved to importlib.resources.#93963
#93965
Copy link

Description

@jaraco
jaraco
opened on Jun 17, 2022
Issue body actions

In #90276, I grouped the functionality related to importlib.resources into its own package (creating clearer separation of responsibility from importlib.*). That included moving some abstract base classes from importlib.abc to importlib.resources.abc. We need to officially deprecate the presence in importlib.abc and then remove them in a future release.

  • deprecation: gh-93963: Officially deprecate abcs and warn about their usage. #93965
  • documentation: gh-93963: Document importlib.abc deprecations #94546
  • cleanup: gh-93963: Remove usage of deprecated interface from importlib.abc. #95217, gh-93963: Remove ResourceReaderDefaultsTests #96598
  • removal: gh-93963: Remove deprecated names from importlib.abc. #94528
  • removal: gh-93963: Remove deprecated names from importlib.abc #119720

Originally posted by @jaraco in #93610 (comment)

Linked PRs

  • gh-93963: Remove deprecated names from importlib.abc #119720

Activity

  1. jaraco commented on Jun 17, 2022

    @jaraco
    jaraco
    on Jun 17, 2022
    MemberAuthor
    More actions

    @encukou Here's the deprecation that officially announces the intention added in #90276. I know you were working on the doc updates. Let me know if I can help with that, especially with regard to this direction.

  2. jaraco
    added a commit that references this issue on Jul 3, 2022

    Use 'warnings._deprecated'. Fixes #93963 until Python π.

    This issue will close once commit 8525926 is merged into the 'main' branch.
    8525926
  3. jaraco
    changed the title [-]Officially deprecate abcs in importlib.abc moved to importlib.resources.[/-] [+]Officially deprecate and remove abcs in importlib.abc moved to importlib.resources.[/+] on Jul 3, 2022
  4. jaraco
    added 2 commits that reference this issue on Jul 3, 2022

    gh-93963: Remove deprecated names from importlib.abc

    3574e94

    gh-93963: Remove deprecated names from importlib.abc

    96f14c2
  5. miss-islington
    closed this as completedin #93965on Jul 3, 2022
  6. miss-islington
    added a commit that references this issue on Jul 3, 2022

    gh-93963: Officially deprecate abcs and warn about their usage. (GH-9…

    71848c9
  7. hugovk
    added a commit that references this issue on Jul 4, 2022

    pythongh-93963: Document importlib.abc deprecations

    f171aa2
  8. jaraco
    added a commit that references this issue on Jul 9, 2022

    Merge branch 'main' into gh-93963/remove-importlib-resources-abcs

    691a82a
  9. jaraco commented on Jul 24, 2022

    @jaraco
    jaraco
    on Jul 24, 2022
    MemberAuthor
    More actions

    Today I observed that one of the tests is still accessing ResourceReader from importlib.abc.

  10. jaraco
    added a commit that references this issue on Jul 24, 2022

    gh-93963: Remove usage of deprecated interface from importlib.abc.

    7e1fc0f
  11. ambv
    added 2 commits that reference this issue on Jul 25, 2022

    gh-93963: Document importlib.abc deprecations (#94546)

    10b12dd

    Merge remote-tracking branch 'upstream/main' into gh-93963/importlib-…

    ea0cbd9
  12. jaraco
    added 2 commits that reference this issue on Jul 27, 2022

    gh-93963: Remove usage of deprecated interface from importlib.abc. (#…

    78eb3f7

    Merge branch 'main' into gh-93963/remove-importlib-resources-abcs

    9cb1fc4
  13. tirkarthi commented on Jul 31, 2022

    @tirkarthi
    tirkarthi
    on Jul 31, 2022
    Member
    More actions

    It's ResourceReader being passed to make_abc_subclasses that tries to retrieve abc.ResourceReader triggering a DeprecationWarning. Below is an approach where default refers to abc module and ResourceReaderDefaultsTests overrides it with resources.

    diff --git a/Lib/test/test_importlib/test_abc.py b/Lib/test/test_importlib/test_abc.py
    index d59b663a43..66c8bf09cf 100644
    --- a/Lib/test/test_importlib/test_abc.py
    +++ b/Lib/test/test_importlib/test_abc.py
    @@ -13,6 +13,7 @@
     init = test_util.import_importlib('importlib')
     abc = test_util.import_importlib('importlib.abc')
     machinery = test_util.import_importlib('importlib.machinery')
    +resources = test_util.import_importlib('importlib.resources')
     util = test_util.import_importlib('importlib.util')
     
     
    @@ -125,7 +126,7 @@ class SourceLoader(InheritanceTests):
     
     ##### Default return values ####################################################
     
    -def make_abc_subclasses(base_class, name=None, inst=False, **kwargs):
    +def make_abc_subclasses(base_class, name=None, inst=False, abc=abc, **kwargs):
         if name is None:
             name = base_class.__name__
         base = {kind: getattr(splitabc, name)
    @@ -324,7 +325,7 @@ def contents(self, *args, **kwargs):
     
     class ResourceReaderDefaultsTests(ABCTestHarness):
     
    -    SPLIT = make_abc_subclasses(ResourceReader)
    +    SPLIT = make_abc_subclasses(ResourceReader, abc=resources)
     
         def test_open_resource(self):
             with self.assertRaises(FileNotFoundError):
  14. jaraco commented on Sep 5, 2022

    @jaraco
    jaraco
    on Sep 5, 2022
    MemberAuthor
    More actions

    Oh, I'd missed test_abc. I think I'd like to just remove that test... or if it needs to exist, it should exist in importlib_resources also.

  15. jaraco commented on Sep 5, 2022

    @jaraco
    jaraco
    on Sep 5, 2022
    MemberAuthor
    More actions

    I see now in ccf94a6, Irit suppressed the DeprecationWarnings.

  16. miss-islington
    added a commit that references this issue on Sep 5, 2022

    gh-93963: Remove ResourceReaderDefaultsTests (GH-96598)

    52fe7e5
  17. jaraco
    added a commit that references this issue on Sep 5, 2022

    [3.11] pythongh-93963: Remove ResourceReaderDefaultsTests (pythonGH-9…

    04644c1
  18. serhiy-storchaka commented on Jul 27, 2023

    @serhiy-storchaka
    serhiy-storchaka
    on Jul 27, 2023
    Member
    More actions

    I am confused.

    The documentation for importlib.resources.abc.Traversable says: "Deprecated since version 3.12, will be removed in version 3.14: Use importlib.resources.abc.Traversable instead."

    The documentation for importlib.resources.abc.TraversableResources says: "Deprecated since version 3.12, will be removed in version 3.14: Use importlib.resources.abc.TraversableResources instead."

    Why does it recommend to use the same deprecated class?

  19. serhiy-storchaka commented on Jul 27, 2023

    @serhiy-storchaka
    serhiy-storchaka
    on Jul 27, 2023
    Member
    More actions

    Opened new issue #107352 for this.

    Reacted by Hugo van Kemenade
  20. hugovk commented on May 29, 2024

    @hugovk
    hugovk
    on May 29, 2024
    Member
    More actions

    Removal PR: #119720

  21. hugovk
    added a commit that references this issue on May 29, 2024

    gh-93963: Remove deprecated names from importlib.abc (#119720)

    0751511
  22. estyxx
    added a commit that references this issue on Jul 17, 2024

    pythongh-93963: Remove deprecated names from importlib.abc (python#11…

    1f07c07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.