-
-
Notifications
You must be signed in to change notification settings - Fork 436
58 lines (48 loc) · 1.73 KB
/
Copy pathrun-linters.yml
File metadata and controls
58 lines (48 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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