[Security] Pin Python dependencies and add lockfile#509
Draft
SeanMeyer wants to merge 2 commits intoDataDog:mainfrom
Draft
[Security] Pin Python dependencies and add lockfile#509SeanMeyer wants to merge 2 commits intoDataDog:mainfrom
SeanMeyer wants to merge 2 commits intoDataDog:mainfrom
Conversation
Pin all unpinned dependencies in setup.cfg to exact versions (certifi, python-dateutil, google-cloud-storage, azure-storage-blob, azure-identity, setuptools, setuptools_scm). Add requirements.in and a pip-compile-generated lockfile with SHA-256 hashes for all transitive dependencies. Part of incident #51987 supply chain protection. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The setup_requires pins (setuptools==67.6.0, setuptools_scm==8.3.1) conflicted with pyproject.toml's build-system requires which resolve to setuptools==82.0.1 and setuptools_scm==10.0.5. This caused two errors: "backend dependencies conflict" and "'Configuration' object has no attribute 'scm'". Revert setup_requires to ranges matching pyproject.toml since the build system (not setup.cfg) controls which versions get installed. Also pin remaining unpinned deps in requirements.in to match setup.cfg's install_requires for consistency. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
setup.cfgto exact versions:certifi>=2022.12.7->certifi==2026.2.25python-dateutil(bare) ->python-dateutil==2.9.0.post0google-cloud-storage>=2.14.0->google-cloud-storage==3.10.1azure-storage-blob>=12.19.0->azure-storage-blob==12.28.0azure-identity>=1.15.0->azure-identity==1.25.3setuptools>=67.6.0->setuptools==67.6.0setuptools_scm(bare) ->setuptools_scm==8.3.1requirements.inandrequirements.txt.lockgenerated bypip-compilewith SHA-256 hashes for all transitive dependenciesMotivation
Part of incident #51987 supply chain protection campaign. Pinning dependencies to exact versions and adding hash-verified lockfiles prevents supply chain attacks where a compromised package version could be silently installed during builds.
Test plan
pip install -r requirements.txt.lockpip install -e .still works with the pinned versionstoxorpytest