[ty] Add diagnostics for isinstance() and issubclass() calls that use invalid PEP-604 unions for their second argument
#7996
Workflow file for this run
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: Run mypy_primer | |
| permissions: {} | |
| on: | |
| pull_request: | |
| paths: | |
| - "crates/ty*/**" | |
| - "crates/ruff_db" | |
| - "crates/ruff_python_ast" | |
| - "crates/ruff_python_parser" | |
| - ".github/workflows/mypy_primer.yaml" | |
| - ".github/workflows/mypy_primer_comment.yaml" | |
| - "scripts/mypy_primer.sh" | |
| - "Cargo.lock" | |
| - "!**.md" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }} | |
| cancel-in-progress: true | |
| defaults: | |
| run: | |
| shell: bash | |
| env: | |
| CARGO_INCREMENTAL: 0 | |
| CARGO_NET_RETRY: 10 | |
| CARGO_TERM_COLOR: always | |
| RUSTUP_MAX_RETRIES: 10 | |
| RUST_BACKTRACE: 1 | |
| jobs: | |
| mypy_primer: | |
| name: Run mypy_primer | |
| runs-on: ${{ github.repository == 'astral-sh/ruff' && 'depot-ubuntu-22.04-32' || 'ubuntu-latest' }} | |
| timeout-minutes: 20 | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| path: ruff | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Install the latest version of uv | |
| uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7.1.2 | |
| - uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1 | |
| with: | |
| workspaces: "ruff" | |
| - name: Install Rust toolchain | |
| run: rustup show | |
| - name: Run mypy_primer | |
| env: | |
| PRIMER_SELECTOR: crates/ty_python_semantic/resources/primer/good.txt | |
| DIFF_FILE: mypy_primer.diff | |
| run: | | |
| cd ruff | |
| scripts/mypy_primer.sh | |
| # NOTE: astral-sh-bot uses this artifact to post comments on PRs. | |
| # Make sure to update the bot if you rename the artifact. | |
| - name: Upload diff | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: mypy_primer_diff | |
| path: mypy_primer.diff | |
| memory_usage: | |
| name: Run memory statistics | |
| runs-on: ${{ github.repository == 'astral-sh/ruff' && 'depot-ubuntu-22.04-32' || 'ubuntu-latest' }} | |
| timeout-minutes: 20 | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| path: ruff | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Install the latest version of uv | |
| uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7.1.2 | |
| - uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1 | |
| with: | |
| workspaces: "ruff" | |
| - name: Install Rust toolchain | |
| run: rustup show | |
| - name: Run mypy_primer | |
| env: | |
| TY_MAX_PARALLELISM: 1 # for deterministic memory numbers | |
| TY_MEMORY_REPORT: mypy_primer | |
| PRIMER_SELECTOR: crates/ty_python_semantic/resources/primer/memory.txt | |
| DIFF_FILE: mypy_primer_memory.diff | |
| run: | | |
| cd ruff | |
| scripts/mypy_primer.sh | |
| - name: Upload diff | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: mypy_primer_memory_diff | |
| path: mypy_primer_memory.diff |