Skip to content

Commit

Permalink
Merge pull request #122 from ethanwhite/r-package-fixes
Browse files Browse the repository at this point in the history
R package fixes
  • Loading branch information
ethanwhite authored May 3, 2024
2 parents 86ce452 + 56cc62c commit 595e0a6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/package-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ jobs:
with:
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- uses: r-lib/actions/setup-r@v2
- name: Install dependencies (Ubuntu)
if: matrix.config.os == 'ubuntu-latest'
run: sudo apt install build-essential libcurl4-gnutls-dev libxml2-dev libssl-dev
- name: Install lxml using the binary wheel
run: |
pip --version
Expand Down
7 changes: 2 additions & 5 deletions offlinedatasci/miniCran.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,14 @@ repo = c("https://cloud.r-project.org/")
install_minicran = FALSE
if (!require("miniCRAN")) {
install_minicran = TRUE
} else if (packageVersion('miniCRAN') <= "0.2.16") {
} else if (packageVersion('miniCRAN') < "0.3.0") {
install_minicran = TRUE
}

# Currently installing from ethanwhite's fork, thus requiring remotes, because the current
# R release for macOS doesn't work on the released version of miniCRAN
if (install_minicran) {
if (!require("remotes")) {
install.packages("remotes")
}
remotes::install_github("ethanwhite/miniCRAN")
install.packages("miniCRAN")
}

library(miniCRAN)
Expand Down
6 changes: 6 additions & 0 deletions test/test_offlinedatasci.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ def test_download_python_libraries(tmp_path):
assert glob(f"{tmp_path}/pythonlibraries/*.whl")
assert glob(f"{tmp_path}/pypi/index.html")

def test_download_r_packages(tmp_path):
# test on notebook since it has caused issues in the past
# See https://github.com/carpentriesoffline/offlinedatasci/issues/95
download_r_packages(tmp_path, ['RSQLite'])
assert glob(f"{tmp_path}/miniCRAN/*")

def check_for_empty_folders(folder):
empty_folders = []
for root, dirs, files in os.walk(folder):
Expand Down

0 comments on commit 595e0a6

Please sign in to comment.