Skip to content

Commit 0a3fe12

Browse files
donislawdevclaude
andauthored
ci: compile the semgrep requirements, so Dependabot proposes sets pip can install (#188)
Dependabot raised every line of .github/requirements-semgrep.txt on its own, past what semgrep allows: #184 moved 21 packages, boltons to 26.2.0 among them, while semgrep 1.180.0 asks for boltons~=21.0, and pip refused the whole set. Grouping kept them in one pull request but did not make them agree. semgrep is now pinned in requirements-semgrep.in, the one line a person writes, and the list beside it is compiled from it by pip-compile. An .in file in the directory makes Dependabot run pip-compile itself, so what it proposes is a set pip resolved. Compiled today with Python 3.14, pip 26.1.1 and pip-tools 7.5.3, the versions Dependabot runs, the list is the same 66 versions the freeze had - none of the 21 in #184 is inside what semgrep allows. Only the spelling of two names moves (ruamel.yaml as ruamel-yaml). The reasons that stood at the top of the list moved to the .in file, with the command that compiles it by hand. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent aea57ef commit 0a3fe12

3 files changed

Lines changed: 203 additions & 39 deletions

File tree

‎.github/dependabot.yml‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,13 @@ updates:
8989
# package it installs. Those move together - a semgrep release raises the
9090
# floor of what it needs - and one pull request per package would leave
9191
# each of them red against the others' old pins.
92+
#
93+
# Grouping alone was not enough. Dependabot raised every line of the list on
94+
# its own, past what semgrep allows, and pip refused the set (#184: boltons
95+
# 26.2.0 against semgrep's boltons~=21.0). Since 2026-10-15 the list is
96+
# compiled from requirements-semgrep.in by pip-compile, and an .in file in
97+
# the directory makes Dependabot run pip-compile itself, so what it proposes
98+
# is a set pip resolved. How to compile it by hand is written in the .in file.
9299
- package-ecosystem: pip
93100
directory: "/.github"
94101
schedule:

‎.github/requirements-semgrep.in‎

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# The scanner CI runs, pinned, in a file a bot can edit.
2+
#
3+
# It lived as `pip install semgrep==X` inside a workflow step until 2026-09-02,
4+
# and that is a place nothing watches. Dependabot reads go.mod for Go modules
5+
# and `uses:` for actions, and it does not read shell commands - measured on
6+
# this repository, thirty pull requests, none of them about a pinned tool. The
7+
# cost of that was paid on 2026-09-01: staticcheck sat on a version that could
8+
# not read Go 1.27 at all, and nobody had missed a warning, because there was
9+
# never going to be one.
10+
#
11+
# A requirements file is an ecosystem Dependabot does read, so a new semgrep
12+
# release now arrives as a pull request against THIS file. It can, because this
13+
# file is not a workflow: a token cannot push changes under .github/workflows,
14+
# which is why the three Go tools next door still cannot be handled this way.
15+
# Written up as O170.
16+
#
17+
# Pinned rather than floating for the reason the workflow gives: an unpinned
18+
# analyser turns somebody else's release into a red build on a commit that
19+
# changed nothing.
20+
#
21+
# Licence read from the pinned version rather than recalled, on 2026-08-27:
22+
# LGPL-2.1-or-later, stated by the wheel metadata as a License-Expression and
23+
# carried in full beside it. Read again for 1.180.0 on 2026-10-14, the same.
24+
# It analyses the tree and is never linked into either binary.
25+
#
26+
# This is the one line a person writes. requirements-semgrep.txt next to it is
27+
# every package that line installs, pinned, and it is compiled from this file
28+
# by pip-compile rather than written by hand. With the one line alone the
29+
# vulnerability scanner has to guess what pip would pick, and it guessed wrong:
30+
# measured 2026-10-14, a scan of "semgrep==1.180.0" reported eleven advisories
31+
# against versions pip on Python 3.14 never installs.
32+
#
33+
# Compiled rather than frozen since 2026-10-15. The list was `pip freeze` of a
34+
# clean install, and Dependabot raised each of its lines on its own - pull
35+
# request #184 moved 21 of them, boltons to 26.2.0 among them, while semgrep
36+
# 1.180.0 asks for boltons~=21.0, and pip refused the whole set. When an .in
37+
# file is present Dependabot runs pip-compile itself, so what it proposes is a
38+
# set pip can install. Compiled that day, the list came out the same 66
39+
# versions the freeze had, which is also why #184 had nothing to give: every
40+
# one of its 21 versions is outside what semgrep allows.
41+
#
42+
# To compile it by hand, from the root of the repository, with the Python the
43+
# job uses and the pip-tools Dependabot runs:
44+
#
45+
# docker run --rm -v "$PWD/.github:/w" -w /w python:3.14-slim sh -c "pip install -q pip==26.1.1 pip-tools==7.5.3 && pip-compile --strip-extras --no-emit-index-url --output-file=requirements-semgrep.txt requirements-semgrep.in"
46+
semgrep==1.180.0

‎.github/requirements-semgrep.txt‎

Lines changed: 150 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,101 +1,212 @@
1-
# The scanner CI runs, pinned, in a file a bot can edit.
21
#
3-
# It lived as `pip install semgrep==X` inside a workflow step until 2026-09-02,
4-
# and that is a place nothing watches. Dependabot reads go.mod for Go modules
5-
# and `uses:` for actions, and it does not read shell commands - measured on
6-
# this repository, thirty pull requests, none of them about a pinned tool. The
7-
# cost of that was paid on 2026-09-01: staticcheck sat on a version that could
8-
# not read Go 1.27 at all, and nobody had missed a warning, because there was
9-
# never going to be one.
2+
# This file is autogenerated by pip-compile with Python 3.14
3+
# by the following command:
104
#
11-
# A requirements file is an ecosystem Dependabot does read, so a new semgrep
12-
# release now arrives as a pull request against THIS file. It can, because this
13-
# file is not a workflow: a token cannot push changes under .github/workflows,
14-
# which is why the three Go tools next door still cannot be handled this way.
15-
# Written up as O170.
5+
# pip-compile --no-emit-index-url --no-index --output-file=requirements-semgrep.txt --strip-extras requirements-semgrep.in
166
#
17-
# Pinned rather than floating for the reason the workflow gives: an unpinned
18-
# analyser turns somebody else's release into a red build on a commit that
19-
# changed nothing.
20-
#
21-
# Licence read from the pinned version rather than recalled, on 2026-08-27:
22-
# LGPL-2.1-or-later, stated by the wheel metadata as a License-Expression and
23-
# carried in full beside it. Read again for 1.180.0 on 2026-10-14, the same.
24-
# It analyses the tree and is never linked into either binary.
25-
#
26-
# Every package it installs is pinned below, not only semgrep, since
27-
# 2026-10-14. With the one line alone the vulnerability scanner has to guess
28-
# what pip would pick, and it guessed wrong: measured that day, a scan of
29-
# "semgrep==1.180.0" reported eleven advisories against python-multipart
30-
# 0.0.9, anyio 4.9.0 and idna 3.9.0, while pip on Python 3.14 installed
31-
# 0.0.32, 4.15.1 and 3.20, and a scan of what it really installed found
32-
# nothing. The list is `pip freeze` of a clean install on Linux with the
33-
# Python the job uses, which is the only place it is installed. Dependabot
34-
# reads every line, and carries them in one pull request - see the group in
35-
# dependabot.yml.
367
annotated-types==0.8.0
8+
# via pydantic
379
anyio==4.15.1
10+
# via
11+
# httpx
12+
# mcp
13+
# sse-starlette
14+
# starlette
3815
attrs==26.1.0
16+
# via
17+
# glom
18+
# jsonschema
19+
# referencing
20+
# semgrep
3921
boltons==21.0.0
22+
# via
23+
# face
24+
# glom
25+
# semgrep
4026
bracex==3.1
27+
# via wcmatch
4128
certifi==2026.7.22
29+
# via
30+
# httpcore
31+
# httpx
32+
# requests
4233
cffi==2.1.1
34+
# via cryptography
4335
charset-normalizer==3.5.2
36+
# via requests
4437
click==8.4.2
38+
# via
39+
# click-option-group
40+
# semgrep
41+
# uvicorn
4542
click-option-group==0.5.9
43+
# via semgrep
4644
colorama==0.4.6
45+
# via semgrep
4746
cryptography==50.0.2
47+
# via pyjwt
4848
exceptiongroup==1.2.2
49+
# via semgrep
4950
face==26.0.1
51+
# via glom
5052
glom==25.12.0
53+
# via semgrep
5154
googleapis-common-protos==1.75.5
55+
# via opentelemetry-exporter-otlp-proto-http
5256
h11==0.16.0
57+
# via
58+
# httpcore
59+
# uvicorn
5360
httpcore==1.0.9
61+
# via httpx
5462
httpx==0.28.1
63+
# via mcp
5564
httpx-sse==0.4.3
65+
# via mcp
5666
idna==3.20
57-
importlib_metadata==8.7.1
67+
# via
68+
# anyio
69+
# httpx
70+
# requests
71+
importlib-metadata==8.7.1
72+
# via opentelemetry-api
5873
jsonschema==4.25.1
74+
# via
75+
# mcp
76+
# semgrep
5977
jsonschema-specifications==2025.9.1
78+
# via jsonschema
6079
markdown-it-py==4.2.0
80+
# via rich
6181
mcp==1.29.0
82+
# via semgrep
6283
mdurl==0.1.2
84+
# via markdown-it-py
6385
opentelemetry-api==1.37.0
86+
# via
87+
# opentelemetry-exporter-otlp-proto-http
88+
# opentelemetry-instrumentation
89+
# opentelemetry-instrumentation-requests
90+
# opentelemetry-instrumentation-threading
91+
# opentelemetry-sdk
92+
# opentelemetry-semantic-conventions
93+
# semgrep
6494
opentelemetry-exporter-otlp-proto-common==1.37.0
95+
# via opentelemetry-exporter-otlp-proto-http
6596
opentelemetry-exporter-otlp-proto-http==1.37.0
97+
# via semgrep
6698
opentelemetry-instrumentation==0.58b0
99+
# via
100+
# opentelemetry-instrumentation-requests
101+
# opentelemetry-instrumentation-threading
67102
opentelemetry-instrumentation-requests==0.58b0
103+
# via semgrep
68104
opentelemetry-instrumentation-threading==0.58b0
105+
# via semgrep
69106
opentelemetry-proto==1.37.0
107+
# via
108+
# opentelemetry-exporter-otlp-proto-common
109+
# opentelemetry-exporter-otlp-proto-http
70110
opentelemetry-sdk==1.37.0
111+
# via
112+
# opentelemetry-exporter-otlp-proto-http
113+
# semgrep
71114
opentelemetry-semantic-conventions==0.58b0
115+
# via
116+
# opentelemetry-instrumentation
117+
# opentelemetry-instrumentation-requests
118+
# opentelemetry-sdk
72119
opentelemetry-util-http==0.58b0
120+
# via opentelemetry-instrumentation-requests
73121
packaging==26.3
122+
# via
123+
# opentelemetry-instrumentation
124+
# semgrep
74125
peewee==3.19.0
126+
# via semgrep
75127
protobuf==6.33.6
128+
# via
129+
# googleapis-common-protos
130+
# opentelemetry-proto
76131
pycparser==3.11
132+
# via cffi
77133
pydantic==2.14.1
134+
# via
135+
# mcp
136+
# pydantic-settings
137+
pydantic-core==2.50.1
138+
# via pydantic
78139
pydantic-settings==2.16.0
79-
pydantic_core==2.50.1
80-
Pygments==2.21.0
81-
PyJWT==2.15.1
140+
# via mcp
141+
pygments==2.21.0
142+
# via rich
143+
pyjwt==2.15.1
144+
# via
145+
# mcp
146+
# semgrep
82147
python-dotenv==1.2.4
148+
# via pydantic-settings
83149
python-multipart==0.0.32
150+
# via mcp
84151
referencing==0.37.0
152+
# via
153+
# jsonschema
154+
# jsonschema-specifications
85155
requests==2.34.2
156+
# via
157+
# opentelemetry-exporter-otlp-proto-http
158+
# semgrep
86159
rich==15.0.0
160+
# via semgrep
87161
rpds-py==2026.9.1
88-
ruamel.yaml==0.19.1
89-
ruamel.yaml.clib==0.2.15
162+
# via
163+
# jsonschema
164+
# referencing
165+
ruamel-yaml==0.19.1
166+
# via semgrep
167+
ruamel-yaml-clib==0.2.15
168+
# via semgrep
90169
semantic-version==2.10.0
170+
# via semgrep
91171
semgrep==1.180.0
172+
# via -r requirements-semgrep.in
92173
sse-starlette==3.5.0
174+
# via mcp
93175
starlette==1.8.0
176+
# via
177+
# mcp
178+
# sse-starlette
94179
tomli==2.4.1
180+
# via semgrep
181+
typing-extensions==4.16.0
182+
# via
183+
# anyio
184+
# mcp
185+
# opentelemetry-api
186+
# opentelemetry-exporter-otlp-proto-http
187+
# opentelemetry-sdk
188+
# opentelemetry-semantic-conventions
189+
# pydantic
190+
# pydantic-core
191+
# pydantic-settings
192+
# semgrep
193+
# typing-inspection
95194
typing-inspection==0.4.4
96-
typing_extensions==4.16.0
195+
# via
196+
# mcp
197+
# pydantic
198+
# pydantic-settings
97199
urllib3==2.8.0
200+
# via
201+
# requests
202+
# semgrep
98203
uvicorn==0.54.0
204+
# via mcp
99205
wcmatch==8.5.2
206+
# via semgrep
100207
wrapt==1.17.3
208+
# via
209+
# opentelemetry-instrumentation
210+
# opentelemetry-instrumentation-threading
101211
zipp==4.1.1
212+
# via importlib-metadata

0 commit comments

Comments
 (0)