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

[Enh]: Use offical astral-sh/setup-uv@v2 github action and enable caching in the CI #955

Closed
aidoskanapyanov opened this issue Sep 12, 2024 · 2 comments · Fixed by #956
Closed

Comments

@aidoskanapyanov
Copy link
Member

aidoskanapyanov commented Sep 12, 2024

We would like to learn about your use case. For example, if this feature is needed to adopt Narwhals in an open source project, could you please enter the link to it below?

No response

Please describe the purpose of the new feature or describe the problem to solve.

  • We should use an official github action to install uv onto the running CI platform
  • We can speed up the uv install CI step by caching the dependencies, since requirements-dev.txt does not change so often.

Suggest a solution if possible.

...
        with:
          python-version: ${{ matrix.python-version }}
-     - name: Install uv (Unix)
-       if: runner.os != 'Windows'
-       run: curl -LsSf https://astral.sh/uv/install.sh | sh
-     - name: Install uv (Windows)
-       if: runner.os == 'Windows'
-       run: powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
+     - name: Install the latest version of uv
+       uses: astral-sh/setup-uv@v2
+       with:
+         version: "latest"
+     - name: Enable caching
+       id: setup-uv
+       uses: astral-sh/setup-uv@v2
+       with:
+         enable-cache: true
+         cache-suffix: "reqs-cache"
      - name: install-reqs
...

If you have tried alternatives, please describe them below.

No response

Additional information that may help us understand your needs.

No response

@MarcoGorelli
Copy link
Member

sounds good, thanks - were you interested in making a pr with that suggested change?

@aidoskanapyanov
Copy link
Member Author

aidoskanapyanov commented Sep 12, 2024

Yeah, thanks, I'll draft a PR on these changes. I also need to read on cache-suffix, and see if I need a unique suffix for each workflow/run.

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 a pull request may close this issue.

2 participants