Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: use pak instead of confirm_deps for dependency installation #3367

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand Down
1 change: 0 additions & 1 deletion docker/base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
3 changes: 2 additions & 1 deletion scripts/confirm_deps.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
#'
Expand Down
Loading