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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: astral-sh/setup-uv@v6
with:
enable-cache: true
- run: echo "UV_PROJECT_ENVIRONMENT=$(python -c "import sysconfig; print(sysconfig.get_config_var('prefix'))")" >> $GITHUB_ENV
- run: uv python pin ${{ matrix.python-version }} # uv requires .python-version to match OS Python: https://github.com/astral-sh/uv/issues/11389
- run: uv sync --python-preference only-system
- run: git checkout .python-version # For clean git diff given `pre-commit run --show-diff-on-failure`
- uses: pre-commit/[email protected]
- uses: pre-commit-ci/[email protected]
if: always()
Expand Down
30 changes: 5 additions & 25 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,30 +87,10 @@ repos:
rev: 0.0.10
hooks:
- id: markdown-toc-creator
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.17.1
- repo: local # Use local so we can inspect paperqa.version
hooks:
- id: mypy
args: [--pretty, --ignore-missing-imports]
additional_dependencies:
- aiohttp>=3.10.6 # Match pyproject.toml
- PyMuPDF>=1.24.12
- anyio
- fhlmi>=0.28 # Match pyproject.toml
- fhaviary[llm]>=0.20 # Match pyproject.toml
- ldp>=0.25.0 # Match pyproject.toml
- html2text
- httpx
- pybtex
- numpy
- pydantic~=2.11 # Match pyproject.toml
- pydantic-settings
- qdrant-client
- rich
- tantivy>=0.22.2 # Match pyproject.toml
- tenacity
- tiktoken>=0.4.0 # Match pyproject.toml
- types-setuptools
- types-PyYAML
- sentence-transformers
- pyzotero
name: mypy
entry: mypy
language: system
types_or: [python, pyi]