Seems like PDM has something very close to what I have in mind: Override the resolved package versions. I am quite sure I had investigated PDM, I must have missed it…
If I understood correctly, one can add a pdm.toml
file in their own copy of the project source tree (without committing this file), with content such as this:
[[tool.pdm.source]]
name = "private"
url = "https://download.pytorch.org/whl/cu118"
include_packages = ["torch*"]
[tool.pdm.resolution.overrides]
torch = "2.2.0"
This looks quite powerful.