Skip to content

Commit

Permalink
Merge pull request #16 from chrishavlin/enable_type_checking
Browse files Browse the repository at this point in the history
add a type check workflow
  • Loading branch information
chrishavlin authored Oct 11, 2024
2 parents 06c02bf + 2279f0e commit ad50361
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/type_checking.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: type checking

on:
push:
branches:
- main
pull_request:
paths:
- yt_experiments/**/*.py
- pyproject.toml
- .github/workflows/type-checking.yaml
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
name: type check
timeout-minutes: 60

concurrency:
# auto-cancel any in-progress job *on the same branch*
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
# run with oldest supported python version
# so that we always get compatible versions of
# core dependencies at type-check time
python-version: '3.10'

- name: Build
run: |
python3 -m pip install --upgrade pip
python3 -m pip install "mypy==1.11.2"
- run: python -m pip list

- name: Run mypy
run: mypy yt_experiments
11 changes: 11 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,14 @@ archs = "auto"

[tool.cibuildwheel.windows]
archs = "auto64"

[tool.mypy]
files = ["yt_experiments",]
python_version = "3.10"
warn_unused_configs = true
strict = true
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
warn_unreachable = true
disallow_untyped_defs = false
disallow_incomplete_defs = false
disable_error_code = ["import-untyped", "import-not-found"]

0 comments on commit ad50361

Please sign in to comment.