docs(changelog): record the 2.9.5 edition notes #324
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: Lint | |
| on: | |
| pull_request: | |
| push: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| # Cancel an in-flight run when a newer commit lands on the same ref. | |
| concurrency: | |
| group: lint-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| ruff: | |
| # Ruff is a standalone binary and the checks are platform-agnostic, so the | |
| # cheaper/faster Linux runner is fine even though the test matrix is Windows. | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Install uv and Python | |
| uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 | |
| with: | |
| version: "0.11.28" | |
| enable-cache: true | |
| - name: Create lint environment | |
| run: uv venv | |
| # Pin ruff: formatter output and lint rules can shift between releases, so | |
| # the version here must match what contributors run locally. | |
| - name: Install ruff | |
| run: uv pip install ruff==0.15.16 | |
| # Discovery mode (no explicit paths) so the excludes in pyproject.toml apply. | |
| - name: Lint | |
| run: uv run ruff check --output-format=github | |
| - name: Format check | |
| run: uv run ruff format --check | |
| ty: | |
| # Catches names that do not exist — the failure mode the backend `match` | |
| # tables are prone to, where an arm lazily imports a class that was renamed | |
| # or never written and nothing fails until a user picks that CLI choice. | |
| # Ruff cannot see inside those arms; test_registryDrift.py checks the | |
| # registries against the CLI choices, not the classes behind them. | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Install uv and Python | |
| uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 | |
| with: | |
| version: "0.11.28" | |
| enable-cache: true | |
| - name: Create lint environment | |
| run: uv venv | |
| # Pin ty: it is pre-1.0, so rule names and default severities still move. | |
| - name: Install ty | |
| run: uv pip install ty==0.0.63 | |
| # The TAS dependency set (torch, tensorrt, onnxruntime EPs) is far too | |
| # heavy to install just to lint, so this runs against a bare venv. ty | |
| # still resolves first-party modules from the filesystem, so | |
| # "Module `src.x` has no member `Y`" fires exactly as it does locally | |
| # with the full environment — verified against the three dead imports | |
| # this job was added for. | |
| # | |
| # What a bare venv *cannot* judge is third-party imports, so the gate is | |
| # deliberately narrow: only src.* missing-member errors and undefined | |
| # first-party names fail. "Cannot resolve imported module torch" and the | |
| # like are expected here and must not fail the build. | |
| - name: Type check | |
| run: | | |
| uv run ty check --output-format=concise --exit-zero | tee ty.log | |
| if grep -E 'error\[unresolved-import\] Module `src\.[^`]*` has no member|error\[unresolved-reference\]' ty.log; then | |
| echo "::error::ty found a first-party name that does not exist (see above)" | |
| exit 1 | |
| fi |