-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Noam Ross
committed
Nov 14, 2023
1 parent
cad2fa3
commit 49a605b
Showing
56 changed files
with
881 additions
and
220 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,7 +1,111 @@ | ||
.Rproj.user | ||
inst/doc | ||
inst/scratch | ||
inst/mc | ||
docs | ||
tests/testthat/*.log | ||
### R ### | ||
# History files | ||
*Rhistory | ||
.Rhistory | ||
.Rdata | ||
.Rapp.history | ||
.Rproj.user | ||
.RData | ||
.Ruserdata | ||
# Session Data files | ||
# User-specific files | ||
# Example code in package build process | ||
*-Ex.R | ||
# Output files from R CMD build | ||
/*.tar.gz | ||
# Output files from R CMD check | ||
/*.Rcheck/ | ||
# RStudio files | ||
.Rproj.user/ | ||
# produced vignettes | ||
vignettes/*.html | ||
vignettes/*.pdf | ||
# OAuth2 token, see https://github.com/hadley/httr/releases/tag/v0.3 | ||
.httr-oauth | ||
.DS_Store | ||
# knitr and R markdown default cache directories | ||
*_cache/ | ||
/cache/ | ||
# Temporary files created by R markdown | ||
*.utf8.md | ||
*.knit.md | ||
.quarto | ||
inst/doc | ||
### R.Bookdown Stack ### | ||
# R package: bookdown caching files | ||
/*_files/ | ||
# End of https://www.toptal.com/developers/gitignore/api/r,c++,macos,microsoftoffice | ||
### C++ ### | ||
# Prerequisites | ||
*.d | ||
# Compiled Object files | ||
*.slo | ||
*.lo | ||
*.o | ||
*.obj | ||
# Precompiled Headers | ||
*.gch | ||
*.pch | ||
# Linker files | ||
*.ilk | ||
# Debugger Files | ||
*.pdb | ||
# Compiled Dynamic libraries | ||
*.so | ||
*.dylib | ||
*.dll | ||
# Fortran module files | ||
*.mod | ||
*.smod | ||
# Compiled Static libraries | ||
*.lai | ||
*.la | ||
*.a | ||
*.lib | ||
# Executables | ||
*.exe | ||
*.out | ||
*.app | ||
### macOS ### | ||
# General | ||
.DS_Store | ||
.AppleDouble | ||
.LSOverride | ||
# Icon must end with two \r | ||
Icon | ||
# Thumbnails | ||
._* | ||
# Files that might appear in the root of a volume | ||
.DocumentRevisions-V100 | ||
.fseventsd | ||
.Spotlight-V100 | ||
.TemporaryItems | ||
.Trashes | ||
.VolumeIcon.icns | ||
.com.apple.timemachine.donotpresent | ||
# Directories potentially created on remote AFP share | ||
.AppleDB | ||
.AppleDesktop | ||
Network Trash Folder | ||
Temporary Items | ||
.apdisk | ||
### MicrosoftOffice ### | ||
*.tmp | ||
# Word temporary | ||
~$*.doc* | ||
# Word Auto Backup File | ||
Backup of *.doc* | ||
# Excel temporary | ||
~$*.xls* | ||
# Excel Backup File | ||
*.xlk | ||
# PowerPoint temporary | ||
~$*.ppt* | ||
# Visio autosave temporary files | ||
*.~vsd* | ||
|
||
|
||
# Created by https://www.toptal.com/developers/gitignore/api/r,c++,macos,microsoftoffice | ||
# Edit at https://www.toptal.com/developers/gitignore?templates=r,c++,macos,microsoftoffice |
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,7 @@ | ||
# relic (development version) | ||
|
||
* Started adding tests | ||
|
||
# relic 0.0.1 | ||
|
||
* Initial proof of concept |
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,62 @@ | ||
#' Set up a testing and example repository | ||
#' | ||
#' This function generates a repository with a commit history that can be used | ||
#' for testing and examples. | ||
#' @param dir Path to the directory where the repository should be created | ||
#' @param reporter the reporter to use when building targets with [targets::tar_make()]. Defaults to "silent". | ||
#' @param s3 Whether the repository should use S3 storage for targets. Note that | ||
#' the S3 endpoint and bucket must already be available. | ||
create_example_repo <- function(dir = fs::file_temp("relic_example_"), reporter = "silent", s3 = TRUE) { | ||
check_installed(c("targets", "glue")) | ||
if (dir_exists(dir)) dir_delete(dir) | ||
dir_create(dir) | ||
od <- setwd(dir) | ||
on.exit(setwd(od)) | ||
repo <- git2r::init() | ||
# Configure the repository to use a generic user name and email address | ||
git2r::config(repo, user.name = "relic-bot", user.email = "relic@relic.r.pacakge") | ||
|
||
# Create a minimal _targets.R file | ||
write_to_file( | ||
"_targets.R", | ||
'library(targets) | ||
list( | ||
tar_target(cars, mtcars, repository = "local"), | ||
tar_target(cars_csv, {name <- "cars.csv"; write.csv(cars, name); name}, format = "file", repository = "local") | ||
) | ||
' | ||
) | ||
|
||
stamp("initial-target-file") | ||
|
||
targets::tar_make(reporter = reporter) | ||
append_to_file("_targets/.gitignore", c("!objects/\n!objects/*")) | ||
stamp("first-targets-run") | ||
|
||
overwrite_at_line( | ||
"_targets.R", 3, | ||
"tar_target(cars, rbind(mtcars, mtcars))," | ||
) | ||
targets::tar_make(reporter = reporter) | ||
stamp("longer-cars") | ||
|
||
if(s3) { | ||
insert_lines_at( | ||
"_targets.R", 2, | ||
'Sys.setenv(AWS_ACCESS_KEY_ID="minioadmin", AWS_SECRET_ACCESS_KEY="minioadmin") | ||
tar_option_set( | ||
resources = tar_resources( | ||
aws = tar_resources_aws( | ||
bucket = "relic-test", | ||
prefix = "_targets", | ||
endpoint = "http://localhost:9000" | ||
)), | ||
repository = "aws" | ||
) | ||
') | ||
targets::tar_make(reporter = reporter) | ||
stamp("setup-s3") | ||
} | ||
|
||
dir | ||
} |
Oops, something went wrong.