You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2022-01-01.19:16:30.847>created_at=<Date2021-12-17.20:54:28.125>labels= ['3.11']
title='Migrate importlib.resources into a package'updated_at=<Date2022-01-01.19:16:30.847>user='https://github.com/jaraco'
The importlib.resources module has several modules on which it relies (_adapters, _legacy, simple) and some classes in other modules shared by other parts of importlib (namely abc).
Because these implementations overlap, it adds difficulty in maintaining the importlib_resources backport, which must maintain these modules but keep them separate from the unrelated functionality in other parts of importlib.
In an earlier refactoring, importlib.metadata was refactored into its own package (#25565). This refactoring had benefits of making it clearer which functionality of importlib was related to metadata and which was not.
importlib.readers and importlib.simple are public, so probably need aliases.
Same abc classes.
Should we embark on an effort to migrate users to the new names in importlib.resources, or simply leave the importlib.{mod} names as preferred? My instinct is to do the former, mainly because then the names would be congruent between importlib.resources and importlib_resources. But I'm also reluctant to introduce a deprecation (even deferred) comparable to what happened with collections.abc.
I recently noticed that some docs already refer to importlib.resources.abc even though it doesn't currently exist (https://github.com/python/cpython/blame/main/Doc/library/importlib.rst#L948). That finding leads me to adjust my expectation that perhaps exposing those classes from that module would be preferable (since that was the expectation from the start).
Activity
jaraco commentedon Dec 17, 2021
The importlib.resources module has several modules on which it relies (_adapters, _legacy, simple) and some classes in other modules shared by other parts of importlib (namely abc).
Because these implementations overlap, it adds difficulty in maintaining the
importlib_resourcesbackport, which must maintain these modules but keep them separate from the unrelated functionality in other parts of importlib.In an earlier refactoring,
importlib.metadatawas refactored into its own package (#25565). This refactoring had benefits of making it clearer which functionality of importlib was related to metadata and which was not.I'd like to do the same for importlib.resources.
The main complicate
jaraco commentedon Dec 17, 2021
Compatibility considerations:
Should we embark on an effort to migrate users to the new names in
importlib.resources, or simply leave theimportlib.{mod}names as preferred? My instinct is to do the former, mainly because then the names would be congruent betweenimportlib.resourcesandimportlib_resources. But I'm also reluctant to introduce a deprecation (even deferred) comparable to what happened withcollections.abc.jaraco commentedon Dec 19, 2021
I recently noticed that some docs already refer to
importlib.resources.abceven though it doesn't currently exist (https://github.com/python/cpython/blame/main/Doc/library/importlib.rst#L948). That finding leads me to adjust my expectation that perhaps exposing those classes from that module would be preferable (since that was the expectation from the start).jaraco commentedon Dec 31, 2021
New changeset e712a5b by Jason R. Coombs in branch 'main':
bpo-46118: Move importlib.resources to its own package. (bpo-30176)
e712a5b
jaraco commentedon Dec 31, 2021
Installed buildbots are failing (like this one: https://buildbot.python.org/all/#/builders/350/builds/1164). I'm going to see if it's a simple fix like updating the makefile or if a rollback is called for.
jaraco commentedon Dec 31, 2021
Looks like I encountered the same foot gun when originally introducing the importlib.metadata package (bpo-34632).
jaraco commentedon Dec 31, 2021
And the underlying cause is reported in bpo-37043.
jaraco commentedon Dec 31, 2021
New changeset 35628e4 by Jason R. Coombs in branch 'main':
bpo-46118: Make sure importlib.resources is included. (GH-30311)
35628e4