Skip to content

use uv to manage Python installation and run scripts#353

Open
zacharyburnett wants to merge 2 commits intoOpenAstronomy:mainfrom
zacharyburnett:use_uv
Open

use uv to manage Python installation and run scripts#353
zacharyburnett wants to merge 2 commits intoOpenAstronomy:mainfrom
zacharyburnett:use_uv

Conversation

@zacharyburnett
Copy link
Contributor

@zacharyburnett zacharyburnett commented Feb 25, 2026

  • internally, when loading tox environments, we can use setup-uv instead of setup-python (and uvx instead of pipx) to run scripts
  • when provisioning the base Python installation from which to call tox -e, we can also use setup-uv instead of setup-python. This does NOT force the user to use tox-uv in their tox.ini, though they can if they want to
  • when building a Micromamba environment, we can set the use_uv: true config entry in .condarc to tell Mamba to use uv instead of pip when resolving the PyPI environment. This is transparent to the user

@zacharyburnett zacharyburnett force-pushed the use_uv branch 3 times, most recently from 71219f2 to ad81488 Compare February 25, 2026 19:38
@zacharyburnett zacharyburnett changed the title use uv to manage Python installation and PyPI packages use uv to manage Python installation and run scripts Feb 25, 2026
@Cadair
Copy link
Member

Cadair commented Feb 25, 2026

Before you spend too much time on this, I'd like to discuss if it's worth it. What's your motivation?

@zacharyburnett zacharyburnett force-pushed the use_uv branch 2 times, most recently from acf3f19 to 2d86f35 Compare February 25, 2026 20:23
@zacharyburnett
Copy link
Contributor Author

Before you spend too much time on this, I'd like to discuss if it's worth it. What's your motivation?

since the load tox environments job runs every time before every workflow, it makes sense to optimize it as much as possible (even though it's already pretty fast). To that end, resolving with uv is more performant than pip. Also, micromamba allows using uv to manage PyPI packages installed in the environment (use_uv: true in condarc)

@zacharyburnett
Copy link
Contributor Author

I figure that, since this script is probably run every few minutes all day every day, even a small performance increase is worth it (but we should at least freeze the version of uv)

@Cadair
Copy link
Member

Cadair commented Feb 25, 2026

I figure that, since this script is probably run every few minutes all day every day, even a small performance increase is worth it (but we should at least freeze the version of uv)

I can get behind this for the internal stuff, but I don't think we should go into anything tox related?

@zacharyburnett zacharyburnett marked this pull request as ready for review February 26, 2026 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants