Upgrade pip/setuptools before pip-audit to cut CI noise - #19
Merged
Conversation
The Dependency Audit job installs its environment via conda, which ships a stale bootstrap pip/setuptools that pip-audit dutifully reports CVEs for -- unrelated to any of the project's actual dependencies. This has been failing PRs (e.g. #16) on toolchain findings rather than real application vulnerabilities. Upgrading pip/setuptools right before the audit keeps the check meaningful. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015pw5723CL7SaUDUhhXfVSf
With the pip/setuptools bootstrap noise cleared, pip-audit now surfaces a genuine vulnerability: click 8.2.1 (pulled in transitively by mkdocs, dash, and black -- none of the project's own files depend on it directly) is affected by PYSEC-2026-2132, fixed in 8.3.3. Pin it directly in both environment.yml and requirements.txt so the resolver picks a patched version regardless of what its dependents' own floors allow. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015pw5723CL7SaUDUhhXfVSf
The click>=8.3.3 pin (for PYSEC-2026-2132) broke conda's environment
solve entirely, failing every job in CI (lint, type-check, tests,
pip-audit alike, since they all build from environment.yml):
mkdocs>=1.5.0 requires click>=7.0,<8.3.0a0 -- conda-forge's mkdocs
build hasn't been rebuilt against a newer click yet, making
click>=8.3.3 unsatisfiable in the conda solve.
PyPI's mkdocs has no such cap (verified: mkdocs + click>=8.3.3 install
together cleanly via pip). Moved the click pin into environment.yml's
existing `pip:` sub-section instead of conda's dependency list -- the
same pattern already used here for kaleido/mkdocstrings/mkdocs-jupyter.
pip installs after conda's solve completes, so it upgrades whatever
click conda pulled in as mkdocs's transitive dependency, without conda
ever needing to solve for the newer version itself.
requirements.txt (pure pip) is unaffected -- click>=8.3.3 already
resolves fine there.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015pw5723CL7SaUDUhhXfVSf
click>=8.3.3 requires Python >=3.10, so pinning it in environment.yml (shared by every workflow, including test.yml's Python 3.9 matrix entry) broke that job outright: pip could find no matching click release for 3.9. requirements.txt's identical pin was harmless there (docs.yml, its only consumer, is Python-3.11-only) but created a confusing asymmetry with nothing actually depending on it. Reverted both files to their state on main and moved the entire click fix into the one place it's actually needed: security.yml's dependency-audit job, which always runs Python 3.11 regardless of the test matrix. Upgrades click via pip right after the pip/setuptools step, same rationale as that fix (conda-forge's mkdocs still caps click below the patched version; PyPI has no such cap). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015pw5723CL7SaUDUhhXfVSf
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Dependency Audit (pip-audit)job installs its environment via conda, which ships a stale bootstrappip/setuptools— versionspip-auditdutifully flags CVEs for, unrelated to anything in this project's actual dependency tree. Fix:pip install --upgrade pip setuptoolsright before the audit step. Confirmed live: worked, that noise is gone.click 8.2.1→PYSEC-2026-2132, fixed in8.3.3.clickisn't a direct dependency here; it's pulled in transitively by mkdocs/dash/black.click>=8.3.3as a plain conda dependency inenvironment.ymlbroke the environment solve entirely (failed lint, type-check, tests, and pip-audit alike, since they all build from that file): conda-forge'smkdocsbuild still capsclick<8.3.0a0.environment.yml'spip:sub-section (installed after conda's solve, sidestepping that cap) fixed the solve — but broke the Python 3.9 entry in the test matrix specifically, becauseclick>=8.3.3on PyPI requires Python >=3.10.environment.ymlis shared by every workflow, includingtest.yml's full version matrix, so anything pinned there has to work on 3.9 too.environment.ymlandrequirements.txtto their state onmain, and scoped the click upgrade to the one place it's actually needed —security.yml'sdependency-auditjob, which always runs Python 3.11 regardless of the test matrix. It upgrades click viapip install --upgrade "click>=8.3.3"right after the pip/setuptools step, for the same reason (conda-forge's cap; PyPI has none).Test plan
mkdocs>=1.5.0+click>=8.3.3install together without conflict — isolates the cap to conda-forge specificallymainforenvironment.yml/requirements.txtis now empty — onlysecurity.ymlchangesDependency Audit (pip-audit)andtest (ubuntu-latest, 3.9)🤖 Generated with Claude Code
https://claude.ai/code/session_015pw5723CL7SaUDUhhXfVSf