From d6abb6409b881ad13e232a61ead5facf761ee779 Mon Sep 17 00:00:00 2001 From: Marco Treglia Date: Thu, 11 Jul 2024 17:19:30 +0200 Subject: [PATCH] Rename arguments on _EditableFinder and _EditableNamespaceFinder This commit rename the `find_spec` arguments in _EditableFinder and _EditableNamespaceFinder to be compliant of the standard `importlib.abc.MetaPathFinder` interface. https://docs.python.org/3/library/importlib.html#importlib.machinery.PathFinder.find_spec https://github.com/abravalheri/typeshed/blob/eecac02ef7fdbe82b9dc57fa3ca4bb9d341116d7/stdlib/_typeshed/importlib.pyi The `find_module` arguments were not renamed because the method `find_module` is deprecated starting from Pyhton3.10 and has been removed in Pyhton3.12 https://docs.python.org/3/reference/import.html#the-meta-path --- setuptools/command/editable_wheel.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setuptools/command/editable_wheel.py b/setuptools/command/editable_wheel.py index ae31bb4c79..d2ca2b48a6 100644 --- a/setuptools/command/editable_wheel.py +++ b/setuptools/command/editable_wheel.py @@ -805,7 +805,7 @@ def _get_root(self): class _EditableFinder: # MetaPathFinder @classmethod - def find_spec(cls, fullname: str, _path=None, _target=None) -> ModuleSpec | None: + def find_spec(cls, fullname: str, path=None, target=None) -> ModuleSpec | None: # type: ignore # Top-level packages and modules (we know these exist in the FS) if fullname in MAPPING: pkg_path = MAPPING[fullname] @@ -851,7 +851,7 @@ def _paths(cls, fullname: str) -> list[str]: return [*paths, PATH_PLACEHOLDER] @classmethod - def find_spec(cls, fullname: str, _target=None) -> ModuleSpec | None: + def find_spec(cls, fullname: str, target=None) -> ModuleSpec | None: # type: ignore if fullname in NAMESPACES: spec = ModuleSpec(fullname, None, is_package=True) spec.submodule_search_locations = cls._paths(fullname)