I have a project containing a bunch of Python modules (.py
files) and a bunch of Jupyter Notebooks (.ipynb
files) which import things from the Python modules.
I can (assuming I've got __init__.py
files in all subfolders) type-check all the .py
files by simply running mypy .
from the root of the project. But I'd like to also be able to type-check my Jupyter Notebooks.
An ideal solution would:
.py
modules from within Jupyter Notebooks when type-checking, just like imports in .py
files,.py
files.How can I do this?
You could use nbQA and do
pip install -U nbqa
nbqa mypy your_notebook.ipynb
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With