Skip to content

Commit abe7cdd

Browse files
Run mypy outside of pre-commit
Closes #5907
1 parent 1dd5518 commit abe7cdd

File tree

2 files changed

+50
-18
lines changed

2 files changed

+50
-18
lines changed

.github/workflows/pre-commit.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,53 @@ jobs:
1414
- uses: actions/checkout@v2
1515
- uses: actions/setup-python@v2
1616
- uses: pre-commit/[email protected]
17+
mypy:
18+
runs-on: ubuntu-latest
19+
defaults:
20+
run:
21+
shell: bash -l {0}
22+
steps:
23+
- uses: actions/checkout@v2
24+
- name: Cache conda
25+
uses: actions/cache@v3
26+
env:
27+
# Increase this value to reset cache if environment-test.yml has not changed
28+
CACHE_NUMBER: 0
29+
with:
30+
path: ~/conda_pkgs_dir
31+
key: ${{ runner.os }}-py39-conda-${{ env.CACHE_NUMBER }}-${{
32+
hashFiles('conda-envs/environment-test.yml') }}
33+
- name: Cache multiple paths
34+
uses: actions/cache@v3
35+
env:
36+
# Increase this value to reset cache if requirements.txt has not changed
37+
CACHE_NUMBER: 0
38+
with:
39+
path: |
40+
~/.cache/pip
41+
$RUNNER_TOOL_CACHE/Python/*
42+
~\AppData\Local\pip\Cache
43+
key: ${{ runner.os }}-build-${{ matrix.python-version }}-${{ env.CACHE_NUMBER }}-${{
44+
hashFiles('requirements.txt') }}
45+
- uses: conda-incubator/setup-miniconda@v2
46+
with:
47+
miniforge-variant: Mambaforge
48+
miniforge-version: latest
49+
mamba-version: "*"
50+
activate-environment: pymc-test
51+
channel-priority: strict
52+
environment-file: conda-envs/environment-test.yml
53+
python-version: 3.9
54+
use-mamba: true
55+
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
56+
- name: Install-pymc and mypy dependencies
57+
run: |
58+
conda activate pymc-test
59+
pip install -e .
60+
pip install --pre -U polyagamma
61+
pip install mypy types-cachetools
62+
python --version
63+
- name: Run mypy
64+
run: |
65+
conda activate pymc-test
66+
python ./scripts/run_mypy.py --verbose

.pre-commit-config.yaml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,6 @@ repos:
1313
- id: requirements-txt-fixer
1414
exclude: ^requirements-dev\.txt$
1515
- id: trailing-whitespace
16-
- repo: https://github.com/pre-commit/mirrors-mypy
17-
rev: v0.981
18-
hooks:
19-
- id: mypy
20-
name: Run static type checks
21-
language: python
22-
entry: python ./scripts/run_mypy.py --verbose
23-
additional_dependencies:
24-
- pandas
25-
- types-cachetools
26-
- types-filelock
27-
- types-setuptools
28-
- arviz
29-
- aeppl==0.0.38
30-
- aesara==2.8.7
31-
always_run: true
32-
require_serial: true
33-
pass_filenames: false
3416
- repo: https://github.com/PyCQA/isort
3517
rev: 5.10.1
3618
hooks:

0 commit comments

Comments
 (0)