diff --git a/Makefile b/Makefile index 273592d6e6..ea773f2525 100644 --- a/Makefile +++ b/Makefile @@ -70,8 +70,10 @@ files_in_dir = $(call drop_parents, $(call recurse_dir, $1)) # HACK: NA vs TRUE switch on dependencies argument is an ugly workaround for # a circular dependency between benchmark and data.land. # When this is fixed, can go back to simple `dependencies = TRUE` -depends_R_pkg = ./scripts/time.sh "depends ${1}" ./scripts/confirm_deps.R ${1} \ - $(if $(findstring modules/benchmark,$(1)),NA,TRUE) +depends_R_pkg = ./scripts/time.sh "depends ${1}" Rscript \ + -e "pak::local_install_deps('$(strip $(1))'," \ + -e "dependencies = $(if $(findstring modules/benchmark,$(1)),NA,TRUE)," \ + -e "upgrade = FALSE)" install_R_pkg = ./scripts/time.sh "install ${1}" Rscript \ -e ${SETROPTIONS} \ -e "remotes::install_local('$(strip $(1))', force=TRUE, dependencies=FALSE, upgrade=FALSE)" @@ -146,7 +148,13 @@ clean: find models/basgra/src \( -name \*.mod -o -name \*.o -o -name \*.so \) -delete .install/devtools: | .install - + ./scripts/time.sh "devtools ${1}" Rscript -e ${SETROPTIONS} -e "if(!requireNamespace('devtools', quietly = TRUE)) install.packages('devtools')" + + ./scripts/time.sh "devtools ${1}" Rscript -e ${SETROPTIONS} \ + -e "if(!requireNamespace('devtools', quietly = TRUE)) install.packages('devtools')" + echo `date` > $@ + +.install/pak: | .install + + ./scripts/time.sh "pak ${1}" Rscript -e ${SETROPTIONS} \ + -e "if(!requireNamespace('pak', quietly = TRUE)) install.packages('pak')" echo `date` > $@ .install/roxygen2: | .install .install/devtools @@ -167,7 +175,7 @@ clean: + ./scripts/time.sh "mockery ${1}" Rscript -e ${SETROPTIONS} -e "if(!requireNamespace('mockery', quietly = TRUE)) install.packages('mockery')" echo `date` > $@ -$(ALL_PKGS_I) $(ALL_PKGS_C) $(ALL_PKGS_T) $(ALL_PKGS_D): | .install/devtools .install/roxygen2 .install/testthat +$(ALL_PKGS_I) $(ALL_PKGS_C) $(ALL_PKGS_T) $(ALL_PKGS_D): | .install/devtools .install/pak .install/roxygen2 .install/testthat .SECONDEXPANSION: .doc/%: $$(call files_in_dir, %) | $$(@D) diff --git a/docker/base/Dockerfile b/docker/base/Dockerfile index abbffd47c9..03a951b47d 100644 --- a/docker/base/Dockerfile +++ b/docker/base/Dockerfile @@ -17,7 +17,6 @@ ARG PECAN_GIT_DATE="unknown" # copy folders COPY Makefile Makefile.depends /pecan/ COPY scripts/time.sh /pecan/scripts/time.sh -COPY scripts/confirm_deps.R /pecan/scripts/confirm_deps.R COPY base /pecan/base/ COPY modules /pecan/modules/ COPY models /pecan/models/ diff --git a/scripts/confirm_deps.R b/scripts/confirm_deps.R index fd272c1c29..829273fc99 100755 --- a/scripts/confirm_deps.R +++ b/scripts/confirm_deps.R @@ -4,7 +4,8 @@ # ./confirm_deps path/to/package [dependencies] # Usage as a function: source in and use as documented below - +# NOTE: Superseded. +# `pak::local_install_deps(..., upgrade = FALSE)` now does this nicely. #' Check whether a local package's dependencies are already satisfied #'