-
Notifications
You must be signed in to change notification settings - Fork 235
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3390 from infotroph/memoize-commit-at-build-time
Record commit at package installation
- Loading branch information
Showing
50 changed files
with
261 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# Generated by roxygen2: do not edit by hand | ||
|
||
S3method(print,pecan_version_report) | ||
export(pecan_version) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Set at package install time, used by pecan.all::pecan_version() | ||
# to identify development versions of packages | ||
.build_hash <- Sys.getenv("PECAN_GIT_REV", "unknown") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,34 @@ | ||
|
||
# Read and format a list of pecan versions | ||
|
||
pecan_version_history <- utils::read.csv( | ||
"pecan_version_history.csv", | ||
colClasses = "character", | ||
check.names = FALSE) | ||
# The local() wrapper is to avoid adding objects to the package data: | ||
# Any extra vars defined at the top level of this file would be loaded | ||
# into the global environment by `data("pecan_version_history")` | ||
|
||
# We'd like to parse strictly to catch invalid versions (probably typos). | ||
# But we _need_ to allow NAs... and in R < 4.4, package_version did not | ||
# accept NAs unless strict=FALSE. | ||
strict <- TRUE | ||
na_version <- try( | ||
package_version(NA_character_, strict = strict), | ||
silent = TRUE) | ||
if (inherits(na_version, "try-error")) { | ||
strict <- FALSE | ||
} | ||
pecan_version_history <- local({ | ||
pvh <- utils::read.csv( | ||
"pecan_version_history.csv", | ||
colClasses = "character", | ||
check.names = FALSE) | ||
|
||
for (col in colnames(pecan_version_history)) { | ||
if (col != "package") { | ||
pecan_version_history[[col]] <- package_version( | ||
pecan_version_history[[col]], | ||
strict = strict) | ||
# We'd like to parse strictly to catch invalid versions (probably typos). | ||
# But we _need_ to allow NAs... and in R < 4.4, package_version did not | ||
# accept NAs unless strict=FALSE. | ||
strict <- TRUE | ||
na_version <- try( | ||
package_version(NA_character_, strict = strict), | ||
silent = TRUE) | ||
if (inherits(na_version, "try-error")) { | ||
strict <- FALSE | ||
} | ||
} | ||
|
||
# Now remove local vars | ||
# Yes, this really is needed: _all_ objects left defined at end of script | ||
# will be added to the package data list! | ||
rm(strict, na_version, col) | ||
for (col in colnames(pvh)) { | ||
if (col != "package") { | ||
pvh[[col]] <- package_version( | ||
pvh[[col]], | ||
strict = strict) | ||
} | ||
} | ||
|
||
pvh | ||
}) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Set at package install time, used by pecan.all::pecan_version() | ||
# to identify development versions of packages | ||
.build_hash <- Sys.getenv("PECAN_GIT_REV", "unknown") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Set at package install time, used by pecan.all::pecan_version() | ||
# to identify development versions of packages | ||
.build_hash <- Sys.getenv("PECAN_GIT_REV", "unknown") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Set at package install time, used by pecan.all::pecan_version() | ||
# to identify development versions of packages | ||
.build_hash <- Sys.getenv("PECAN_GIT_REV", "unknown") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Set at package install time, used by pecan.all::pecan_version() | ||
# to identify development versions of packages | ||
.build_hash <- Sys.getenv("PECAN_GIT_REV", "unknown") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Set at package install time, used by pecan.all::pecan_version() | ||
# to identify development versions of packages | ||
.build_hash <- Sys.getenv("PECAN_GIT_REV", "unknown") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Set at package install time, used by pecan.all::pecan_version() | ||
# to identify development versions of packages | ||
.build_hash <- Sys.getenv("PECAN_GIT_REV", "unknown") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Set at package install time, used by pecan.all::pecan_version() | ||
# to identify development versions of packages | ||
.build_hash <- Sys.getenv("PECAN_GIT_REV", "unknown") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Set at package install time, used by pecan.all::pecan_version() | ||
# to identify development versions of packages | ||
.build_hash <- Sys.getenv("PECAN_GIT_REV", "unknown") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Set at package install time, used by pecan.all::pecan_version() | ||
# to identify development versions of packages | ||
.build_hash <- Sys.getenv("PECAN_GIT_REV", "unknown") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Set at package install time, used by pecan.all::pecan_version() | ||
# to identify development versions of packages | ||
.build_hash <- Sys.getenv("PECAN_GIT_REV", "unknown") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Set at package install time, used by pecan.all::pecan_version() | ||
# to identify development versions of packages | ||
.build_hash <- Sys.getenv("PECAN_GIT_REV", "unknown") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Set at package install time, used by pecan.all::pecan_version() | ||
# to identify development versions of packages | ||
.build_hash <- Sys.getenv("PECAN_GIT_REV", "unknown") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Set at package install time, used by pecan.all::pecan_version() | ||
# to identify development versions of packages | ||
.build_hash <- Sys.getenv("PECAN_GIT_REV", "unknown") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Set at package install time, used by pecan.all::pecan_version() | ||
# to identify development versions of packages | ||
.build_hash <- Sys.getenv("PECAN_GIT_REV", "unknown") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Set at package install time, used by pecan.all::pecan_version() | ||
# to identify development versions of packages | ||
.build_hash <- Sys.getenv("PECAN_GIT_REV", "unknown") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Set at package install time, used by pecan.all::pecan_version() | ||
# to identify development versions of packages | ||
.build_hash <- Sys.getenv("PECAN_GIT_REV", "unknown") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Set at package install time, used by pecan.all::pecan_version() | ||
# to identify development versions of packages | ||
.build_hash <- Sys.getenv("PECAN_GIT_REV", "unknown") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Set at package install time, used by pecan.all::pecan_version() | ||
# to identify development versions of packages | ||
.build_hash <- Sys.getenv("PECAN_GIT_REV", "unknown") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Set at package install time, used by pecan.all::pecan_version() | ||
# to identify development versions of packages | ||
.build_hash <- Sys.getenv("PECAN_GIT_REV", "unknown") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Set at package install time, used by pecan.all::pecan_version() | ||
# to identify development versions of packages | ||
.build_hash <- Sys.getenv("PECAN_GIT_REV", "unknown") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Set at package install time, used by pecan.all::pecan_version() | ||
# to identify development versions of packages | ||
.build_hash <- Sys.getenv("PECAN_GIT_REV", "unknown") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Set at package install time, used by pecan.all::pecan_version() | ||
# to identify development versions of packages | ||
.build_hash <- Sys.getenv("PECAN_GIT_REV", "unknown") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Set at package install time, used by pecan.all::pecan_version() | ||
# to identify development versions of packages | ||
.build_hash <- Sys.getenv("PECAN_GIT_REV", "unknown") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Set at package install time, used by pecan.all::pecan_version() | ||
# to identify development versions of packages | ||
.build_hash <- Sys.getenv("PECAN_GIT_REV", "unknown") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Set at package install time, used by pecan.all::pecan_version() | ||
# to identify development versions of packages | ||
.build_hash <- Sys.getenv("PECAN_GIT_REV", "unknown") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Set at package install time, used by pecan.all::pecan_version() | ||
# to identify development versions of packages | ||
.build_hash <- Sys.getenv("PECAN_GIT_REV", "unknown") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Set at package install time, used by pecan.all::pecan_version() | ||
# to identify development versions of packages | ||
.build_hash <- Sys.getenv("PECAN_GIT_REV", "unknown") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Set at package install time, used by pecan.all::pecan_version() | ||
# to identify development versions of packages | ||
.build_hash <- Sys.getenv("PECAN_GIT_REV", "unknown") |
Oops, something went wrong.