Skip to content

Commit

Permalink
Add GitHub action for type checking with mypy (#42)
Browse files Browse the repository at this point in the history
Co-authored-by: Alek Binion <[email protected]>
Co-authored-by: duolingo[bot] <34079079+duolingo[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Jul 17, 2024
1 parent 95e9df4 commit afb19b5
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: "Typing"

on:
push:
branches:
- master
pull_request:
workflow_dispatch:

jobs:
run:
name: "typing"
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.10"]

steps:
- uses: actions/checkout@v4

- name: Install Hatch
uses: pypa/hatch@install

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Run mypy
run: hatch run types:check --python ${{ matrix.python-version }}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# minject

![PyPI version](https://img.shields.io/pypi/v/minject)
[![Unit Tests](https://github.com/duolingo/minject/actions/workflows/hatch_test.yml/badge.svg?branch=master)](https://github.com/duolingo/minject/actions/workflows/hatch_test.yml)
[![Typing](https://github.com/duolingo/minject/actions/workflows/mypy.yml/badge.svg?branch=master)](https://github.com/duolingo/minject/actions/workflows/mypy.yml)

[**Philosophy**](#philosophy)
| [**Documentation**](https://github.com/duolingo/minject/blob/master/docs/dependency_injection.md)
Expand Down
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,10 @@ dependencies = [

[[tool.hatch.envs.hatch-test.matrix]]
python = ["3.7", "3.10"]


[tool.hatch.envs.types.scripts]
check = "mypy --install-types --non-interactive minject"

[[tool.hatch.envs.types.matrix]]
python = ["3.7", "3.10"]

0 comments on commit afb19b5

Please sign in to comment.