@@ -33,6 +33,19 @@ concurrency:
3333permissions :
3434 contents : read
3535
36+ # Keep these pins in lockstep with the *_VERSION variables in the Makefile.
37+ # Linters are invoked via `uv tool run <tool>==<pin>` so CI and local runs
38+ # use identical versions regardless of the dev dependency group.
39+ env :
40+ RUFF_VERSION : " 0.15.1"
41+ PYLINT_VERSION : " 3.3.9"
42+ PYLINT_PYDANTIC_VERSION : " 0.3.5"
43+ VULTURE_VERSION : " 2.14"
44+ INTERROGATE_VERSION : " 1.7.0"
45+ RADON_VERSION : " 6.0.1"
46+ YAMLLINT_VERSION : " 1.38.0"
47+ TOMLCHECK_VERSION : " 0.2.3"
48+
3649jobs :
3750 # ---------------------------------------------------------------
3851 # Python linters - run on both mcpgateway/ and plugins/
@@ -45,20 +58,15 @@ jobs:
4558 target : [mcpgateway, plugins]
4659 tool :
4760 - id : ruff
48- setup : pip install ruff
49- cmd : " ruff check $TARGET"
61+ cmd : " uv tool run ruff==$RUFF_VERSION check $TARGET"
5062 - id : vulture
51- setup : pip install vulture
52- cmd : ' vulture $TARGET --min-confidence 80 --exclude "*_pb2.py,*_pb2_grpc.py"'
63+ cmd : ' uv tool run vulture==$VULTURE_VERSION $TARGET --min-confidence 80 --exclude "*_pb2.py,*_pb2_grpc.py"'
5364 - id : pylint
54- setup : " true"
55- cmd : " uv run pylint $TARGET --rcfile=.pylintrc.$TARGET --fail-on E --fail-under=10"
65+ cmd : " uv tool run --with-editable . --with pylint-pydantic==$PYLINT_PYDANTIC_VERSION pylint==$PYLINT_VERSION $TARGET --rcfile=.pylintrc.$TARGET --fail-on E --fail-under=10"
5666 - id : interrogate
57- setup : pip install interrogate
58- cmd : " interrogate -vv $TARGET --fail-under 100"
67+ cmd : " uv tool run interrogate==$INTERROGATE_VERSION -vv $TARGET --fail-under 100"
5968 - id : radon
60- setup : pip install radon
61- cmd : " radon cc $TARGET --min C --show-complexity && radon mi $TARGET --min B"
69+ cmd : " uv tool run radon==$RADON_VERSION cc $TARGET --min C --show-complexity && uv tool run radon==$RADON_VERSION mi $TARGET --min B"
6270
6371 name : " ${{ matrix.tool.id }} (${{ matrix.target }})"
6472 runs-on : ubuntu-latest
@@ -75,19 +83,10 @@ jobs:
7583 uses : actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
7684 with :
7785 python-version : " 3.12"
78- cache : pip
7986
8087 - name : Set up uv
8188 uses : astral-sh/setup-uv@d0d8abe699bfb85fec6de9f7adb5ae17292296ff # v6
8289
83- - name : Install project (editable mode)
84- run : |
85- python3 -m pip install --upgrade pip
86- pip install -e .[dev]
87-
88- - name : Install tool
89- run : ${{ matrix.tool.setup }}
90-
9190 - name : Run linter
9291 env :
9392 TARGET : ${{ matrix.target }}
@@ -103,8 +102,8 @@ jobs:
103102 matrix :
104103 include :
105104 - id : yamllint
106- setup : pip install yamllint
107- cmd : yamllint -c .yamllint .
105+ setup : " true "
106+ cmd : uv tool run yamllint==$YAMLLINT_VERSION -c .yamllint .
108107
109108 - id : jsonlint
110109 setup : |
@@ -115,13 +114,13 @@ jobs:
115114 xargs -0 -I{} jq empty "{}"
116115
117116 - id : tomllint
118- setup : pip install tomlcheck
117+ setup : " true "
119118 cmd : |
120119 find . -type f -name '*.toml' \
121120 -not -path './plugin_templates/*' \
122121 -not -path './mcp-servers/templates/*' \
123122 -print0 |
124- xargs -0 -I{} tomlcheck "{}"
123+ xargs -0 -I{} uv tool run tomlcheck==$TOMLCHECK_VERSION "{}"
125124
126125 name : ${{ matrix.id }}
127126 runs-on : ubuntu-latest
@@ -140,6 +139,9 @@ jobs:
140139 python-version : " 3.12"
141140 cache : pip
142141
142+ - name : Set up uv
143+ uses : astral-sh/setup-uv@d0d8abe699bfb85fec6de9f7adb5ae17292296ff # v6
144+
143145 - name : Install tool
144146 run : ${{ matrix.setup }}
145147
0 commit comments