Formal: prove the profiler-correctness desideratum (unbiased + consis… #571
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: linters | |
| on: | |
| push: | |
| branches: [ master ] | |
| pull_request: | |
| branches: [ master ] | |
| workflow_dispatch: | |
| # Cancel any in-flight runs for the same PR / branch when a new push arrives. | |
| # Master pushes still run to completion (the ``cancel-in-progress`` predicate | |
| # only fires on PR events). | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| jobs: | |
| linters: | |
| runs-on: ubuntu-latest | |
| # mypy + ruff are pure static analysis: no native build needed and | |
| # results are version-independent given a single mypy target version | |
| # (set in mypy.ini) and ruff's --target-version. A single matrix entry | |
| # is enough; the C++ extension isn't installed because nothing here | |
| # imports it. | |
| timeout-minutes: 5 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| cache: pip | |
| cache-dependency-path: | | |
| requirements.txt | |
| - name: Install Python dependencies for linting | |
| # No ``pip install -e .`` here — mypy resolves the package via | |
| # ``mypy scalene`` (source directory) and missing C-extension | |
| # imports are silenced by ``ignore_missing_imports = True`` in | |
| # mypy.ini. ruff is purely syntactic. | |
| # | |
| # ``pydantic`` is required because mypy.ini configures | |
| # ``plugins = pydantic.mypy`` and mypy fails to start if the | |
| # plugin module isn't importable. | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install -r requirements.txt | |
| python -m pip install mypy ruff types-PyYAML pydantic | |
| - name: Run linters | |
| run: | | |
| mypy scalene | |
| ruff check scalene |