diff --git a/.github/workflows/mypy-stubtest.yml b/.github/workflows/mypy-stubtest.yml index f042688feb62..f009720a43e0 100644 --- a/.github/workflows/mypy-stubtest.yml +++ b/.github/workflows/mypy-stubtest.yml @@ -18,12 +18,6 @@ jobs: with: python-version: 3.9 - - name: Install mypy - run: | - pip3 install -r requirements/testing/mypy.txt \ - -r requirements/testing/all.txt - pip3 install . - - name: Set up reviewdog run: | mkdir -p "$HOME/bin" @@ -32,13 +26,16 @@ jobs: sh -s -- -b "$HOME/bin" echo "$HOME/bin" >> $GITHUB_PATH + - name: Install tox + run: python -m pip install tox + - name: Run mypy stubtest env: REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | set -o pipefail - MPLBACKEND=agg python tools/stubtest.py | \ - sed -e "s!$pythonLocation/lib/python3.9/site-packages!lib!g" | \ + tox -e stubtest | \ + sed -e "s!.tox/stubtest/lib/python3.9/site-packages!lib!g" | \ reviewdog \ -efm '%Eerror: %m' \ -efm '%CStub: in file %f:%l' \ diff --git a/.gitignore b/.gitignore index 41c97b62c51e..b6f9e1ee74f4 100644 --- a/.gitignore +++ b/.gitignore @@ -31,6 +31,7 @@ ################ # meson-python working directory build +.mesonpy* # meson-python/build frontend dist directory dist diff --git a/doc/devel/coding_guide.rst b/doc/devel/coding_guide.rst index 6564de906979..b1c0a810c965 100644 --- a/doc/devel/coding_guide.rst +++ b/doc/devel/coding_guide.rst @@ -88,9 +88,8 @@ We generally use `stub files the type information for ``colors.py``. A notable exception is ``pyplot.py``, which is type hinted inline. -Type hints are checked by the mypy :ref:`pre-commit hook ` -and can often be verified using ``tools\stubtest.py`` and occasionally may -require the use of ``tools\check_typehints.py``. +Type hints are checked by the mypy :ref:`pre-commit hook `, +can often be verified by running ``tox -e stubtest``. New modules and files: installation =================================== diff --git a/environment.yml b/environment.yml index 9f06ab7ff143..d50e544edb0d 100644 --- a/environment.yml +++ b/environment.yml @@ -46,6 +46,7 @@ dependencies: - sphinxcontrib-svg2pdfconverter>=1.1.0 - pikepdf # testing + - black<24 - coverage - flake8>=3.8 - flake8-docstrings>=1.4.0 @@ -64,4 +65,4 @@ dependencies: - pytest-xdist - tornado - pytz - - black<24 + - tox diff --git a/tox.ini b/tox.ini index fc8479269160..cb2fcc979076 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,7 @@ # and then run "tox" from this directory. [tox] -envlist = py38, py39, py310 +envlist = py38, py39, py310, stubtest [testenv] changedir = /tmp @@ -25,3 +25,12 @@ commands = deps = pytest pytz + +[testenv:stubtest] +changedir = {tox_root} +commands = + python tools/stubtest.py +usedevelop = False +deps = + -r requirements/testing/mypy.txt + -r requirements/testing/all.txt pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy