Skip to content

Commit 0e6ae24

Browse files
committed
Use remotes for R-package installs
1 parent 8495be3 commit 0e6ae24

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

.github/workflows/python-ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ jobs:
3030

3131
- name: Install R packages
3232
run: Rscript install_pkgs.R
33+
3334
- name: Test with pytest (full)
3435
if: github.ref == 'refs/heads/master'
3536
run: |

Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ RUN apt-get update && \
5252

5353

5454
RUN poetry config virtualenvs.in-project true && \
55-
poetry lock && \
5655
poetry install
5756

5857
EXPOSE 5000

install_pkgs.R

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,23 @@ toml_data <- RcppTOML::parseTOML("pyproject.toml")
1414
# Extract dependencies
1515
deps <- toml_data$tool$quail$`r-dependencies`
1616

17+
if (!requireNamespace("remotes", quietly = TRUE)) {
18+
install.packages("remotes", repos = "https://cloud.r-project.org")
19+
}
1720

18-
# Install devtools
19-
install.packages("devtools", dependencies = TRUE)
20-
library(devtools)
21-
22-
# Install packages with versions
21+
# Install packages with versions using remotes
2322
for (pkg in names(deps)) {
2423
ver <- deps[[pkg]]
2524
if (!(pkg %in% rownames(installed.packages()))) {
2625
if (is.null(ver) || ver == "*" || ver == "") {
27-
install_version(pkg)
26+
install.packages(pkg, repos = "https://cloud.r-project.org")
2827
} else {
29-
install_version(pkg, version = ver)
28+
remotes::install_version(pkg, version = ver, repos = "https://cloud.r-project.org")
3029
}
3130
}
3231
}
3332

34-
install.packages("githubinstall")
35-
library(githubinstall)
36-
gh_install_packages("pacificclimate/climdex.pcic", ref = "daf4790") # TODO in climdex.pcic: Release tag v.1.1.11 and update ref
33+
34+
remotes::install_github("pacificclimate/climdex.pcic@daf4790",
35+
dependencies = TRUE,
36+
)

0 commit comments

Comments
 (0)