Skip to content

Add install-uv option#21

Merged
alarthast merged 2 commits intomainfrom
aw/add-option-to-install-uv
Sep 16, 2025
Merged

Add install-uv option#21
alarthast merged 2 commits intomainfrom
aw/add-option-to-install-uv

Conversation

@alarthast
Copy link
Copy Markdown
Contributor

@alarthast alarthast commented Sep 15, 2025

Similar to the install-just option, add an install-uv option to install uv using astral's setup-uv GitHub action. No default value is set here, but the repo-template will be setting this to true (opensafely-core/repo-template#305).

Using a commit sha following the docs on Using third-party actions.
Dependabot should be able to recognise that the sha corresponds to a specific version and propose updates.

uv is capable of installing just12, but I haven't altered the just installation part of the action. We may wish to revisit how just is installed later, including using uv to install it if install-uv is set to true. We can also use setup-just. For flexibility in the future, I have placed the uv installation step before the just installation step.

Testing:

  • Verified that use of this branch with install-uv set to true allows running uv commands on CI.
  • Also verified that omitting the install-uv and trying to use a uv command would lead to failing CI as expected.

Footnotes

  1. Slack discussion: uv can install just which can run uv

  2. Slack discussion: Installing just with uv tool install rust-just

@alarthast alarthast force-pushed the aw/add-option-to-install-uv branch 2 times, most recently from 43cfc62 to e559f00 Compare September 15, 2025 13:44
@alarthast alarthast marked this pull request as ready for review September 15, 2025 14:40
@alarthast alarthast force-pushed the aw/add-option-to-install-uv branch 3 times, most recently from 10ce3e6 to 5ce81c6 Compare September 15, 2025 14:47
Copy link
Copy Markdown
Member

@bloodearnest bloodearnest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good thanks.

Left a comment about maybe making defaulting to false explicit.

Regards using uv to install just, I am -0 on that idea for two three reasons:

  • it means we have to trust the PyPI package author (who AFAICT is not a part of the just development team - in fact there are multiple PyPI just packages). I'd rather consume something direct from upstream if possible, reduce the trusted parties
  • upstream will likely stay more up to date as things change
  • a project might no use python (so no uv) but still want just

So I would vote for using setup-just. I would probably default this to true?

But anyway, that's another issue/PR!

Comment thread action.yml
@alarthast alarthast force-pushed the aw/add-option-to-install-uv branch from 5ce81c6 to 7980211 Compare September 16, 2025 10:02
@alarthast
Copy link
Copy Markdown
Contributor Author

alarthast commented Sep 16, 2025

Thank you Simon, I've reworded the commit message + PR description slightly to mention setup-just.

After discussion, defaulted install-uv to false and added string checks for both install-just and install-uv.

@alarthast alarthast force-pushed the aw/add-option-to-install-uv branch from 7980211 to be2a0fe Compare September 16, 2025 10:15
If a string comparison is not made, setting `install-just` to anything
(not just `true`) will trigger the "Install just" step.

For the description of the `install-just` parameter to be accurate,
check that the value is exactly `true`.
Similar to the `install-just` option, add an `install-uv` option to
install `uv` using astral's `setup-uv` GitHub action. No default value
is set here, but the repo-template will be setting this to `true`.

Using a commit sha following the docs on
[Using third-party actions](https://docs.github.com/en/actions/reference/security/secure-use#using-third-party-actions).
Dependabot should be able to recognise that the sha corresponds to a
specific version and propose updates.

`uv` is capable of installing `just`, but I haven't altered the `just`
installation part of the action. We may wish to revisit how `just` is
installed later, including using `uv` to install it if `install-uv` is
set to `true`. We can also use `setup-just`. For flexibility in the
future, I have placed the `uv` installation step before the `just`
installation step.
@alarthast alarthast force-pushed the aw/add-option-to-install-uv branch from be2a0fe to b672f42 Compare September 16, 2025 12:49
@alarthast alarthast merged commit 39f95fa into main Sep 16, 2025
8 checks passed
@alarthast alarthast deleted the aw/add-option-to-install-uv branch September 16, 2025 12:59
@alarthast alarthast linked an issue Apr 23, 2026 that may be closed by this pull request
@alarthast alarthast mentioned this pull request Apr 23, 2026
@alarthast alarthast linked an issue Apr 23, 2026 that may be closed by this pull request
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.

Support installing uv Support python-version-file argument for setup-python

2 participants