diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2430e65a..99df511e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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/action@v3.0.1 - uses: pre-commit-ci/lite-action@v1.1.0 if: always() diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7ecff556..ebf54822 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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]