Skip to content

Commit

Permalink
try uv for python
Browse files Browse the repository at this point in the history
  • Loading branch information
egillax committed Dec 17, 2024
1 parent d5301ea commit b623f7a
Showing 1 changed file with 11 additions and 19 deletions.
30 changes: 11 additions & 19 deletions .github/workflows/R_CDM_check_hades.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,12 @@ jobs:

- uses: r-lib/actions/setup-pandoc@v2

- uses: actions/setup-python@v5
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v4
with:
python-version: '3.11'

version: "latest"
python-version: "3.11"

- name: Install system requirements
if: runner.os == 'Linux'
run: |
Expand All @@ -75,24 +77,14 @@ jobs:
extra-packages: any::rcmdcheck
needs: check

- uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: setup r-reticulate venv
shell: Rscript {0}
run: |
python_packages <-
c("polars", "tqdm", "connectorx", "pyarrow", "pynvml", "numpy")
library(reticulate)
virtualenv_create("r-reticulate", Sys.which("python"), packages=python_packages)
virtualenv_install("r-reticulate", "torch", pip_options = c("--index-url https://download.pytorch.org/whl/cpu"))
run: |
uv venv -p 3.11 \
uv pip install polars tqdm connectorx pyarrow pynvml numpy \
uv pip install torch --index https://download.pytorch.org/whl/cpu/
env:
UV_SYSTEM_PYTHON: 1

path_to_python <- virtualenv_python("r-reticulate")
writeLines(sprintf("RETICULATE_PYTHON=%s", path_to_python),
Sys.getenv("GITHUB_ENV"))
- uses: r-lib/actions/check-r-package@v2
with:
args: 'c("--no-manual", "--as-cran")'
Expand Down

0 comments on commit b623f7a

Please sign in to comment.