nbQA: notebook shadow module causing mypy errors

When a package contains both notebook and a module with the same exact name, it seems like nbqa-mypy gets confused and the notebook shadows the module causing mypy errors.

Example structure:

pipelines/foo
├── __init__.py
├── bar.py
├── bar.ipynb

My config:

  - repo: https://github.com/nbQA-dev/nbQA
    rev: 0.5.9
    hooks:
      - id: nbqa-mypy
        args: ["--nbqa-ignore-cells=%%R,%%bash", "--strict", "--show-error-codes", "--pretty", "--show-error-context"]

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 17 (6 by maintainers)

Most upvoted comments

👋 @MarcoGorelli, yep, looks like 0.7.0 fixed it, thank you!

@ravwojdyla if you update to 0.6.0, I’d like to think this is fixed - please do let us know if you encounter any other issues (or if this one is still present), and thank you so much for your help!

@ravwojdyla just FYI, the --nbqa-ignore-cells will be removed in the next release (0.6.0), which’ll come out probably this weekend, see #557 - please do comment if you think this might affect you, thanks!