From 977fe133d00ff2d37623569f569368d6ac95075a Mon Sep 17 00:00:00 2001 From: Dustin Spicuzza Date: Sun, 2 Jan 2022 21:53:22 -0500 Subject: [PATCH] Check codebase using mypy in github actions --- .github/workflows/dist.yml | 18 +++++++++++++++++- cxxheaderparser/py.typed | 0 mypy.ini | 5 +++++ setup.py | 1 + 4 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 cxxheaderparser/py.typed create mode 100644 mypy.ini diff --git a/.github/workflows/dist.yml b/.github/workflows/dist.yml index 68bdd86..963de6c 100644 --- a/.github/workflows/dist.yml +++ b/.github/workflows/dist.yml @@ -16,6 +16,22 @@ jobs: - uses: actions/checkout@v2 - uses: psf/black@stable + check-mypy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + # - uses: jpetrucciani/mypy-check@0.930 + # .. can't use that because we need to install pytest + - uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: Install requirements + run: | + pip --disable-pip-version-check install mypy pytest + - name: Run mypy + run: | + mypy . + check-doc: runs-on: ubuntu-18.04 @@ -77,7 +93,7 @@ jobs: publish: runs-on: ubuntu-latest - needs: [check, check-doc, test] + needs: [check, check-mypy, check-doc, test] if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') steps: diff --git a/cxxheaderparser/py.typed b/cxxheaderparser/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/mypy.ini b/mypy.ini new file mode 100644 index 0000000..6a3cd39 --- /dev/null +++ b/mypy.ini @@ -0,0 +1,5 @@ +[mypy] +exclude = setup\.py|docs + +[mypy-cxxheaderparser._ply.*] +ignore_errors = True \ No newline at end of file diff --git a/setup.py b/setup.py index 241ca7d..288746a 100644 --- a/setup.py +++ b/setup.py @@ -71,6 +71,7 @@ setup( license="BSD", platforms="Platform Independent", packages=find_packages(), + package_data={"cxxheaderparser": ["py.typed"]}, keywords="c++ header parser ply", python_requires=">= 3.6", classifiers=CLASSIFIERS,