[Infra] Harden supply chain: remove unused scripts, add pip binary-only install - #25023
Conversation
…ly install Remove ci_cd/publish-proxy-extras.sh (dead, unreferenced PyPI publish script) and .pre-commit-config.yaml (pulls external repos from GitHub on git commit). Add --only-binary :all: to scripts/install.sh to prevent execution of malicious setup.py during pip install. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
|
Greptile SummaryThis PR hardens the supply chain by deleting two files (
Confidence Score: 4/5
|
| Filename | Overview |
|---|---|
| scripts/install.sh | Adds --only-binary :all: to the pip install command; the security improvement is valid but can silently break installs on wheel-less platforms, and the fallback error message now suggests the same failing command. |
| .pre-commit-config.yaml | Deleted entirely to remove external-repo supply-chain hooks; removes four local-only hooks (pyright, isort, black, check-files-match) as collateral damage. |
| ci_cd/publish-proxy-extras.sh | Dead publish script with no references in any workflow; clean deletion with no side effects. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A([scripts/install.sh]) --> B[Detect OS & Python]
B --> C{Python ≥ 3.9?}
C -- No --> D([die: Python not found])
C -- Yes --> E{pip available?}
E -- No --> F([die: install pip])
E -- Yes --> G["pip install --only-binary :all: --upgrade litellm[proxy]"]
G -- Success --> H[Find litellm binary]
G -- Failure --> I["die: Try manually with --only-binary :all: ❌\n(same flag, still fails on wheel-less platforms)"]
H --> J{Binary found?}
J -- No --> K([die: try --user install])
J -- Yes --> L([Launch setup wizard])
style G fill:#f9a,stroke:#c33
style I fill:#fcc,stroke:#c33
style I color:#000
Comments Outside Diff (1)
-
.pre-commit-config.yamlDeleting local hooks removes developer tooling unnecessarily
The supply-chain concern is valid for the two external-repo hooks (
pycqa/flake8andpython-poetry/poetry), which are pinned to mutable tags (7.0.0,1.8.0) and could theoretically be retargeted. However, the other four hooks uselanguage: system, meaning they run locally installed binaries and pull nothing from GitHub:pyright— local system toolisort— local system toolblack— runs viapoetry run black, localcheck-files-match— runspython3 ci_cd/check_files_match.py, local
Removing the whole file throws away type-checking, import-sorting, formatting, and file-consistency guards that every contributor runs on
git commit. A more surgical fix would remove only the two external-repo stanzas while keeping the local ones. If the intention is to drop pre-commit entirely (e.g., in favour of CI-only checks), that context would be helpful to document.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Reviews (1): Last reviewed commit: "[Infra] Harden supply chain: remove unus..." | Re-trigger Greptile
| "$PYTHON_BIN" -m pip install --only-binary :all: --upgrade "${LITELLM_PACKAGE}" \ | ||
| || die "pip install failed. Try manually: $PYTHON_BIN -m pip install --only-binary :all: '${LITELLM_PACKAGE}'" |
There was a problem hiding this comment.
--only-binary :all: blocks install on wheel-less platforms; fallback error points to the same failing command
--only-binary :all: tells pip to refuse to build any package from source, including transitive dependencies. While litellm itself publishes wheels, some of its heavier dependencies (e.g., cryptography, grpcio, or any native-extension package) may ship sdist-only for certain platforms — most notably musl-based Linux (Alpine / Docker slim images), unusual CPU architectures (ARM32, RISC-V, s390x), or older Python patch versions that don't yet have pre-built wheels.
When pip hits even a single sdist-only dependency it aborts the entire install with an error like:
ERROR: Could not find a version that satisfies the requirement <pkg> (from litellm)
NOTE: This error originates from a subprocess, and is likely not a problem with pip.
The more pressing problem is the updated die() message:
die "pip install failed. Try manually: $PYTHON_BIN -m pip install --only-binary :all: '${LITELLM_PACKAGE}'"The manual command it suggests carries the same --only-binary :all: flag, so on a platform that lacks wheels it will fail again — leaving the user with no viable recovery path. The original error message (without --only-binary) would have actually worked as a fallback.
Consider either:
- Falling back to a non-binary install only on failure (two-step), or
- Keeping
--only-binary :all:but fixing the error message to omit the flag so the user can self-recover:
| "$PYTHON_BIN" -m pip install --only-binary :all: --upgrade "${LITELLM_PACKAGE}" \ | |
| || die "pip install failed. Try manually: $PYTHON_BIN -m pip install --only-binary :all: '${LITELLM_PACKAGE}'" | |
| "$PYTHON_BIN" -m pip install --only-binary :all: --upgrade "${LITELLM_PACKAGE}" \ | |
| || die "pip install failed. Try manually: $PYTHON_BIN -m pip install '${LITELLM_PACKAGE}'" |
[Infra] Harden supply chain: remove unused scripts, add pip binary-only install
Summary
Problem
Several files in the repo are supply chain attack surfaces:
ci_cd/publish-proxy-extras.sh— dead PyPI publish script (unreferenced by any workflow).pre-commit-config.yaml— pulls external repos from GitHub (flake8,poetry) on everygit commitscripts/install.sh— runspip installwithout--only-binary, allowing execution of malicioussetup.pyin source distributionsFix
ci_cd/publish-proxy-extras.shand.pre-commit-config.yaml--only-binary :all:toscripts/install.shto prevent source distribution execution during pip installTesting
ci_cd/publish-proxy-extras.shis not referenced by any workflow or script.pre-commit-config.yamlis not referenced by any CI pipelinescripts/install.shchange is a pip flag addition — no behavioral change for packages that publish wheels (litellm does)Type
🚄 Infrastructure