Skip to content

Commit

Permalink
Run mypy outside of pre-commit
Browse files Browse the repository at this point in the history
Closes #5907
  • Loading branch information
michaelosthege committed Oct 5, 2022
1 parent 1dd5518 commit 4f0c169
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 18 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,53 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: pre-commit/action@v2.0.0
mypy:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v2
- name: Cache conda
uses: actions/cache@v3
env:
# Increase this value to reset cache if environment-test.yml has not changed
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-py39-conda-${{ env.CACHE_NUMBER }}-${{
hashFiles('conda-envs/environment-test.yml') }}
- name: Cache multiple paths
uses: actions/cache@v3
env:
# Increase this value to reset cache if requirements.txt has not changed
CACHE_NUMBER: 0
with:
path: |
~/.cache/pip
$RUNNER_TOOL_CACHE/Python/*
~\AppData\Local\pip\Cache
key: ${{ runner.os }}-build-${{ matrix.python-version }}-${{ env.CACHE_NUMBER }}-${{
hashFiles('requirements.txt') }}
- uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
miniforge-version: latest
mamba-version: "*"
activate-environment: pymc-test
channel-priority: strict
environment-file: conda-envs/environment-test.yml
python-version: 3.9
use-mamba: true
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
- name: Install-pymc and mypy dependencies
run: |
conda activate pymc-test
pip install -e .
pip install --pre -U polyagamma
pip install mypy types-cachetools
python --version
- name: Run mypy
run: |
conda activate pymc-test
python ./scripts/run_mypy.py --verbose
18 changes: 0 additions & 18 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,6 @@ repos:
- id: requirements-txt-fixer
exclude: ^requirements-dev\.txt$
- id: trailing-whitespace
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.981
hooks:
- id: mypy
name: Run static type checks
language: python
entry: python ./scripts/run_mypy.py --verbose
additional_dependencies:
- pandas
- types-cachetools
- types-filelock
- types-setuptools
- arviz
- aeppl==0.0.38
- aesara==2.8.7
always_run: true
require_serial: true
pass_filenames: false
- repo: https://github.com/PyCQA/isort
rev: 5.10.1
hooks:
Expand Down

0 comments on commit 4f0c169

Please sign in to comment.