Bump mypy from 1.18.2 to 1.19.0 (#161) #552
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: Python package | |
| on: [push] | |
| jobs: | |
| import-test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12", "3.13"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: "requirements.txt" | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install requirements | |
| run: | | |
| make install-requirements | |
| make install | |
| - name: print clusterscope version | |
| run: | | |
| python -c "import clusterscope; clusterscope.__version__" | |
| - name: initialize clusterscope get_job | |
| run: | | |
| python -c "import clusterscope; clusterscope.get_job()" | |
| format: | |
| runs-on: ubuntu-latest | |
| env: | |
| UV_SYSTEM_PYTHON: 1 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: "requirements.txt" | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| - name: Install dev requirements | |
| run: | | |
| make install-dev-requirements | |
| make install | |
| - name: Run ufmt | |
| run: ufmt check clusterscope tests | |
| lint: | |
| runs-on: ubuntu-latest | |
| env: | |
| UV_SYSTEM_PYTHON: 1 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: "requirements.txt" | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| - name: Install dev requirements | |
| run: | | |
| make install-dev-requirements | |
| make install | |
| - name: Run flake8 | |
| run: | | |
| flake8 clusterscope tests | |
| typecheck: | |
| runs-on: ubuntu-latest | |
| env: | |
| UV_SYSTEM_PYTHON: 1 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: "requirements.txt" | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| - name: Install dev requirements | |
| run: | | |
| make install-dev-requirements | |
| make install | |
| - name: Run mypy | |
| run: mypy clusterscope tests | |
| tests: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12", "3.13"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: "requirements.txt" | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install requirements | |
| run: | | |
| make install-requirements | |
| make install | |
| - name: Run tests | |
| run: python -m unittest discover -s tests | |
| cli-tests: | |
| env: | |
| UV_SYSTEM_PYTHON: 1 | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: "requirements.txt" | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install requirements | |
| run: | | |
| make install-requirements | |
| make install | |
| - name: Test CLI help command | |
| run: | | |
| cscope --help | |
| - name: Test CLI info command (expect failure in CI) | |
| run: | | |
| cscope info || echo "Expected failure - no Slurm cluster in CI" | |
| - name: Test CLI cpus command (expect failure in CI) | |
| run: | | |
| cscope cpus || echo "Expected failure - no Slurm cluster in CI" | |
| - name: Test CLI mem command (expect failure in CI) | |
| run: | | |
| cscope mem || echo "Expected failure - no Slurm cluster in CI" | |
| - name: Test CLI gpus command (expect failure in CI) | |
| run: | | |
| cscope gpus || echo "Expected failure - no Slurm cluster in CI" | |
| - name: Test CLI gpus with flags (expect failure in CI) | |
| run: | | |
| cscope gpus --generations || echo "Expected failure - no Slurm cluster in CI" | |
| cscope gpus --counts || echo "Expected failure - no Slurm cluster in CI" | |
| cscope gpus --vendor || echo "Expected failure - no Slurm cluster in CI" | |
| - name: Test CLI check-gpu command (expect failure in CI) | |
| run: | | |
| cscope check-gpu A100 || echo "Expected failure - no Slurm cluster in CI" | |
| cscope check-gpu MI300X || echo "Expected failure - no Slurm cluster in CI" | |
| - name: Test CLI aws command (expect failure in CI) | |
| run: | | |
| cscope aws || echo "Expected failure - no Slurm cluster in CI" | |
| - name: Test CLI with invalid command | |
| run: | | |
| cscope invalid-command && exit 1 || echo "Expected failure for invalid command" |