Skip to content

Moved mypy to use local hook to unsilence it on missing dependencies #1055

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

Merged
merged 3 commits into from
Aug 11, 2025

Conversation

jamesbraza
Copy link
Collaborator

@jamesbraza jamesbraza commented Aug 9, 2025

Originally this PR added missing dependencies to pre-commit's mypy and removed the --ignore-missing-imports to unsilence this error for the future.

Then I hit errors like the below in this CI run:

src/paperqa/agents/__init__.py:16:1: error: Cannot find implementation or
library stub for module named "paperqa.version"  [import-not-found]
    from paperqa.version import __version__
    ^
src/paperqa/__init__.py:25:1: error: Cannot find implementation or library stub
for module named "paperqa.version"  [import-not-found]
    from paperqa.version import __version__
    ^

And this made me realize we just needed a local hook. So this PR then moved us to use local `mypy.

@jamesbraza jamesbraza self-assigned this Aug 9, 2025
@Copilot Copilot AI review requested due to automatic review settings August 9, 2025 03:11
@jamesbraza jamesbraza added the bug Something isn't working label Aug 9, 2025
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Aug 9, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR improves the mypy type checking configuration in pre-commit by adding missing dependencies and removing the flag that silences import errors. This change ensures more comprehensive static type checking by making all necessary dependencies available to mypy and allowing it to report missing import issues.

  • Removed --ignore-missing-imports flag to enable detection of missing imports
  • Added --scripts-are-modules flag for better script handling
  • Added four missing dependencies: PyPDF, pytest, pytest-asyncio, and pytest-subtests

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Aug 11, 2025
@jamesbraza jamesbraza changed the title Added missing dependencies to pre-commit's mypy Moved mypy to use local hook to unsilence it on missing dependencies Aug 11, 2025
@jamesbraza jamesbraza merged commit 72b7f26 into main Aug 11, 2025
5 checks passed
@jamesbraza jamesbraza deleted the unsilencing-mypy branch August 11, 2025 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants