Skip to content

Commit e800ed5

Browse files
committed
👷 Enable hash-checking in the runtime deptree 🔗
This sorta fixes #279, though not fully, perhaps. We may want to discuss it more in the future. It became possible to pip v26.1 [[1]] fixing the issue I reported when Pradyun was first battle-testing the new resolvelib-based replacement back in 2020 and it turned out to crash whenever the new resolver would see constraint files with entries having `--hash` attached [[2]]. This was quite a popular use for the users of `pip-tools` which delayed the adoption. It's finally been fixed this May [[3]] so we can use it here. This version of pip got bundled into CPython and backported into 3.13 that our container uses. So I'm bumping pip to the corresponding version to match that in our pip-tools managed files too (since we've been downgrading pip to a version that doesn't for two months LOL). With that, the patch also includes hashes for whatever bits of the tree have been present in the constraint "lock" files already without re-resolving them or bumping anything else transitive. Thanks to Pradyun for finally fixing the thing in pip upstream, and to Seth, and Thomas for periodically poking me about this ☮️ [1]: https://pip.pypa.io/en/stable/news/#v26-1 [2]: pypa/pip#9243 [3]: pypa/pip#13887
1 parent dd8c5f4 commit e800ed5

4 files changed

Lines changed: 483 additions & 50 deletions

File tree

‎.pip-tools.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[tool.pip-tools]
22
allow-unsafe = true
3+
generate-hashes = true
34
resolver = "backtracking"
45
strip-extras = true
Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,9 @@
1-
pip
1+
# NOTE: pip v26.1 fixed a bug in the resolvelib depresolver implementation
2+
# that prevented us from using `--require-hashes` in constraint files since
3+
# roughly year 2020. But now we can get back to using it.
4+
#
5+
# Refs:
6+
# * https://pip.pypa.io/en/stable/news/#v26-1
7+
# * https://github.com/pypa/pip/issues/9243
8+
# * https://github.com/pypa/pip/pull/13887
9+
pip >= 26.1

‎requirements/runtime-prerequisites.txt‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
# This file is autogenerated by pip-compile with Python 3.13
33
# by the following command:
44
#
5-
# pip-compile --allow-unsafe --config=../.pip-tools.toml --output-file=runtime-prerequisites.txt --strip-extras runtime-prerequisites.in
5+
# pip-compile --allow-unsafe --config=../.pip-tools.toml --generate-hashes --output-file=runtime-prerequisites.txt --strip-extras runtime-prerequisites.in
66
#
77

88
# The following packages are considered to be unsafe in a requirements file:
9-
pip==25.2
9+
pip==26.1 \
10+
--hash=sha256:4e8486d821d814b77319acb7b9e8bf5a4ee7590a643e7cb21029f209be8573c1 \
11+
--hash=sha256:81e13ebcca3ffa8cc85e4deff5c27e1ee26dea0aa7fc2f294a073ac208806ff3
1012
# via -r runtime-prerequisites.in

0 commit comments

Comments
 (0)