Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/pyroute2/dhcp/ mypy check fails #1291

Closed
svinota opened this issue Feb 18, 2025 · 1 comment · Fixed by #1300
Closed

/pyroute2/dhcp/ mypy check fails #1291

svinota opened this issue Feb 18, 2025 · 1 comment · Fixed by #1300
Assignees

Comments

@svinota
Copy link
Owner

svinota commented Feb 18, 2025

Both on python3.9 and python3.14, but with different errors:

(branch p4-core-typization if not merged in the master yet):

$ make nox session=linter-python3.9
{ which nox 2>/dev/null || { test -d ~/.venv-boot && { . ~/.venv-boot/bin/activate; } || { /usr/bin/python3.14 -m venv ~/.venv-boot; . ~/.venv-boot/bin/activate; pip install --upgrade pip; pip install nox; }; }; nox -e linter-python3.9 -- ''; }
nox > Running session linter-python3.9
nox > Creating virtual environment (virtualenv) using python3.9 in ./.nox-peet/linter-python3-9
nox > python -m pip install pre-commit
nox > python -m pip install mypy
nox > pre-commit run -a
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
isort (python)...........................................................Passed
black....................................................................Passed
flake8...................................................................Passed
nox > python -m mypy pyroute2/common.py pyroute2/dhcp pyroute2/fixtures pyroute2/netlink/core.py pyroute2/netlink/nlsocket.py pyroute2/plan9/client.py
pyroute2/dhcp/hooks.py:107: error: Argument 1 to "hook" has incompatible type "auto"; expected "Trigger"  [arg-type]
pyroute2/dhcp/hooks.py:132: error: Argument 1 to "hook" has incompatible type "auto"; expected "Trigger"  [arg-type]
pyroute2/dhcp/hooks.py:132: error: Argument 2 to "hook" has incompatible type "auto"; expected "Trigger"  [arg-type]
pyroute2/dhcp/hooks.py:147: error: Argument 1 to "hook" has incompatible type "auto"; expected "Trigger"  [arg-type]
pyroute2/dhcp/hooks.py:168: error: Argument 1 to "hook" has incompatible type "auto"; expected "Trigger"  [arg-type]
pyroute2/dhcp/hooks.py:168: error: Argument 2 to "hook" has incompatible type "auto"; expected "Trigger"  [arg-type]
pyroute2/dhcp/client.py:151: error: X | Y syntax for unions requires Python 3.10  [syntax]
pyroute2/dhcp/client.py:308: error: Argument 1 to "_run_hooks" of "AsyncDHCPClient" has incompatible type "auto"; expected "Trigger"  [arg-type]
pyroute2/dhcp/client.py:473: error: Argument 1 to "_run_hooks" of "AsyncDHCPClient" has incompatible type "auto"; expected "Trigger"  [arg-type]
pyroute2/dhcp/client.py:545: error: Argument 1 to "_run_hooks" of "AsyncDHCPClient" has incompatible type "auto"; expected "Trigger"  [arg-type]
pyroute2/dhcp/client.py:648: error: Argument 1 to "create_task" has incompatible type "Awaitable[None]"; expected "Union[Generator[Any, None, Never], Coroutine[Any, Any, Never]]"  [arg-type]
Found 11 errors in 2 files (checked 24 source files)
nox > Command python -m mypy pyroute2/common.py pyroute2/dhcp pyroute2/fixtures pyroute2/netlink/core.py pyroute2/netlink/nlsocket.py pyroute2/plan9/client.py failed with exit code 1
nox > Session linter-python3.9 failed.
make: *** [Makefile:140: nox] Error 1

and

$ make nox session=linter-python3.14
{ which nox 2>/dev/null || { test -d ~/.venv-boot && { . ~/.venv-boot/bin/activate; } || { /usr/bin/python3.14 -m venv ~/.venv-boot; . ~/.venv-boot/bin/activate; pip install --upgrade pip; pip install nox; }; }; nox -e linter-python3.14 -- ''; }
nox > Running session linter-python3.14
nox > Creating virtual environment (virtualenv) using python3.14 in ./.nox-peet/linter-python3-14
nox > python -m pip install pre-commit
nox > python -m pip install mypy
nox > pre-commit run -a
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
isort (python)...........................................................Passed
black....................................................................Passed
flake8...................................................................Passed
nox > python -m mypy pyroute2/common.py pyroute2/dhcp pyroute2/fixtures pyroute2/netlink/core.py pyroute2/netlink/nlsocket.py pyroute2/plan9/client.py
pyroute2/dhcp/client.py:648: error: Argument 1 to "create_task" has incompatible type "Awaitable[None]"; expected "Coroutine[Any, Any, Never]"  [arg-type]
Found 1 error in 1 file (checked 24 source files)
nox > Command python -m mypy pyroute2/common.py pyroute2/dhcp pyroute2/fixtures pyroute2/netlink/core.py pyroute2/netlink/nlsocket.py pyroute2/plan9/client.py failed with exit code 1
nox > Session linter-python3.14 failed.
make: *** [Makefile:140: nox] Error 1
@etene
Copy link
Collaborator

etene commented Feb 19, 2025

Will do !

@etene etene linked a pull request Feb 25, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants