From e608e9c36b395eb4948af9410d60b3b482d2109a Mon Sep 17 00:00:00 2001 From: Jacob Walls Date: Sun, 4 Aug 2024 21:03:30 -0400 Subject: [PATCH 1/2] Add additional stdlib deprecations (mostly 3.13) --- pylint/checkers/imports.py | 1 + pylint/checkers/stdlib.py | 45 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/pylint/checkers/imports.py b/pylint/checkers/imports.py index 9d103640c0..2fa212cd7a 100644 --- a/pylint/checkers/imports.py +++ b/pylint/checkers/imports.py @@ -79,6 +79,7 @@ "uu", "xdrlib", }, + (3, 13, 0): {"getopt"}, } diff --git a/pylint/checkers/stdlib.py b/pylint/checkers/stdlib.py index 9fab490b9c..530e58fd96 100644 --- a/pylint/checkers/stdlib.py +++ b/pylint/checkers/stdlib.py @@ -53,6 +53,9 @@ "bool": ((None, "x"),), "float": ((None, "x"),), }, + (3, 5, 0): { + "importlib._bootstrap_external.cache_from_source": ((1, "debug_override"),), + }, (3, 8, 0): { "asyncio.tasks.sleep": ((None, "loop"),), "asyncio.tasks.gather": ((None, "loop"),), @@ -89,6 +92,9 @@ "email.utils.localtime": ((1, "isdst"),), "shutil.rmtree": ((2, "onerror"),), }, + (3, 13, 0): { + "dis.get_instructions": ((2, "show_caches"),), + }, } DEPRECATED_DECORATORS: DeprecationDict = { @@ -99,6 +105,7 @@ "abc.abstractproperty", }, (3, 4, 0): {"importlib.util.module_for_loader"}, + (3, 13, 0): {"typing.no_type_check_decorator"}, } @@ -268,6 +275,10 @@ "unittest.TestProgram.usageExit", }, (3, 12, 0): { + "asyncio.get_child_watcher", + "asyncio.set_child_watcher", + "asyncio.AbstractEventLoopPolicy.get_child_watcher", + "asyncio.AbstractEventLoopPolicy.set_child_watcher", "builtins.bool.__invert__", "datetime.datetime.utcfromtimestamp", "datetime.datetime.utcnow", @@ -277,6 +288,20 @@ "pty.slave_open", "xml.etree.ElementTree.Element.__bool__", }, + (3, 13, 0): { + "ctypes.SetPointerType", + "pathlib.PurePath.is_reserved", + "platform.java_ver", + "pydoc.is_package", + "symtable.Class.get_methods", + "sys._enablelegacywindowsfsencoding", + "wave.Wave_read.getmark", + "wave.Wave_read.getmarkers", + "wave.Wave_read.setmark", + "wave.Wave_write.getmark", + "wave.Wave_write.getmarkers", + "wave.Wave_write.setmark", + }, }, } @@ -333,6 +358,9 @@ "typing": { "Text", }, + "urllib.parse": { + "Quoter", + }, "webbrowser": { "MacOSX", }, @@ -365,6 +393,15 @@ "Sized", }, }, + (3, 13, 0): { + "glob": { + "glob.glob0", + "glob.glob1", + }, + "http.server": { + "CGIHTTPRequestHandler", + }, + }, } @@ -375,10 +412,18 @@ (3, 12, 0): { "calendar.January", "calendar.February", + "sqlite3.version", + "sqlite3.version_info", "sys.last_traceback", "sys.last_type", "sys.last_value", }, + (3, 13, 0): { + "dis.HAVE_ARGUMENT", + "tarfile.TarFile.tarfile", + "traceback.TracebackException.exc_type", + "typing.AnyStr", + }, } From 0af34af09b2497c5ea68ad1800c3d1c0ff68d852 Mon Sep 17 00:00:00 2001 From: Jacob Walls Date: Tue, 17 Sep 2024 07:54:15 -0300 Subject: [PATCH 2/2] Remove postponed deprecation --- pylint/checkers/stdlib.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pylint/checkers/stdlib.py b/pylint/checkers/stdlib.py index 530e58fd96..ade4825725 100644 --- a/pylint/checkers/stdlib.py +++ b/pylint/checkers/stdlib.py @@ -293,7 +293,6 @@ "pathlib.PurePath.is_reserved", "platform.java_ver", "pydoc.is_package", - "symtable.Class.get_methods", "sys._enablelegacywindowsfsencoding", "wave.Wave_read.getmark", "wave.Wave_read.getmarkers",