Skip to content

Commit

Permalink
refine error message and update CABLE roxy version
Browse files Browse the repository at this point in the history
  • Loading branch information
infotroph committed Feb 14, 2024
1 parent 5573506 commit 1dd96d0
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
19 changes: 13 additions & 6 deletions docker/depends/pecan.depends.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,21 @@ condense_version_requirements <- function(specs) {
gsub("[^[:digit:].-]+", "", specs))

if ((length(unique(versions)) > 1) && any(!grepl(">", specs))) {
# can't assume the latest version works for all, so give up.
# we *could* write more to handle this case if needed, but it seems very rare:
# Can't assume the latest version works for all, so give up.
# We *could* write more to handle this case if needed, but it seems very rare:
# available.packages() shows `<=` or `==` deps in just 4 of 20297 CRAN packages
#
# Since the package name wasn't passed in here, we unhelpfully print *just*
# the offending versions and send the user back to the CSV for details.
stop(
"pecan_depends only knows how to resolve minimum dependency versions ",
"(e.g. `>= 2.8.1`). Exact (`==`) or maximum versions (`<=`) ",
" are only allowed if all PEcAn packages declare the same version.",
"Problem seen in (", paste(dQuote(specs), collapse = ", "), ")")
"Found multiple version requirements (",
paste(dQuote(specs), collapse = ", "), ") for the same dependency, ",
"and not all are minimum versions (e.g. `>= x.y.z`). ",
"Exact (`==`) or maximum (`<=`) version reuirements are only allowed ",
"if all PEcAn packages declare the same version. ",
"Sorry, this function doesn't know which dependency caused this. ",
"To find it, search for these version strings in ",
"'pecan_package_dependencies.csv'.")
}
specs[versions == max(versions)]
}
Expand Down
2 changes: 1 addition & 1 deletion docker/depends/pecan_package_dependencies.csv
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,6 @@
"rmarkdown",">= 2.19","modules/assim.batch","Suggests",FALSE
"rmarkdown",">= 2.19","modules/meta.analysis","Suggests",FALSE
"rmarkdown",">= 2.19","modules/photosynthesis","Suggests",FALSE
"roxygen2","== 6.1.0","models/cable","Roxygen",FALSE
"roxygen2","== 7.2.3","base/all","Roxygen",FALSE
"roxygen2","== 7.2.3","base/db","Roxygen",FALSE
"roxygen2","== 7.2.3","base/logger","Roxygen",FALSE
Expand All @@ -491,6 +490,7 @@
"roxygen2","== 7.2.3","base/workflow","Roxygen",FALSE
"roxygen2","== 7.2.3","models/basgra","Roxygen",FALSE
"roxygen2","== 7.2.3","models/biocro","Roxygen",FALSE
"roxygen2","== 7.2.3","models/cable","Roxygen",FALSE
"roxygen2","== 7.2.3","models/clm45","Roxygen",FALSE
"roxygen2","== 7.2.3","models/dalec","Roxygen",FALSE
"roxygen2","== 7.2.3","models/dvmdostem","Roxygen",FALSE
Expand Down
2 changes: 1 addition & 1 deletion models/cable/DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ Copyright: Authors
LazyLoad: yes
LazyData: FALSE
Encoding: UTF-8
RoxygenNote: 6.1.0
RoxygenNote: 7.2.3
3 changes: 1 addition & 2 deletions models/cable/man/write_restart.CABLE.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1dd96d0

Please sign in to comment.