-
Notifications
You must be signed in to change notification settings - Fork 5
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
refactor+docs: set_api_key #217
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple ideas
Co-authored-by: Alex Reinhart <alex@refsmmat.com>
Might be good to go. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Made a few suggestions. There are still some references to "set" in the text; some definitely should still be "set", but not sure if others should be "save" or something else; I didn't see any place where I was convinced just "save" would be better though.
R/auth.R
Outdated
#' We recommend setting your key with `save_api_key()`, which will modify your | ||
#' `.Renviron` file and will persist your key across R sessions (see `?Startup` | ||
#' for a description of `.Renviron` files). Alternatively, you can modify the | ||
#' environment variable in the shell or with `Sys.setenv()`, but these will not | ||
#' persist across sessions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#' We recommend setting your key with `save_api_key()`, which will modify your | |
#' `.Renviron` file and will persist your key across R sessions (see `?Startup` | |
#' for a description of `.Renviron` files). Alternatively, you can modify the | |
#' environment variable in the shell or with `Sys.setenv()`, but these will not | |
#' persist across sessions. | |
#' We recommend setting your key with `save_api_key()`, which will modify an | |
#' applicable `.Renviron` file, which will be read in automatically when you | |
#' start future R sessions (see [`?Startup`][base::Startup] for details on | |
#' `.Renviron` files). Alternatively, you can modify the environment variable at | |
#' the command line before/while launching R, or inside an R session with | |
#' [`Sys.setenv()`], but these will not persist across sessions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GitHub's just randomly not highlighting changes for me in some places. This reworded "your", "persist your key across", "for a description of", and "in the shell", plus added links to ?Startup
and Sys.setenv()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw, ?Startup
and Sys.setenv()
is auto-linked by roxygen (see here for example).
One thing that would be nice, but I imagine might actually be stupidly tricky, is to first tell the user what file is being modified, before they press enter to confirm. [EDIT: just saw the conversation about this above. I did not notice the |
Co-authored-by: brookslogan <lcbrooks@cs.cmu.edu>
Co-authored-by: brookslogan <lcbrooks@cs.cmu.edu>
Co-authored-by: brookslogan <lcbrooks@cs.cmu.edu>
Yea, that'll be hard. I think we found the minimal effort, maximal user gain solution, so we should probably just go with it. I thought about manually appending to |
btw, this document command looks super handy with GitHub suggestions. Very cool. (And doesn't seem like there should be conflicts if you need to rebase local changes made in parallel to the doc commits.) |
Right? It works well enough. (Wonder if we can have CI trigger from its commits too, because sometimes people push without documenting NAMESPACE changes, the CI breaks, but then the CI document pushes a change, but the status of the CI doesn't change to passing. But tuning GH CI often feels like another "pencil straightening" exercise to me.) |
closes #181
Changes:
get_api_key()
only reads from environment variable now, no R optionssave_api_key()
now instructs the user to write their key and dynamically opens~/.Renviron
orproj_root/.Renviron