forked from iiasa/ixmp
-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (44 loc) · 1.39 KB
/
lint.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Lint
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
lint:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
# If the "Latest version testable on GitHub Actions" in pytest.yaml
# is not the latest 3.x stable version, adjust here to match:
python-version: "3.10"
- name: Upgrade pip, wheel, setuptools-scm
run: |
python -m pip install --upgrade pip wheel setuptools-scm twine
# Locate pip cache directory
echo "pip-cache-dir=$(pip cache dir)" >> $GITHUB_ENV
- name: Cache Python packages
uses: actions/cache@v3
with:
path: ${{ env.pip-cache-dir }}
key: lint-${{ runner.os }}
- name: Upgrade pip, wheel, setuptools-scm
run: python -m pip install --upgrade pip wheel setuptools-scm
- name: Check "black" code style
run: |
pip install black
black --check .
- name: Lint with flake8 & isort
run: |
pip install flake8 isort
flake8 --count --max-complexity=26 --show-source --statistics
isort --check-only .
- name: Check typing with mypy
run: |
pip install mypy
# Also install packages that contain type hints
pip install pytest genno GitPython xarray sphinx types-setuptools
mypy .