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

noxfile causes mypy error #985

Closed
epenet opened this issue Jul 26, 2021 · 2 comments · Fixed by #1025
Closed

noxfile causes mypy error #985

epenet opened this issue Jul 26, 2021 · 2 comments · Fixed by #1025
Labels
bug Something isn't working
Milestone

Comments

@epenet
Copy link

epenet commented Jul 26, 2021

When mypy is set to warn on unreachable code, then upgrading nox from 2020.12.31 to 2021.6.12 causes a "Statement is unreachable" error on line 47

noxfile.py: note: In function "activate_virtualenv_in_precommit_hooks":
noxfile.py:47:9: error: Statement is unreachable  [unreachable]
            return

These are the culprit lines:

This is my mypy.ini:

[mypy]
check_untyped_defs = True
disallow_any_generics = True
disallow_incomplete_defs = True
disallow_subclassing_any = True
disallow_untyped_calls = True
disallow_untyped_decorators = True
disallow_untyped_defs = True
no_implicit_optional = True
no_implicit_reexport = True
pretty = True
show_column_numbers = True
show_error_codes = True
show_error_context = True
strict_equality = True
warn_redundant_casts = True
warn_return_any = True
warn_unreachable = True
warn_unused_configs = True
warn_unused_ignores = True
@epenet
Copy link
Author

epenet commented Jul 26, 2021

I have (temporarily) added #type: ignore the line on my project: hacf-fr/renault-api#310

@cjolowicz
Copy link
Owner

Right, session.bin used to be Optional in Nox, this was fixed in wntrblm/nox#378. So the two lines should now be removed.

@cjolowicz cjolowicz added the bug Something isn't working label Jul 26, 2021
@cjolowicz cjolowicz added this to the Near-term milestone Jul 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants