code check with uv #49889
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: Code check | |
on: | |
push: | |
branches: [master, "release/*"] | |
pull_request: | |
branches: [master, "release/*"] | |
paths: | |
- ".actions/*" | |
- ".github/workflows/code-checks.yml" | |
- "requirements/**" | |
- "src/**" | |
- "pyproject.toml" # includes mypy config | |
- "!requirements/docs.txt" | |
- "!requirements/*/docs.txt" | |
- "!*.md" | |
- "!**/*.md" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }} | |
cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
mypy: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v5 | |
- name: Install uv and set Python version | |
uses: astral-sh/setup-uv@v6 | |
with: | |
python-version: "3.11" | |
# TODO: Avoid activating environment like this | |
# see: https://github.com/astral-sh/setup-uv/tree/v6/?tab=readme-ov-file#activate-environment | |
activate-environment: true | |
enable-cache: true | |
- name: Install dependencies | |
env: | |
FREEZE_REQUIREMENTS: 1 | |
timeout-minutes: 20 | |
run: | | |
uv pip install '.[pytorch-all,fabric-all]' -r requirements/typing.txt | |
uv pip list | |
- name: Check typing | |
run: mypy |