Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/mypy-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: "Optional mypy check"

on:
push:
branches:
- "pull-request/[0-9]+"
- "main"
required: false

jobs:
mypy:
runs-on: ubuntu-latest

steps:
- name: Checkout ${{ github.event.repository.name }}
uses: actions/checkout@v4
with:
fetch-depth: 0

# WAR: setup-python is not relocatable...
# see https://github.com/actions/setup-python/issues/871
- name: Set up Python ${{ matrix.python-version }}
if: ${{ startsWith(matrix.host-platform, 'linux') }}
id: setup-python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install dependencies
run: |
cd cuda_core
python -m pip install --upgrade pip
pip install -e .
pip install mypy

- name: Run Mypy
run: |
cd cuda_core
mypy --no-namespace-packages . || true
Empty file added cuda_bindings/cuda/py.typed
Empty file.
6 changes: 6 additions & 0 deletions cuda_bindings/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,9 @@ exclude = ["cuda/bindings/_version.py"]
"UP022",
"E402", # module level import not at top of file
"F841"] # F841 complains about unused variables, but some assignments have side-effects that could be useful for tests (func calls for example)


[[tool.mypy.overrides]]
module = ["Cython", "llvmlite"]
ignore_missing_imports = true
follow_imports = "skip"
Loading