-
-
Notifications
You must be signed in to change notification settings - Fork 30.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Officially deprecate and remove abcs in importlib.abc moved to importlib.resources. #93963
Comments
Today I observed that one of the tests is still accessing |
…95217) Co-authored-by: Łukasz Langa <[email protected]>
It's 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): |
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 |
I see now in ccf94a6, Irit suppressed the DeprecationWarnings. |
Automerge-Triggered-By: GH:jaraco
…6598) Automerge-Triggered-By: GH:jaraco. (cherry picked from commit 52fe7e5) Co-authored-by: Jason R. Coombs <[email protected]>
I am confused. The documentation for The documentation for Why does it recommend to use the same deprecated class? |
Opened new issue #107352 for this. |
Removal PR: #119720 |
Co-authored-by: Jason R. Coombs <[email protected]>
…9720) Co-authored-by: Jason R. Coombs <[email protected]>
…9720) Co-authored-by: Jason R. Coombs <[email protected]>
In #90276, I grouped the functionality related to
importlib.resources
into its own package (creating clearer separation of responsibility fromimportlib.*
). That included moving some abstract base classes fromimportlib.abc
toimportlib.resources.abc
. We need to officially deprecate the presence inimportlib.abc
and then remove them in a future release.removal: gh-93963: Remove deprecated names from importlib.abc. #94528Originally posted by @jaraco in #93610 (comment)
Linked PRs
The text was updated successfully, but these errors were encountered: