Skip to content
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

[build-command] Use uv to install Python deps for CI #3561

Merged
merged 1 commit into from
May 20, 2024

Conversation

echoix
Copy link
Collaborator

@echoix echoix commented May 17, 2024

I just wanted to try it out with an upcoming PR, and it’s quite impressive.
With cached dependencies, the old way method took 25-40s to install the deps. (https://github.com/echoix/megalinter/actions/runs/9121261204/job/25080127542#step:8:1 and https://github.com/echoix/megalinter/actions/runs/9120700814/job/25078549631#step:8:1)

Here, WITHOUT cached dependencies, it took less than 5 secs (https://github.com/echoix/megalinter/actions/runs/9121318153/job/25080283053#step:9:1)

I used the pip to install uv, but it could’ve been with the shell script one liner.

I had to use the --system flag to let it use the global install in CI, and to not require a venv.

Otherwise, it’s quite easy.

Proposed Changes

Readiness Checklist

Author/Contributor

  • Add entry to the CHANGELOG listing the change and linking to the corresponding issue (if appropriate)
  • If documentation is needed for this change, has that been included in this pull request

Reviewing Maintainer

  • Label as breaking if this is a large fundamental change
  • Label as either automation, bug, documentation, enhancement, infrastructure, or performance

@nvuillam
Copy link
Member

@echoix that's amazing ^^

What about ascending dependency ? For example, what happens to repos using pip install in PRE_COMMANDS ?

If this is a breaking change, we can't merge this PR before the next major release

@echoix
Copy link
Collaborator Author

echoix commented May 19, 2024

It is only inside the build command when used by us in a comment to rebuild the generated files on a PR.

But to answer your question, the maintainer of the UV repo answered the other day that a venv populated by uv is undistinguishable from the venv's point of view, and can be further modified by it. So as a docker build step tool, it is ideal. But in this PR, it isn't in any docker script.

@echoix
Copy link
Collaborator Author

echoix commented May 19, 2024

Since a required check was skipped, it will need to be force merged @nvuillam

@nvuillam nvuillam merged commit 31274b9 into oxsecurity:main May 20, 2024
3 checks passed
@nvuillam
Copy link
Member

@echoix great ')
Merged ^^

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.

None yet

2 participants