Skip to content

Commit b55219c

Browse files
committed
Update docs about hash checking and wheel cache
1 parent 7df10ee commit b55219c

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

docs/html/topics/secure-installs.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,13 @@ It is possible to use multiple hashes for each package. This is important when a
5959

6060
### Interaction with caching
6161

62-
The {ref}`locally-built wheel cache <wheel-caching>` is disabled in hash-checking mode to prevent spurious hash mismatch errors.
63-
64-
These would otherwise occur while installing sdists that had already been automatically built into cached wheels: those wheels would be selected for installation, but their hashes would not match the sdist ones from the requirements file.
65-
66-
A further complication is that locally built wheels are nondeterministic: contemporary modification times make their way into the archive, making hashes unpredictable across machines and cache flushes. Compilation of C code adds further nondeterminism, as many compilers include random-seeded values in their output.
62+
```{versionchanged} 23.1
63+
The {ref}`locally-built wheel cache <wheel-caching>` is used in hash-checking mode too.
64+
```
6765

68-
However, wheels fetched from index servers are required to be the same every time. They land in pip's HTTP cache, not its wheel cache, and are used normally in hash-checking mode. The only downside of having the wheel cache disabled is thus extra build time for sdists, and this can be solved by making sure pre-built wheels are available from the index server.
66+
When installing from the cache of locally built wheel in hash-checking mode, pip verifies
67+
the hashes agains those of the original source distribution that was used to build the wheel.
68+
These original hashes are obtained from a `origin.json` file stored in each cache entry.
6969

7070
### Using hashes from PyPI (or other index servers)
7171

news/11967.doc.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Update documentation to reflect the new behavior of using the cache of locally
2+
built wheels in hash-checking mode.

0 commit comments

Comments
 (0)