Unverified 提交 863efc01 authored 作者: Pham Nguyen Hung's avatar Pham Nguyen Hung 提交者: GitHub

Moved mypy from pre-commit to GitHub Action (#775)

上级 880a57aa
name: mypy
on:
pull_request:
push:
branches: [main]
jobs:
mypy:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4
- name: Cache conda
uses: actions/cache@v4
env:
# Increase this value to reset cache if environment.yml has not changed
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-py310-conda-${{ env.CACHE_NUMBER }}-${{
hashFiles('environment.yml') }}
- uses: conda-incubator/setup-miniconda@v3
with:
miniforge-variant: Mambaforge
miniforge-version: latest
mamba-version: "*"
activate-environment: pytensor-test
channel-priority: strict
environment-file: environment.yml
python-version: "3.10"
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-pytensor and mypy dependencies
run: |
conda activate pytensor-test
pip install -e .
python --version
- name: Run mypy
run: |
conda activate pytensor-test
python ./scripts/run_mypy.py --verbose
\ No newline at end of file
...@@ -27,17 +27,3 @@ repos: ...@@ -27,17 +27,3 @@ repos:
- id: ruff - id: ruff
args: ["--fix", "--output-format=full"] args: ["--fix", "--output-format=full"]
- id: ruff-format - id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.10.0
hooks:
- id: mypy
language: python
entry: python ./scripts/run_mypy.py --verbose
additional_dependencies:
- numpy>=1.20
- pandas
- types-filelock
- types-setuptools>=67.6.0.8
always_run: true
require_serial: true
pass_filenames: false
...@@ -26,6 +26,9 @@ dependencies: ...@@ -26,6 +26,9 @@ dependencies:
# For testing # For testing
- coveralls - coveralls
- diff-cover - diff-cover
- mypy
- types-filelock
- types-setuptools
- pytest - pytest
- pytest-cov - pytest-cov
- pytest-xdist - pytest-xdist
...@@ -41,6 +44,7 @@ dependencies: ...@@ -41,6 +44,7 @@ dependencies:
# code style # code style
- ruff - ruff
# developer tools # developer tools
- pandas # required to run mypy script
- pre-commit - pre-commit
- packaging - packaging
- typing_extensions - typing_extensions
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论