diff --git a/.Rbuildignore b/.Rbuildignore index 7677dfc..f665b6c 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -15,3 +15,4 @@ ^Meta$ ^Dockerfile$ ^.devcontainer +^.venv/ diff --git a/.github/workflows/R_CDM_check_hades.yaml b/.github/workflows/R_CDM_check_hades.yaml index c348c7a..771b78f 100644 --- a/.github/workflows/R_CDM_check_hades.yaml +++ b/.github/workflows/R_CDM_check_hades.yaml @@ -43,6 +43,7 @@ jobs: CDM5_SQL_SERVER_PASSWORD: ${{ secrets.CDM5_SQL_SERVER_PASSWORD }} CDM5_SQL_SERVER_SERVER: ${{ secrets.CDM5_SQL_SERVER_SERVER }} CDM5_SQL_SERVER_USER: ${{ secrets.CDM5_SQL_SERVER_USER }} + UV_SYSTEM_PYTHON: 1 steps: - uses: actions/checkout@v4 @@ -58,7 +59,13 @@ jobs: - uses: actions/setup-python@v5 with: python-version: '3.11' - + + - name: Install the latest version of uv + uses: astral-sh/setup-uv@v4 + with: + version: "latest" + python-version: "3.11" + - name: Install system requirements if: runner.os == 'Linux' run: | @@ -75,24 +82,11 @@ 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 pip install polars tqdm connectorx pyarrow pynvml numpy + uv pip install torch --index https://download.pytorch.org/whl/cpu/ - 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")' @@ -100,13 +94,13 @@ jobs: check-dir: '"check"' - name: Install covr - if: runner.os == 'ubuntu-24.04' + if: runner.os == 'Linux' run: | remotes::install_cran("covr") shell: Rscript {0} - name: Test coverage - if: runner.os == 'ubuntu-24.04' + if: runner.os == 'Linux' run: covr::codecov(token = "${{ secrets.CODECOV_TOKEN }}") shell: Rscript {0} diff --git a/.github/workflows/R_CMD_check_main_weekly.yaml b/.github/workflows/R_CMD_check_main_weekly.yaml index e9fdf9e..05ba98a 100644 --- a/.github/workflows/R_CMD_check_main_weekly.yaml +++ b/.github/workflows/R_CMD_check_main_weekly.yaml @@ -47,18 +47,17 @@ jobs: WEBAPI_TEST_SECURE_WEBAPI_URL: ${{ secrets.WEBAPI_TEST_SECURE_WEBAPI_URL }} WEBAPI_TEST_ADMIN_USER_NAME: ${{ secrets.WEBAPI_TEST_ADMIN_USER_NAME }} WEBAPI_TEST_ADMIN_USER_PASSWORD: ${{ secrets.WEBAPI_TEST_ADMIN_USER_PASSWORD }} - TORCH_INSTALL: '1' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-r@v2 with: r-version: ${{ matrix.config.r }} - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: - python-version: '3.10' + python-version: '3.11' - uses: r-lib/actions/setup-tinytex@v2 @@ -73,12 +72,13 @@ jobs: shell: Rscript {0} run: | python_packages <- - c("polars", "tqdm", "connectorx", "pyarrow", "scikit-learn") + c("polars", "tqdm", "connectorx", "pyarrow") library(reticulate) - virtualenv_create("r-reticulate", Sys.which("python")) - virtualenv_install("r-reticulate", python_packages) - virtualenv_install("r-reticulate", "torch", pip_options = c("--index-url https://download.pytorch.org/whl/cpu")) + 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")) path_to_python <- virtualenv_python("r-reticulate") writeLines(sprintf("RETICULATE_PYTHON=%s", path_to_python),