Re:
by Noumenon72 on Sunday January 01, 2023 @12:43AM
(#34203953)
Would it work to make a requirements-pytorch.txt that doesn't look in PyPi?
--index-url https://user:pass@path/to/pytorch/nightly/repo
Re:
by codedokode on Sunday January 01, 2023 @01:14AM
(#34204094)
This can be solved by using namespaced names for packages from third-party repositories, e.g. "pytorch/triton" instead of just "triton". In this case package from one repo cannot replace another repo's package.
It is possible to specify hashes. https://pip.pypa.io/en/stable/topics/secure-installs/
Re:
by shanipribadi on Sunday January 01, 2023 @04:27AM
(#34204941)
hashes would also need to be specified for all dependencies (transitives) in case they were needed,
and all dependencies need to be pinned to specific versions as well. hence this would only work when users are making use of venvs, instead of user install / site install setup.
It would be better if packages could specify a cryptographic hashes of the packages they depend on and/or specify the package repo that a package should come from. There is some prior art for this in e.g. the Javascript and Rust ecosystems.
This problem did not occur simply because pytorch has many dependencies and one of them got compromised. If pip allowed you to specify dependencies in a more secure way, this would not have happened.