Skip to content
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

Move type checking outside pre-commit #12866

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
13 changes: 13 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@ jobs:
- run: pip install nox
- run: nox -s docs

typecheck:
name: typecheck
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- run: pip install nox
- run: nox -s typecheck

determine-changes:
runs-on: ubuntu-latest
outputs:
Expand Down Expand Up @@ -251,6 +263,7 @@ jobs:

needs:
- determine-changes
- typecheck
- docs
- packaging
- tests-unix
Expand Down
16 changes: 0 additions & 16 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,6 @@ repos:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.10.0
hooks:
- id: mypy
exclude: tests/data
args: ["--pretty", "--show-error-codes"]
additional_dependencies: [
'keyring==24.2.0',
'nox==2023.4.22',
'pytest',
'types-docutils==0.20.0.3',
'types-setuptools==68.2.0.0',
'types-freezegun==1.1.10',
'types-pyyaml==6.0.12.12',
]

- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
Expand Down
23 changes: 23 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,29 @@ def docs_live(session: nox.Session) -> None:
)


@nox.session
def typecheck(session: nox.Session) -> None:
session.install(
"mypy",
"keyring",
"nox",
"pytest",
"types-docutils",
"types-setuptools",
"types-freezegun",
"types-pyyaml",
)

session.run(
"mypy",
"src/pip",
"tests",
"tools",
"noxfile.py",
"--exclude=tests/data",
)


@nox.session
def lint(session: nox.Session) -> None:
session.install("pre-commit")
Expand Down
Loading