Skip to content
Merged
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
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ vignettes/figure
start/
minio.deb
^cran-comments\.md$
^[\.]?air\.toml$
5 changes: 3 additions & 2 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ jobs:
MINIO_USER: ${{ secrets.MINIO_USER }}
MINIO_PWD: ${{ secrets.MINIO_PWD }}
MINIO_ENDPOINT: ${{ secrets.MINIO_ENDPOINT }}
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v6

- uses: r-lib/actions/setup-pandoc@v2

Expand All @@ -57,7 +58,7 @@ jobs:

- name: Start Localstack
if: runner.os == 'Linux'
uses: LocalStack/setup-localstack@main
uses: LocalStack/setup-localstack@v0.3.2
with:
image-tag: "latest"
install-awslocal: "true"
Expand Down
20 changes: 5 additions & 15 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
on:
push:
branches: [main, dev]
Expand All @@ -13,19 +12,10 @@ jobs:
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v6

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
- name: Install Air
uses: posit-dev/setup-air@v1

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::lintr, local::.
needs: lint

- name: Lint
run: lintr::lint_package()
shell: Rscript {0}
env:
LINTR_ERROR_ON_LINT: true
- name: Lint with air
run: air format . --check
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,9 @@ tests/fixtures/aws_policy_list_entities*.yml
tests/fixtures/billing*
tests/fixtures/blob*
tests/fixtures/*blob*

# builds
sixtyfour*.tar.gz

# r cmd check output
sixtyfour.Rcheck/
22 changes: 13 additions & 9 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Package: sixtyfour
Title: Humane Interface to Amazon Web Services
Version: 0.2.0
Version: 0.2.4
Authors@R: c(
person("Sean", "Kross", role = "aut"),
person("Scott", "Chamberlain", , "sachamber@fredhutch.org", role = c("aut", "cre"),
comment = c(ORCID = "0000-0003-1444-9135")),
person("Fred Hutchinson Cancer Center", , , "wilds@fredhutch.org", role = "fnd",
comment = c(ROR = "007ps6h72"))
)
Description: An opinionated interface to Amazon Web Services <https://aws.amazon.com>,
Description: An opinionated interface to Amazon Web Services <https://aws.amazon.com>,
with functions for interacting with 'IAM' (Identity and Access Management),
'S3' (Simple Storage Service), 'RDS' (Relational Data Service), Redshift, and Billing.
Lower level functions ('aws_' prefix) are for do it yourself workflows, while
Expand All @@ -20,14 +20,17 @@ Encoding: UTF-8
VignetteBuilder: knitr
Roxygen: list(markdown = TRUE, roclets = c("collate", "namespace", "rd",
"roxyglobals::global_roclet"))
RoxygenNote: 7.3.2
LazyData: true
Depends:
R (>= 4.1.0)
Imports:
dplyr,
paws (>= 0.9.0),
paws.common (>= 0.8.1),
paws.security.identity,
paws.storage,
paws.compute,
paws.database,
paws.cost.management,
purrr,
rlang,
tibble,
Expand All @@ -39,12 +42,10 @@ Imports:
uuid,
jsonlite,
curl,
tidyr,
clipr,
withr,
ipaddress
tidyr
Suggests:
knitr,
withr,
rmarkdown,
roxyglobals,
DBI,
Expand All @@ -54,7 +55,10 @@ Suggests:
lubridate,
testthat (>= 3.0.0),
vcr (>= 0.6.0),
webmockr
webmockr,
clipr,
ipaddress
Config/roxyglobals/filename: globals.R
Config/roxyglobals/unique: FALSE
Config/testthat/edition: 3
Config/roxygen2/version: 8.1.0
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
YEAR: 2025
YEAR: 2026
COPYRIGHT HOLDER: sixtyfour authors
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,11 @@ test:
readme:
${RSCRIPT} -e "knitr::knit('README.Rmd')"

lint_package:
${RSCRIPT} -e "lintr::lint_package()"
lint_check:
air format --check .

lint_fix:
air format .

# use: `make style_file FILE=stuff.R`
# ("R/" is prepended); accepts 1 file only
Expand Down
158 changes: 89 additions & 69 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -118,75 +118,95 @@ export(six_user_creds)
export(six_user_delete)
export(with_redacted)
export(without_verbose)
importFrom(cli,cli_abort)
importFrom(cli,cli_alert_info)
importFrom(cli,cli_alert_success)
importFrom(cli,cli_alert_warning)
importFrom(cli,cli_inform)
importFrom(cli,cli_progress_bar)
importFrom(cli,cli_progress_update)
importFrom(cli,pb_spin)
importFrom(clipr,write_clip)
importFrom(curl,curl_fetch_memory)
importFrom(curl,curl_unescape)
importFrom(dplyr,"%>%")
importFrom(dplyr,bind_rows)
importFrom(dplyr,case_match)
importFrom(dplyr,case_when)
importFrom(dplyr,coalesce)
importFrom(dplyr,distinct)
importFrom(dplyr,filter)
importFrom(dplyr,group_by)
importFrom(dplyr,last_col)
importFrom(dplyr,left_join)
importFrom(dplyr,mutate)
importFrom(dplyr,pull)
importFrom(dplyr,relocate)
importFrom(dplyr,rename)
importFrom(dplyr,rename_with)
importFrom(dplyr,rowwise)
importFrom(dplyr,select)
importFrom(dplyr,starts_with)
importFrom(dplyr,ungroup)
importFrom(fs,dir_ls)
importFrom(fs,file_exists)
importFrom(fs,fs_bytes)
importFrom(fs,is_dir)
importFrom(fs,path)
importFrom(fs,path_join)
importFrom(fs,path_split)
importFrom(cli,
cli_abort,
cli_alert_info,
cli_alert_success,
cli_alert_warning,
cli_inform,
cli_progress_bar,
cli_progress_update,
pb_spin
)
importFrom(curl,
curl_fetch_memory,
curl_unescape
)
importFrom(dplyr,
"%>%",
bind_rows,
case_match,
case_when,
coalesce,
distinct,
filter,
group_by,
last_col,
left_join,
mutate,
pull,
relocate,
rename,
rename_with,
rowwise,
select,
starts_with,
ungroup
)
importFrom(fs,
dir_ls,
file_exists,
fs_bytes,
is_dir,
path,
path_join,
path_split
)
importFrom(glue,glue)
importFrom(ipaddress,ip_address)
importFrom(ipaddress,is_ipv6)
importFrom(jsonlite,fromJSON)
importFrom(jsonlite,toJSON)
importFrom(paws,costexplorer)
importFrom(paws,iam)
importFrom(paws,rds)
importFrom(paws,redshift)
importFrom(paws,s3)
importFrom(jsonlite,
fromJSON,
toJSON
)
importFrom(paws.common,locate_credentials)
importFrom(purrr,compact)
importFrom(purrr,discard)
importFrom(purrr,flatten)
importFrom(purrr,keep)
importFrom(purrr,list_rbind)
importFrom(purrr,map)
importFrom(purrr,map2_vec)
importFrom(purrr,map_chr)
importFrom(purrr,map_lgl)
importFrom(purrr,pluck)
importFrom(purrr,safely)
importFrom(rlang,":=")
importFrom(rlang,abort)
importFrom(rlang,env_poke)
importFrom(rlang,has_name)
importFrom(rlang,is_character)
importFrom(rlang,is_empty)
importFrom(rlang,is_na)
importFrom(s3fs,s3_file_system)
importFrom(s3fs,s3_path)
importFrom(tibble,as_tibble)
importFrom(tibble,tibble)
importFrom(paws.compute,ec2)
importFrom(paws.cost.management,costexplorer)
importFrom(paws.database,
rds,
redshift
)
importFrom(paws.security.identity,
iam,
secretsmanager
)
importFrom(paws.storage,s3)
importFrom(purrr,
compact,
discard,
flatten,
keep,
list_rbind,
map,
map2_vec,
map_chr,
map_lgl,
pluck,
safely
)
importFrom(rlang,
":=",
abort,
env_poke,
has_name,
is_character,
is_empty,
is_na
)
importFrom(s3fs,
s3_file_system,
s3_path
)
importFrom(tibble,
as_tibble,
tibble
)
importFrom(tidyr,pivot_wider)
importFrom(withr,defer)
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# sixtyfour 0.2.4

* depend on paws child packages instead of paws itself (#135) (#136)

# sixtyfour 0.2.0

## NEW FEATURES
Expand Down
17 changes: 16 additions & 1 deletion R/clients.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,29 @@ con_s3fs <- function() {
as_64_con(con, "s3", profile)
}

svc_mapper <- list(
s3 = "paws.storage",
ec2 = "paws.compute",
rds = "paws.database",
redshift = "paws.database",
costexplorer = "paws.cost.management",
iam = "paws.security.identity",
secretsmanager = "paws.security.identity"
)

#' `paws` connection factory
#' @param service (character) any service supported by \pkg{paws}
#' @return a function for returning the client for the service in
#' the `service` parameter
#' @keywords internal
#' @importFrom paws.security.identity iam secretsmanager
#' @importFrom paws.storage s3
#' @importFrom paws.compute ec2
#' @importFrom paws.database rds redshift
#' @importFrom paws.cost.management costexplorer
con_factory <- function(service) {
function() {
svc <- utils::getFromNamespace(service, ns = "paws")
svc <- utils::getFromNamespace(service, ns = svc_mapper[[service]])
profile <- Sys.getenv("AWS_PROFILE", "aws")
if (profile == "minio") {
con <- svc(
Expand Down
3 changes: 2 additions & 1 deletion R/configure.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ print.aws_settings <- function(x, ...) {
#' Without verbose output
#' @export
#' @importFrom rlang env_poke
#' @importFrom withr defer
#' @param code (expression) Code to run without verbose output.
#' @return The results of the evaluation of the code argument
without_verbose <- function(code) {
rlang::check_installed("withr")
rlang::env_poke(env64, "verbose", FALSE)
withr::defer(rlang::env_poke(env64, "verbose", TRUE))
force(code)
Expand All @@ -68,6 +68,7 @@ without_verbose <- function(code) {
#' @param code (expression) Code to run with secrets redacted
#' @return The results of the evaluation of the code argument
with_redacted <- function(code) {
rlang::check_installed("withr")
rlang::env_poke(env64, "redacted", TRUE)
withr::defer(rlang::env_poke(env64, "redacted", FALSE))
force(code)
Expand Down
4 changes: 3 additions & 1 deletion R/database-misc.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ info <- function(id, fun, see_fun = "") {
cli::cli_alert_info("Instance details:")
con_info <- fun(id)
for (i in seq_along(con_info)) {
if (names(con_info)[i] == "status") next
if (names(con_info)[i] == "status") {
next
}
cli::cli_alert_info(" {names(con_info)[i]}: {con_info[[i]]}")
}
}
Expand Down
Loading
Loading