Skip to content

Commit ad50361

Browse files
authored
Merge pull request #16 from chrishavlin/enable_type_checking
add a type check workflow
2 parents 06c02bf + 2279f0e commit ad50361

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

.github/workflows/type_checking.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: type checking
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
paths:
9+
- yt_experiments/**/*.py
10+
- pyproject.toml
11+
- .github/workflows/type-checking.yaml
12+
workflow_dispatch:
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
name: type check
18+
timeout-minutes: 60
19+
20+
concurrency:
21+
# auto-cancel any in-progress job *on the same branch*
22+
group: ${{ github.workflow }}-${{ github.ref }}
23+
cancel-in-progress: true
24+
25+
steps:
26+
- name: Checkout repo
27+
uses: actions/checkout@v4
28+
29+
- name: Set up Python
30+
uses: actions/setup-python@v5
31+
with:
32+
# run with oldest supported python version
33+
# so that we always get compatible versions of
34+
# core dependencies at type-check time
35+
python-version: '3.10'
36+
37+
- name: Build
38+
run: |
39+
python3 -m pip install --upgrade pip
40+
python3 -m pip install "mypy==1.11.2"
41+
42+
- run: python -m pip list
43+
44+
- name: Run mypy
45+
run: mypy yt_experiments

pyproject.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,14 @@ archs = "auto"
106106

107107
[tool.cibuildwheel.windows]
108108
archs = "auto64"
109+
110+
[tool.mypy]
111+
files = ["yt_experiments",]
112+
python_version = "3.10"
113+
warn_unused_configs = true
114+
strict = true
115+
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
116+
warn_unreachable = true
117+
disallow_untyped_defs = false
118+
disallow_incomplete_defs = false
119+
disable_error_code = ["import-untyped", "import-not-found"]

0 commit comments

Comments
 (0)