-
Notifications
You must be signed in to change notification settings - Fork 2
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
sending to cran #68
Comments
@seankross Curious what you think about examples in this package. One approach is to do e.g., #' Are there valid AWS credentials on hand?
#'
#' @export
aws_has_creds <- function() {
res <- tryCatch(
paws.common::locate_credentials(),
error = \(e) e
)
!inherits(res, "error")
}
#' Some exported function
#' @export
#' @examplesIf aws_has_creds()
#' run examples ... BUT - do we think it's a good or at least okay idea to have users that run examples run them against their AWS account? Jenny does this for thoughts? |
I think we should have complete examples that do not get run. Also something we need to think about in terms of "pollution" and writing examples is that anything we do in sixtyfour should be able to be undone in sixtyfour. Does that answer your question? |
For examples that interact with AWS, we'll run examples if:
|
@seankross working on this and I don't think a prompt makes sense given the way *I think* people use examples in docs. if most people do what I do, I just copy paste code from examples and run what I want to run, not necessarily the whole thing given by the maintainer in the man page. I don't think it's a reasonable assumption that users will make sure they run a function that we make at the top of an example block that uses a prompt, but maybe I'm wrong? Maybe instead of a prompt we can have a little roxygen template we can insert into most/all exported fxn docs that's a warning about potential for polluting their account. thoughts? |
I agree with you.
If this is not a heavy lift, let's do this instead. |
shouldn't be, can do |
What are things that need to be done or fixed, etc. before going to cran knowing what we know about the pain that is cran:
Tests
Examples
Currently using a mix of
@examplesIf interactive()
and@examples \dontrun{
for examples ...examplesIf
ordontrun
, but we could try an approach likegoogledrive
uses where it uses@examplesIf drive_has_token()
- whereas we'd use a fxn likeaws_has_creds()
.@examplesIf interactive() && aws_has_token()
whereaws_has_token
checks if there is an access key, secret key, and region set. This means examples would only be checked locally in an interactive R session and with those secrets set.Ideally though (insert SNL gif here) we'd actually allow examples to run more easily, BUT we'd need a way to have some kind of mock AWS account that could be freely hammered with requests, and I don't think that exists
Unfortunately there's no good way of even knowing what credentials the user has, see #71
Vignettes/README
Other
There's sure to be other things that will come up later - this section covers all of those 😄
Dependencies
webmockr
v2 https://github.com/ropensci/webmockr/milestone/20 needs to be on cran before this cran submission can happenThe text was updated successfully, but these errors were encountered: