Skip to content

Commit

Permalink
Rename arguments on _EditableFinder and _EditableNamespaceFinder
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mtreglia-gpsw committed Jul 11, 2024
1 parent 634d81d commit d6abb64
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions setuptools/command/editable_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit d6abb64

Please sign in to comment.