[pre-commit.ci] pre-commit autoupdate (#7545) #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: mypy | |
on: | |
pull_request: | |
push: | |
branches: [main] | |
jobs: | |
mypy: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 | |
- name: Cache conda | |
uses: actions/cache@v4 | |
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@v4 | |
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.10" # Run pre-commit on oldest supported Python version | |
use-mamba: true | |
use-only-tar-bz2: false # IMPORTANT: This may break caching of conda packages! See https://github.com/conda-incubator/setup-miniconda/issues/267 | |
- name: Install-pymc and mypy dependencies | |
run: | | |
conda activate pymc-test | |
pip install -e . | |
pip install --pre -U polyagamma | |
python --version | |
- name: Run mypy | |
run: | | |
conda activate pymc-test | |
python ./scripts/run_mypy.py --verbose |