mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-13 22:24:45 +00:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
72ad6dc953
commit
f4cd1ba0d6
813 changed files with 66015 additions and 58839 deletions
|
|
@ -1,5 +1,6 @@
|
|||
"""Provides a function to report all internal modules for using freezing
|
||||
tools."""
|
||||
from __future__ import annotations
|
||||
|
||||
import types
|
||||
from typing import Iterator
|
||||
|
|
@ -7,7 +8,7 @@ from typing import List
|
|||
from typing import Union
|
||||
|
||||
|
||||
def freeze_includes() -> List[str]:
|
||||
def freeze_includes() -> list[str]:
|
||||
"""Return a list of module names used by pytest that should be
|
||||
included by cx_freeze."""
|
||||
import _pytest
|
||||
|
|
@ -17,8 +18,8 @@ def freeze_includes() -> List[str]:
|
|||
|
||||
|
||||
def _iter_all_modules(
|
||||
package: Union[str, types.ModuleType],
|
||||
prefix: str = "",
|
||||
package: str | types.ModuleType,
|
||||
prefix: str = '',
|
||||
) -> Iterator[str]:
|
||||
"""Iterate over the names of all modules that can be found in the given
|
||||
package, recursively.
|
||||
|
|
@ -36,10 +37,10 @@ def _iter_all_modules(
|
|||
# Type ignored because typeshed doesn't define ModuleType.__path__
|
||||
# (only defined on packages).
|
||||
package_path = package.__path__ # type: ignore[attr-defined]
|
||||
path, prefix = package_path[0], package.__name__ + "."
|
||||
path, prefix = package_path[0], package.__name__ + '.'
|
||||
for _, name, is_package in pkgutil.iter_modules([path]):
|
||||
if is_package:
|
||||
for m in _iter_all_modules(os.path.join(path, name), prefix=name + "."):
|
||||
for m in _iter_all_modules(os.path.join(path, name), prefix=name + '.'):
|
||||
yield prefix + m
|
||||
else:
|
||||
yield prefix + name
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue