New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable tox-uv
extension to speed up virtual environments and package installation by tox
#16201
Comments
OpenAstronomy side is mostly handled by @ConorMacBride currently, I think. Thanks for the idea! |
If you just need to install the package that's configurable without editing the workflows |
Here? Lines 112 to 114 in 12f287a
|
Happy to share! I'm a big fan of making it so that the time it takes to run pytest in GitHub Actions is approximately equal to the amount of time it takes to run pytest. 🙃 |
If we can reduce the |
If it is just a few lines, feel free to open an exploratory PR and check the actual run time. Thanks! |
I think @jdavies-st been very interested in test run time lately too, so I ping him here. |
I think changing from There are plenty of ways to speed up CI. Build platform-specific wheels, cache them, run tox from the wheels. If you want to speed up things in local testing, don't run tox - test from an editable install if it fits your needs. Don't run the full test suite, etc. Rely on CI to do work for you. When running tox, installation does take a good percentage of the time. For Agree that an exploratory PR would be interesting. |
Something that was pointed out by @namurphy on Slack, but I don't see mentioned here, is that |
That's super useful to be able to do oldest dependencies. I wrote something similar for https://github.com/spacetelescope/minimum_dependencies Having it be a tox plugin would be nice, though it's also easy to use with tox: https://github.com/spacetelescope/jwst/blob/1c054d892777b5271fb5c3664b80e99a6518e6a8/tox.ini#L74-L76 I'm surprised |
The switch would probably involve having tox-uv installed alongside tox, so going back and forth should be straightforward, like
For what it's worth, the last couple of issues I raised on the
Indeed! I wrote up some of the things I did to speed up PlasmaPy's CI in PlasmaPy/PlasmaPy#2585. Caching the With regards to the overhead of using tox, I just re-ran a
If dependencies need to be resolved every time a GitHub Action is run, then using
I probably won't get to this for a while since I'm not sure if this needs to be done in Astropy's GitHub Actions or in OpenAstronomy/github-actions-workflows, so if anyone else wants to take this on, please go for it! |
I think I would feel better if I see it in action in a smaller Astropy repo first. Maybe |
uv
is "an extremely fast Python package installer and resolver, written in Rust" that was released by Astral one month ago today. It is a "drop-in replacement for commonpip
,pip-tools
, andvirtualenv
commands" that is "10-100 times faster thanpip
&pip-tools
." For example, after installinguv
we can douv pip install astropy
instead ofpip install astropy
.The
tox-uv
extension totox
makes it so thatuv
gets used for the creation of virtual environments used bytox
.I have been actively trying to speed up CI checks in PlasmaPy. 🚀 I just opened PlasmaPy/PlasmaPy#2584 to enable
tox-uv
. (This is in addition to an earlier PR to cache.tox
between runs; PlasmaPy/PlasmaPy#2552.) I did some timings, and found that enablingtox-uv
for PlasmaPy's CI reduced the non-pytest/non-cache time of a GitHub workflow from ∼155 s to ∼16 s. ⏩ Because of this order of magnitude improvement, I suggest enablingtox-uv
in CI for Astropy.While
uv
is new, it is described by Astral as production-ready.uv
is presently able to handle the most commonly used pip commands, and the production team is very responsive to bug reports.I'm not as familiar with Astropy's
tox
setup, so I'm not sure if enablingtox-uv
needs to be done here or in OpenAstronomy/github-actions-workflows.The text was updated successfully, but these errors were encountered: