diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml new file mode 100644 index 0000000..ebf99ca --- /dev/null +++ b/.github/workflows/mypy.yml @@ -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 }} diff --git a/README.md b/README.md index fece940..11bf2fc 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/pyproject.toml b/pyproject.toml index 99e0bb5..0843ba7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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"]