Update dependency pyright to v1.1.411 (#3452) #7336
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: test | |
| on: | |
| push: | |
| branches: | |
| - master | |
| # Renovate "automerge" branches -- there is no PR, so branch tests are used instead | |
| - "renovate/lock-file-maintenance" | |
| pull_request: | |
| workflow_dispatch: | |
| env: | |
| UV_FROZEN: true # https://docs.astral.sh/uv/configuration/environment/#uv_frozen | |
| UV_NO_SYNC: true # prevent `uv run` cmd from bringing very dev dependencies | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| mypy-self-check: | |
| timeout-minutes: 10 | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ['3.10', '3.11', '3.12', '3.13', '3.14'] | |
| fail-fast: false | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: uv sync --no-dev --group tests | |
| - name: Run mypy on plugin code | |
| run: uv run mypy mypy_django_plugin | |
| - name: Run mypy on ext code | |
| run: uv run mypy ext | |
| - name: Run mypy on scripts and utils | |
| run: uv run mypy scripts | |
| - name: Run mypy on stubs | |
| run: uv run mypy --cache-dir=/dev/null --no-incremental django-stubs | |
| - name: Run mypy on the test cases | |
| run: uv run mypy tests | |
| test: | |
| timeout-minutes: 15 | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ['3.10', '3.11', '3.12', '3.13', '3.14'] | |
| shard: [0, 1, 2, 3] | |
| fail-fast: false | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 | |
| - name: Cache apt packages | |
| uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6 | |
| with: | |
| path: /var/cache/apt/archives | |
| key: apt-gdal-${{ runner.os }} | |
| - name: Setup system dependencies | |
| run: | | |
| sudo apt-get update || true | |
| sudo apt-get install -y --no-install-recommends libgdal-dev libproj-dev | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: uv sync --no-dev --group tests | |
| # Must match `shard` definition in the test matrix: | |
| - name: Run pytest tests | |
| run: uv run pytest --num-shards=4 --shard-id=${{ matrix.shard }} -n auto tests | |
| test-older-django: | |
| timeout-minutes: 15 | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| shard: [0, 1, 2, 3] | |
| fail-fast: false | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 | |
| - name: Cache apt packages | |
| uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6 | |
| with: | |
| path: /var/cache/apt/archives | |
| key: apt-gdal-${{ runner.os }} | |
| - name: Setup system dependencies | |
| run: | | |
| sudo apt-get update || true | |
| sudo apt-get install -y --no-install-recommends libgdal-dev libproj-dev | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 | |
| - name: Set up Python | |
| uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6 | |
| with: | |
| python-version: '3.10' | |
| - name: Install dependencies | |
| run: uv sync --no-dev --group tests | |
| - name: Downgrade Django | |
| run: uv pip install django==5.0.0 | |
| # Exit 1 only if ont of the pytest error is a mypy crash | |
| - name: Run pytest tests | |
| run: "! uv run pytest --num-shards=4 --shard-id=${{ matrix.shard }} -n auto tests | grep 'pytest_mypy_plugins.utils.TypecheckAssertionError: Critical error occurred'" | |
| stubtest: | |
| timeout-minutes: 10 | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ['3.12', '3.13', '3.14'] | |
| fail-fast: false | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 | |
| - name: Cache apt packages | |
| uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6 | |
| with: | |
| path: /var/cache/apt/archives | |
| key: apt-gdal-${{ runner.os }} | |
| - name: Setup system dependencies | |
| run: | | |
| sudo apt-get update || true | |
| sudo apt-get install -y --no-install-recommends libgdal-dev libproj-dev | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: uv sync --no-dev --group tests | |
| - name: Run stubtest | |
| run: uv run ./scripts/stubtest.sh | |
| run-pyright: | |
| timeout-minutes: 10 | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ['3.12'] # TODO: enable on other versions | |
| fail-fast: false | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: uv sync --no-dev --group pyright | |
| # See https://github.com/jakebailey/pyright-action#providing-a-pyright-version-sourced-from-preexisting-dependencies | |
| - name: Add venv to path | |
| run: echo "$PWD/.venv/bin" >> $GITHUB_PATH | |
| - name: Run pyright on the test cases | |
| uses: jakebailey/pyright-action@8ec14b5cfe41f26e5f41686a31eb6012758217ef # v3 | |
| with: | |
| version: PATH | |
| run-pyrefly: | |
| timeout-minutes: 10 | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ['3.12'] | |
| fail-fast: false | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: uv sync --no-dev --group pyrefly | |
| - name: Add venv to path | |
| run: echo "$PWD/.venv/bin" >> $GITHUB_PATH | |
| - name: Run pyrefly on the test cases | |
| run: pyrefly check tests/assert_type | |
| run-ty: | |
| timeout-minutes: 10 | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ['3.12'] | |
| fail-fast: false | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: uv sync --no-dev --group ty | |
| - name: Add venv to path | |
| run: echo "$PWD/.venv/bin" >> $GITHUB_PATH | |
| - name: Run ty on the test cases | |
| run: ty check tests/assert_type | |
| matrix-test: | |
| timeout-minutes: 10 | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ['3.10', '3.11', '3.12', '3.13', '3.14'] | |
| django-version: ['5.0', '5.1', '5.2'] | |
| include: | |
| - python-version: '3.12' | |
| django-version: '6.0' | |
| - python-version: '3.13' | |
| django-version: '6.0' | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: uv sync --no-dev --group tests | |
| - name: Run django-stubs-ext tests | |
| run: uv run --with "django==${{ matrix.django-version }}" pytest ext | |
| build-and-check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 | |
| with: | |
| fetch-tags: true | |
| - name: Install uv & Python | |
| uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 | |
| with: | |
| python-version: "3.13" | |
| - name: Ensure uv.lock is up to date | |
| run: env --unset=UV_FROZEN uv lock --check | |
| - name: Build | |
| run: uv build --all-packages |