Revert to `pytorch` installation with `uv` in CI
Summary
Revert to install torch with uv
Also link to #4063, pip install torch is taking up 70% of the total dep install time
Revert to pytorch installation with uv in CI,
- [x] It appears https://github.com/astral-sh/uv/issues/1921 has been resolved.
- [ ] The following intermittent error causes false negative CI failures, reported in https://github.com/astral-sh/uv/issues/2586:
error: Failed to download distributions
Caused by: Failed to fetch wheel: torch==2.2.1
Caused by: Failed to extract archive
Caused by: error decoding response body
Caused by: request or response body error
Caused by: error reading a body from connection
Caused by: end of file before message length reached
- [ ] Also https://github.com/astral-sh/uv/issues/4402.
Looks like we still have the issue where uv cannot install torch randomly. I would report this to uv soon.
To fix this, we might need to install torch and explicitly skip torch for uv.
Before this PR, even after torch is already successfully installed by pip, calling uv pip install torch again would still fail (therefore the random errors we have seen).
we're getting
pytest: command not found
which is not a torch related error message?
strange that it only happens on the 1st runner. maybe a race condition? we could try python -m pytest ...
we're getting
pytest: command not foundwhich is not a torch related error message?
If you look more closely into the log, the failure actually comes from the "Install pymatgen and dependencies" stage (for some reason it still passed).
strange that it only happens on the 1st runner. maybe a race condition? we could try python -m pytest ...
Not sure. I thought it just fails randomly...No idea why. I don't think it has anything to do with the split itself though.
at least it's no longer failing due to timeouts. looks like now we're hitting this issue https://github.com/astral-sh/uv/issues/2586
at least it's no longer failing due to timeouts. looks like now we're hitting this issue astral-sh/uv#2586
Look like this one. I guess we would need to still install torch with pip, and somehow prevent uv from trying to install torch later (not sure how to achieve this though, as torch is not a direct dependency of pymatgen, but chgnet).
Maybe we could try to install everything but [optional] with uv, and then use uv to install [optional] only? I think it's really bad, as the package itself would be installed twice, there should be a better way that I'm not aware of.
Or, just fall back to slow but reliable pip altogether?
Also link to #4063, pip install torch is taking up 70% of the total dep install time
Closing this one in #4100, reason: currently chgnet and matgl doesn't support Python 3.13, so torch would not be required in CI for now.