--require-hashes
A pip option that refuses to install anything not pinned to one version and matching a hash recorded in the requirements file.
In more detail
It makes a lockfile enforceable: an unhashed or unpinned line is a hard error. Transitive dependencies you never named are checked too.
Example
pip install --require-hashes -r requirements.lockRelated terms
- lockfile — A file that records the exact version of every dependency, including transitive ones, so every install gets the same set.
- pip — Python's standard package installer, which downloads packages from the Python Package Index and installs them.
- hash — A short fixed-length fingerprint calculated from data, which changes completely if even one byte of the data changes.
Taught in
- Lockfiles And Reproducible Builds — Application Security & Threat Modeling for Engineers