Repository navigation
Description
sdks/python/setup.py declares 16 dependencies across install_requires and two extras_require
groups. Every one is a floor — requests>=2.25.0, pyyaml>=6.0, aiohttp>=3.8.0,
psutil>=5.8.0, and so on — with no upper bound and no lockfile of any kind. There is no
requirements.txt, no requirements-dev.txt, no poetry.lock, no Pipfile.lock, no
pyproject.toml.
This is #201's third ask, split out because the answer is "no" and the fix is not the same fix.
#201's first two asks are done: sdks/javascript/package-lock.json is committed, sdk-metrics
installs it with npm ci, and Trivy reads it. The Python SDK is in neither position.
Two distinct consequences, and the ordering matters.
Nothing scans these dependencies. Verified rather than assumed — trivy fs --scanners vuln over
the repository reports exactly four targets:
docs-platform/package-lock.json npm
go.mod gomod
sdks/java/pom.xml pom
sdks/javascript/package-lock.json npm
sdks/python is absent. Trivy detects Python from requirements.txt, poetry.lock,
Pipfile.lock, pyproject.toml or an installed .dist-info; a bare setup.py is not on that
list, and it is the only manifest here. So this SDK's dependency tree is scanned by nothing at all
— the same gap #201 filed against the JS SDK, in the one place that closing #201 does not reach.
.github/dependabot.yml has gomod, github-actions, docker, maven, and two npm
directories; there is no pip ecosystem entry, so Dependabot does not read this manifest
either.
CI installs an unpinned tree. ci.yml:292 runs pip install --quiet pytest ., which resolves
all six install_requires floors fresh on every run. Same defect the docs-site job had before
#337, with the same symptom available to it: a break can appear or vanish with no commit behind
it. It has not bitten yet, which is not evidence that it cannot.
One dependency is worse than unpinned — it should not be there. asyncio>=3.4.3 is a
stdlib module, and the PyPI package of that name is a 2015-era backport for Python 3.3. On
python_requires='>=3.8' it is at best inert and at worst installs a decade-old package that
shadows nothing useful. Removing it is unambiguous and independent of everything else here.
Do:
- Decide the packaging story and write it down, the way sdks/javascript: no committed lockfile, so nothing scans or reproduces its dependency tree #201 asked for the JS SDK. Modern practice
ispyproject.tomlwith the dependency table there rather than insetup.py; that also makes
the manifest one Trivy detects, which resolves the scanning gap as a side effect rather than
needing a second mechanism. - Commit a pinned dev/CI requirements file, and have
ci.ymlinstall from it so the test job runs
against a tree a reader can reproduce. Keepinstall_requiresas ranges — a library should not
pin its consumers' transitive tree — which is the standard split and the reason "add a lockfile"
is not by itself the right instruction for a library. - Add a
pipecosystem entry for/sdks/pythonto.github/dependabot.yml. - Drop
asynciofrominstall_requires.
Verification: trivy fs --scanners vuln . lists a sdks/python target. That is the check that
cannot pass by accident, and it is the direct analogue of #201's npm ci gate.
Activity
scttfrdmn commentedon Aug 4, 2026
#347 implements this, with one correction to this issue that matters, because I wrote the wrong fix into it.
This issue says a
pyproject.toml"also makes the manifest one Trivy detects, which resolves the scanning gap as a side effect." That is false. A barepyproject.tomlwith a[project].dependenciestable is not detected — tested in a scratch directory, it reports no targets at all. Trivy needsrequirements.txt,poetry.lock,Pipfile.lock, or an installed.dist-info.Worse, the filename has to be exactly that. I first wrote the file as
requirements-ci.txt, the more descriptive name, and Trivy is blind to it:requirements.txtrequirements-ci.txtrequirements-dev.txtdev-requirements.txtrequirements/ci.txtpyproject.toml(bare)So the descriptive name would have produced a file that reads as the fix, passes review, and leaves the scanning gap exactly where it was. That is the same failure shape this release keeps finding — a check that does not run is indistinguishable from one that passes — arriving as a filename. The header comment in the committed file records it and says not to rename it for tidiness.
Everything else here holds.
asynciois gone (worth adding: at 4.0.0 the PyPI package is now a deliberate empty stub — dist-info and no modules, summary "Deprecated backport of asyncio; use the stdlib package instead" — so it shadowed nothing, which is a milder finding than this issue implies, though it still declared a dependency the SDK does not have).typing-extensionsis gone too, which this issue did not catch: it is imported nowhere in the package.install_requiresstays as ranges per the reasoning here, withpip checkadded between install and test to guard the seam — mutation-checked withpsutil==5.7.0against the>=5.8.0floor, which reports the conflict and exits 1.Verification as this issue specified it:
trivy fs --scanners vuln .now listssdks/python/requirements.txt, five targets total, 0 vulnerabilities.