[+] fix mypy errors

This commit is contained in:
Siarhei Siniak 2024-12-22 19:18:06 +03:00
parent 48ef23aa88
commit adc3fd0205
4 changed files with 21 additions and 12 deletions

@ -6,6 +6,10 @@ mypy_path =
mypy-stubs/types-debugpy,
python
exclude =
python/tmp,
python/build
plugins =
numpy.typing.mypy_plugin,
pydantic.mypy

@ -173,8 +173,10 @@ def mypy(argv: list[str]) -> None:
settings=_mypy.MypySettings(
paths=[
#Settings.settings().project_root / 'dotfiles/.local/bin/commands',
Settings.settings().project_root / 'python',
Settings.settings().project_root / 'deps/com.github.aiortc.aiortc/src',
Settings.settings().project_root / 'python' / 'm.py',
Settings.settings().project_root / 'python' / '_m.py',
Settings.settings().project_root / 'python' / 'online',
# Settings.settings().project_root / 'deps/com.github.aiortc.aiortc/src',
#Settings.settings().project_root / 'm.py',
],
max_errors={

@ -58,12 +58,12 @@ class CLI(abc.ABC):
self,
force: bool,
) -> None:
for k, o in self.dependencies.items():
whl_glob = self.dist_settings.wheel_dir / ('*%s*.whl' % o.name.replace('.', '_'))
for k, d in self.dependencies.items():
whl_glob = self.dist_settings.wheel_dir / ('*%s*.whl' % d.name.replace('.', '_'))
if len(glob.glob(
str(whl_glob)
)) == 0 or force:
if o.source_path.exists():
if d.source_path.exists():
def whl_files_get() -> list[dict[str, Any]]:
return [
dict(
@ -77,17 +77,18 @@ class CLI(abc.ABC):
present_files = whl_files_get()
if o.mode == 'm':
if (o.source_path / 'm.py').exists():
if d.mode == 'm':
if (d.source_path / 'm.py').exists():
cmd = [
sys.executable,
o.source_path / 'm.py',
str(d.source_path / 'm.py'),
'deploy:wheel',
'-o', self.settings.wheel_dir,
'-o',
str(self.dist_settings.wheel_dir),
]
if not o.args is None:
cmd.extend(o.args)
if not d.args is None:
cmd.extend(d.args)
subprocess.check_call(cmd)
else:

@ -104,7 +104,9 @@ def run() -> None:
str(bootstrap_settings.python_path),
[
str(bootstrap_settings.python_path),
pathlib.Path(__file__).parent / 'cli.py',
str(
pathlib.Path(__file__).parent / 'cli.py'
),
*sys.argv[1:],
]
)