From c601d5cf3d8968f3dc1fe792bc1da5b43c6a9ed9 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Wed, 9 Jun 2021 11:27:45 +0200 Subject: [PATCH] Use stable mypy (#5595) Use stable mypy Pin all package versions Don't upgrade pip itself --- .github/workflows/mypy_primer.yml | 6 ++--- .../workflows/stubtest-unused-whitelist.yml | 5 +--- .github/workflows/tests.yml | 27 +++++++------------ requirements-tests-py3.txt | 8 +++--- 4 files changed, 16 insertions(+), 30 deletions(-) diff --git a/.github/workflows/mypy_primer.yml b/.github/workflows/mypy_primer.yml index 554ad4589..6dc0e0593 100644 --- a/.github/workflows/mypy_primer.yml +++ b/.github/workflows/mypy_primer.yml @@ -27,9 +27,7 @@ jobs: with: python-version: 3.8 - name: Install dependencies - run: | - python -m pip install -U pip - pip install git+https://github.com/hauntsaninja/mypy_primer.git + run: pip install git+https://github.com/hauntsaninja/mypy_primer.git - name: Run mypy_primer shell: bash run: | @@ -44,7 +42,7 @@ jobs: # fail action if exit code isn't zero or one ( mypy_primer \ - --new 61c346230cf4960c976 --old 61c346230cf4960c976 \ + --new v0.901 --old v0.901 \ --custom-typeshed-repo typeshed_to_test \ --new-typeshed $GITHUB_SHA --old-typeshed upstream_master \ --num-shards 2 --shard-index ${{ matrix.shard-index }} \ diff --git a/.github/workflows/stubtest-unused-whitelist.yml b/.github/workflows/stubtest-unused-whitelist.yml index 4032cf23e..b83cb6efc 100644 --- a/.github/workflows/stubtest-unused-whitelist.yml +++ b/.github/workflows/stubtest-unused-whitelist.yml @@ -25,11 +25,8 @@ jobs: uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - # Keep the mypy version in sync with what we use for stubtest in tests.yml - name: Install dependencies - run: | - python -m pip install -U pip - pip install -U git+git://github.com/python/mypy@master + run: pip install $(grep mypy== requirements-tests-py3.txt) - name: Run stubtest shell: bash run: ./tests/stubtest_unused.py | tee stubtest-output-${{ matrix.os }}-${{ matrix.python-version }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 28d5bde69..f99e55d27 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,9 +14,8 @@ jobs: steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 - - run: | - pip install toml - ./tests/check_consistent.py + - run: pip install toml + - run: ./tests/check_consistent.py flake8: name: Lint with flake8 @@ -24,9 +23,8 @@ jobs: steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 - - run: | - pip install $(grep flake8 requirements-tests-py3.txt) - flake8 + - run: pip install $(grep flake8 requirements-tests-py3.txt) + - run: flake8 black: name: Check formatting with black @@ -34,9 +32,8 @@ jobs: steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 - - run: | - pip install $(grep black requirements-tests-py3.txt) - black --check --diff stdlib stubs + - run: pip install $(grep black requirements-tests-py3.txt) + - run: black --check --diff stdlib stubs isort: name: Check imports with isort @@ -44,9 +41,8 @@ jobs: steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 - - run: | - pip install $(grep isort requirements-tests-py3.txt) - isort --check-only --diff stdlib stubs + - run: pip install $(grep isort requirements-tests-py3.txt) + - run: isort --check-only --diff stdlib stubs pytype: name: Run pytype against the stubs @@ -69,7 +65,7 @@ jobs: steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 - - run: pip install -U git+git://github.com/python/mypy + - run: pip install $(grep mypy== requirements-tests-py3.txt) - run: ./tests/mypy_test.py --platform=${{ matrix.platform }} pyright: @@ -104,10 +100,7 @@ jobs: uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - # Keep the mypy version in sync with what we use for stubtest in stubtest-unused-whitelist.yml - name: Install dependencies - run: | - python -m pip install -U pip - pip install -U git+git://github.com/python/mypy@master + run: pip install $(grep mypy== requirements-tests-py3.txt) - name: Run stubtest run: python tests/stubtest_test.py --ignore-unused-whitelist diff --git a/requirements-tests-py3.txt b/requirements-tests-py3.txt index 866f44a50..e95d5e431 100644 --- a/requirements-tests-py3.txt +++ b/requirements-tests-py3.txt @@ -1,10 +1,8 @@ -# Use the current mypy version until a version that supports modular -# typeshed is released on PyPI. -git+https://github.com/python/mypy.git@master -typed-ast>=1.0.4 +mypy==0.901 +typed-ast==1.4.3 black==21.5b2 flake8==3.9.2 flake8-bugbear==21.4.3 flake8-pyi==20.10.0 isort==5.8.0 -pytype>=2021.5.25 +pytype==2021.5.25