From e9872a383248a23b84c0296b0500502d5b997fb7 Mon Sep 17 00:00:00 2001 From: Jenny Bryan Date: Thu, 25 Jul 2024 11:16:27 -0700 Subject: [PATCH 1/9] Remove long-deprecated functions and arguments --- NAMESPACE | 8 -- R/create.R | 10 +- R/github-labels.R | 21 +---- R/github.R | 30 +----- R/release.R | 13 +-- R/usethis-defunct.R | 194 +------------------------------------- man/create_from_github.Rd | 10 +- man/git_credentials.Rd | 39 -------- man/use_github.Rd | 10 +- man/use_github_actions.Rd | 2 +- man/use_github_labels.Rd | 10 +- man/use_github_links.Rd | 10 +- man/use_github_release.Rd | 10 +- man/use_tidy_labels.Rd | 6 +- man/use_travis.Rd | 31 ------ 15 files changed, 19 insertions(+), 385 deletions(-) delete mode 100644 man/git_credentials.Rd delete mode 100644 man/use_travis.Rd diff --git a/NAMESPACE b/NAMESPACE index 65d3ef186..a22b9c57e 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -14,7 +14,6 @@ export(browse_github_issues) export(browse_github_pulls) export(browse_package) export(browse_project) -export(browse_travis) export(create_download_url) export(create_from_github) export(create_github_token) @@ -34,7 +33,6 @@ export(edit_rstudio_snippets) export(edit_template) export(gh_token_help) export(git_branch_default) -export(git_credentials) export(git_default_branch) export(git_default_branch_configure) export(git_default_branch_rediscover) @@ -87,8 +85,6 @@ export(use_agpl3_license) export(use_agpl_license) export(use_apache_license) export(use_apl2_license) -export(use_appveyor) -export(use_appveyor_badge) export(use_article) export(use_author) export(use_badge) @@ -121,7 +117,6 @@ export(use_devtools) export(use_directory) export(use_git) export(use_git_config) -export(use_git_credentials) export(use_git_hook) export(use_git_ignore) export(use_git_protocol) @@ -159,7 +154,6 @@ export(use_partial_warnings) export(use_pipe) export(use_pkgdown) export(use_pkgdown_github_pages) -export(use_pkgdown_travis) export(use_posit_cloud_badge) export(use_proprietary_license) export(use_r) @@ -198,8 +192,6 @@ export(use_tidy_style) export(use_tidy_support) export(use_tidy_thanks) export(use_tidy_upkeep_issue) -export(use_travis) -export(use_travis_badge) export(use_tutorial) export(use_upkeep_issue) export(use_usethis) diff --git a/R/create.R b/R/create.R index c1b1281e0..0275ed886 100644 --- a/R/create.R +++ b/R/create.R @@ -188,15 +188,7 @@ create_from_github <- function(repo_spec, rstudio = NULL, open = rlang::is_interactive(), protocol = git_protocol(), - host = NULL, - auth_token = deprecated(), - credentials = deprecated()) { - if (lifecycle::is_present(auth_token)) { - deprecate_warn_auth_token("create_from_github") - } - if (lifecycle::is_present(credentials)) { - deprecate_warn_credentials("create_from_github") - } + host = NULL) { check_protocol(protocol) parsed_repo_spec <- parse_repo_url(repo_spec) diff --git a/R/github-labels.R b/R/github-labels.R index cb5a37e3b..7da4f1d80 100644 --- a/R/github-labels.R +++ b/R/github-labels.R @@ -43,10 +43,6 @@ #' This keeps the issue page visually harmonious while still giving enough #' variation to easily distinguish different types of label. #' -#' @param repo_spec,host,auth_token `r lifecycle::badge("deprecated")`: These -#' arguments are now deprecated and will be removed in the future. Any input -#' provided via these arguments is not used. The target repo, host, and auth -#' token are all now determined from the current project's Git remotes. #' @param labels A character vector giving labels to add. #' @param rename A named vector with names giving old names and values giving #' new names. @@ -77,24 +73,11 @@ #' descriptions = c("foofiest" = "the foofiest issue you ever saw") #' ) #' } -use_github_labels <- function(repo_spec = deprecated(), - labels = character(), +use_github_labels <- function(labels = character(), rename = character(), colours = character(), descriptions = character(), - delete_default = FALSE, - host = deprecated(), - auth_token = deprecated()) { - if (lifecycle::is_present(repo_spec)) { - deprecate_warn_repo_spec("use_github_labels") - } - if (lifecycle::is_present(host)) { - deprecate_warn_host("use_github_labels") - } - if (lifecycle::is_present(auth_token)) { - deprecate_warn_auth_token("use_github_labels") - } - + delete_default = FALSE) { tr <- target_repo(github_get = TRUE, ok_configs = c("ours", "fork")) check_can_push(tr = tr, "to modify labels") diff --git a/R/github.R b/R/github.R index 2ee06f7ea..c3eb0affb 100644 --- a/R/github.R +++ b/R/github.R @@ -39,11 +39,6 @@ #' For a hypothetical GitHub Enterprise instance, either #' "https://github.acme.com/api/v3" or "https://github.acme.com" is #' acceptable. -#' @param auth_token,credentials `r lifecycle::badge("deprecated")`: No longer -#' consulted now that usethis uses the gert package for Git operations, -#' instead of git2r; gert relies on the credentials package for auth. The API -#' requests are now authorized with the token associated with the `host`, as -#' retrieved by [gh::gh_token()]. #' #' @export #' @examples @@ -61,16 +56,7 @@ use_github <- function(organisation = NULL, private = FALSE, visibility = c("public", "private", "internal"), protocol = git_protocol(), - host = NULL, - auth_token = deprecated(), - credentials = deprecated()) { - if (lifecycle::is_present(auth_token)) { - deprecate_warn_auth_token("use_github") - } - if (lifecycle::is_present(credentials)) { - deprecate_warn_credentials("use_github") - } - + host = NULL) { visibility_specified <- !missing(visibility) visibility <- match.arg(visibility) check_protocol(protocol) @@ -197,9 +183,6 @@ use_github <- function(organisation = NULL, #' an interactive session, the user can confirm which repo to use for the #' links. In a noninteractive session, links are formed using `upstream`. #' -#' @param host,auth_token `r lifecycle::badge("deprecated")`: No longer consulted -#' now that usethis consults the current project's GitHub remotes to get the -#' `host` and then relies on gh to discover an appropriate token. #' @param overwrite By default, `use_github_links()` will not overwrite existing #' fields. Set to `TRUE` to overwrite existing links. #' @export @@ -208,16 +191,7 @@ use_github <- function(organisation = NULL, #' use_github_links() #' } #' -use_github_links <- function(auth_token = deprecated(), - host = deprecated(), - overwrite = FALSE) { - if (lifecycle::is_present(auth_token)) { - deprecate_warn_auth_token("use_github_links") - } - if (lifecycle::is_present(host)) { - deprecate_warn_host("use_github_links") - } - +use_github_links <- function(overwrite = FALSE) { check_is_package("use_github_links()") gh_url <- github_url_from_git_remotes() diff --git a/R/release.R b/R/release.R index 1773766ae..1f69c2440 100644 --- a/R/release.R +++ b/R/release.R @@ -217,22 +217,11 @@ release_type <- function(version) { #' assume that current state (SHA of `HEAD`, package version, NEWS) is the #' submitted state. #' -#' @param host,auth_token `r lifecycle::badge("deprecated")`: No longer -#' consulted now that usethis allows the gh package to lookup a token based on -#' a URL determined from the current project's GitHub remotes. #' @param publish If `TRUE`, publishes a release. If `FALSE`, creates a draft #' release. #' @export -use_github_release <- function(publish = TRUE, - host = deprecated(), - auth_token = deprecated()) { +use_github_release <- function(publish = TRUE) { check_is_package("use_github_release()") - if (lifecycle::is_present(host)) { - deprecate_warn_host("use_github_release") - } - if (lifecycle::is_present(auth_token)) { - deprecate_warn_auth_token("use_github_release") - } tr <- target_repo(github_get = TRUE, ok_configs = c("ours", "fork")) check_can_push(tr = tr, "to create a release") diff --git a/R/usethis-defunct.R b/R/usethis-defunct.R index eb0c9cd8f..f5892c2b3 100644 --- a/R/usethis-defunct.R +++ b/R/usethis-defunct.R @@ -12,14 +12,14 @@ git_branch_default <- function() { git_default_branch() } -#' Defunct tidyverse functions +#' Deprecated tidyverse functions #' #' @description -#' `r lifecycle::badge("defunct")` +#' `r lifecycle::badge("deprecated")` #' #' * `use_tidy_labels()` has been replaced by [use_tidy_github_labels()]. #' * `use_tidy_ci()` has been replaced by [use_tidy_github_actions()]. -#' * `use_tidy_eval()` is defunct because there's no longer a need to +#' * `use_tidy_eval()` is deprecated because there's no longer a need to #' systematically import and re-export a large number of functions in order #' to use tidy evaluation. Instead, use [use_import_from()] to tactically #' import functions as you need them. @@ -51,195 +51,9 @@ use_tidy_eval <- function() { ) } -#' Defunct git2r functions -#' -#' @description -#' `r lifecycle::badge("defunct")` -#' -#' In usethis v2.0.0, usethis switched from git2r to gert (+ credentials) for -#' all Git operations. This pair of packages (gert + credentials) is designed to -#' discover and use the same credentials as command line Git. As a result, a -#' great deal of credential-handling assistance has been removed from usethis, -#' primarily around SSH keys. -#' -#' If you have credential problems, focus your troubleshooting on getting the -#' credentials package to find your credentials. The [introductory -#' vignette](https://docs.ropensci.org/credentials/articles/intro.html) -#' is a good place to start. -#' -#' If you use the HTTPS protocol (which we recommend), a GitHub personal access -#' token will satisfy all auth needs, for both Git and the GitHub API, and is -#' therefore the easiest approach to get working. See [gh_token_help()] for -#' more. -#' -#' @param protocol Deprecated. -#' @param auth_token Deprecated. -#' @param credentials Deprecated. -#' -#' @return These functions raise a warning and return an invisible `NULL`. -#' @export -git_credentials <- function(protocol = deprecated(), - auth_token = deprecated()) { - lifecycle::deprecate_stop( - "2.0.0", - "git_credentials()", - details = git2r_explanation - ) - invisible() -} - -#' @rdname git_credentials -#' @export -use_git_credentials <- function(credentials = deprecated()) { - lifecycle::deprecate_stop( - "2.0.0", - "use_git_credentials()", - details = git2r_explanation - ) - invisible() -} - -git2r_explanation <- glue(" - usethis now uses the gert package for Git operations, instead of git2r, and - gert relies on the credentials package for auth. Therefore git2r credentials - are no longer accepted.") - -deprecate_warn_credentials <- function(whos_asking, details = NULL) { - whos_asking <- sub("[()]+$", "", whos_asking) - what <- glue("{whos_asking}(credentials = )") - - lifecycle::deprecate_warn( - "2.0.0", - what, - details = details %||% git2r_explanation - ) -} - -deprecate_warn_host <- function(whos_asking, details = NULL) { - whos_asking <- sub("[()]+$", "", whos_asking) - what <- glue("{whos_asking}(host = )") - - host_explanation <- glue(" - usethis now determines the `host` from the current project's \\ - Git remotes. - The `host` argument is ignored and will eventually be removed.") - - lifecycle::deprecate_warn( - "2.0.0", - what, - details = details %||% host_explanation - ) -} - -deprecate_warn_auth_token <- function(whos_asking, details = NULL) { - whos_asking <- sub("[()]+$", "", whos_asking) - what <- glue("{whos_asking}(auth_token = )") - - auth_token_explanation <- glue(" - usethis now delegates token lookup to the gh package, which retrieves \\ - credentials based on the targeted host URL. - This URL is determined by the current project's Git remotes. - The `auth_token` argument is ignored and will eventually be removed.") - - lifecycle::deprecate_warn( - "2.0.0", - what, - details = details %||% auth_token_explanation - ) -} - -deprecate_warn_repo_spec <- function(whos_asking, details = NULL) { - whos_asking <- sub("[()]+$", "", whos_asking) - what <- glue("{whos_asking}(repo_spec = )") - - repo_spec_explanation <- glue(" - usethis now consults the current project's Git remotes to determine the \\ - target repo. - The `repo_spec` argument is ignored and will eventually be removed.") - - lifecycle::deprecate_warn( - "2.0.0", - what, - details = details %||% repo_spec_explanation - ) -} - - -# ci ---------------------------------------------------------------------- - - -#' Defunct Travis and Appveyor functions -#' -#' @description -#' `r lifecycle::badge("defunct")` -#' -#' These functions which formally supported CI on Appveyor and Travis are -#' now defunct as we no longer recommend using these services. We now -#' recommend using GitHub actions, e.g. with [use_github_action()]. -#' -#' @export -#' @keywords internal -use_travis <- function(browse = rlang::is_interactive(), - ext = c("com", "org")) { - - lifecycle::deprecate_stop( - when = "2.0.0", - what = "use_travis()", - with = "use_github_action()" - ) -} - -#' @export -#' @rdname use_travis -use_travis_badge <- function(ext = c("com", "org"), repo_spec = NULL) { - lifecycle::deprecate_stop( - when = "2.0.0", - what = "use_travis_badge()" - ) -} - -#' @export -#' @rdname use_travis -use_pkgdown_travis <- function() { - lifecycle::deprecate_stop( - when = "2.0.0", - what = "use_pkgdown_travis()", - with = "use_pkgdown_github_pages()" - ) -} - -#' @export -#' @rdname use_travis -use_appveyor <- function(browse = rlang::is_interactive()) { - lifecycle::deprecate_stop( - when = "2.0.0", - what = "use_appveyor()", - with = "use_github_action()" - ) -} - -#' @export -#' @rdname use_travis -use_appveyor_badge <- function(repo_spec = NULL) { - lifecycle::deprecate_stop( - when = "2.0.0", - what = "use_appveyor_badge()", - ) -} - -#' @export -#' @rdname use_travis -browse_travis <- function(package = NULL, ext = c("com", "org")) { - lifecycle::deprecate_stop( - when = "2.2.0", - what = "browse_travis()", - ) -} - - # GitHub actions -------------------------------------------------------------- -#' Defunct GitHub Actions workflows +#' Deprecated GitHub Actions functions #' #' @description #' `r lifecycle::badge("deprecated")` diff --git a/man/create_from_github.Rd b/man/create_from_github.Rd index ff901adc9..ceab18cac 100644 --- a/man/create_from_github.Rd +++ b/man/create_from_github.Rd @@ -11,9 +11,7 @@ create_from_github( rstudio = NULL, open = rlang::is_interactive(), protocol = git_protocol(), - host = NULL, - auth_token = deprecated(), - credentials = deprecated() + host = NULL ) } \arguments{ @@ -69,12 +67,6 @@ variable. For a hypothetical GitHub Enterprise instance, either "https://github.acme.com/api/v3" or "https://github.acme.com" is acceptable.} - -\item{auth_token, credentials}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}}: No longer -consulted now that usethis uses the gert package for Git operations, -instead of git2r; gert relies on the credentials package for auth. The API -requests are now authorized with the token associated with the \code{host}, as -retrieved by \code{\link[gh:gh_token]{gh::gh_token()}}.} } \description{ Creates a new local project and Git repository from a repo on GitHub, by diff --git a/man/git_credentials.Rd b/man/git_credentials.Rd deleted file mode 100644 index 7a445b69c..000000000 --- a/man/git_credentials.Rd +++ /dev/null @@ -1,39 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/usethis-defunct.R -\name{git_credentials} -\alias{git_credentials} -\alias{use_git_credentials} -\title{Defunct git2r functions} -\usage{ -git_credentials(protocol = deprecated(), auth_token = deprecated()) - -use_git_credentials(credentials = deprecated()) -} -\arguments{ -\item{protocol}{Deprecated.} - -\item{auth_token}{Deprecated.} - -\item{credentials}{Deprecated.} -} -\value{ -These functions raise a warning and return an invisible \code{NULL}. -} -\description{ -\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#defunct}{\figure{lifecycle-defunct.svg}{options: alt='[Defunct]'}}}{\strong{[Defunct]}} - -In usethis v2.0.0, usethis switched from git2r to gert (+ credentials) for -all Git operations. This pair of packages (gert + credentials) is designed to -discover and use the same credentials as command line Git. As a result, a -great deal of credential-handling assistance has been removed from usethis, -primarily around SSH keys. - -If you have credential problems, focus your troubleshooting on getting the -credentials package to find your credentials. The \href{https://docs.ropensci.org/credentials/articles/intro.html}{introductory vignette} -is a good place to start. - -If you use the HTTPS protocol (which we recommend), a GitHub personal access -token will satisfy all auth needs, for both Git and the GitHub API, and is -therefore the easiest approach to get working. See \code{\link[=gh_token_help]{gh_token_help()}} for -more. -} diff --git a/man/use_github.Rd b/man/use_github.Rd index 134d300d7..3402239f7 100644 --- a/man/use_github.Rd +++ b/man/use_github.Rd @@ -9,9 +9,7 @@ use_github( private = FALSE, visibility = c("public", "private", "internal"), protocol = git_protocol(), - host = NULL, - auth_token = deprecated(), - credentials = deprecated() + host = NULL ) } \arguments{ @@ -39,12 +37,6 @@ environment variable. For a hypothetical GitHub Enterprise instance, either "https://github.acme.com/api/v3" or "https://github.acme.com" is acceptable.} - -\item{auth_token, credentials}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}}: No longer -consulted now that usethis uses the gert package for Git operations, -instead of git2r; gert relies on the credentials package for auth. The API -requests are now authorized with the token associated with the \code{host}, as -retrieved by \code{\link[gh:gh_token]{gh::gh_token()}}.} } \description{ \code{use_github()} takes a local project and: diff --git a/man/use_github_actions.Rd b/man/use_github_actions.Rd index dd7532346..dc77d6a62 100644 --- a/man/use_github_actions.Rd +++ b/man/use_github_actions.Rd @@ -6,7 +6,7 @@ \alias{use_github_action_check_standard} \alias{use_github_action_pr_commands} \alias{use_github_action_check_full} -\title{Defunct GitHub Actions workflows} +\title{Deprecated GitHub Actions functions} \usage{ use_github_actions() diff --git a/man/use_github_labels.Rd b/man/use_github_labels.Rd index 5a7732fe3..9433ba7ed 100644 --- a/man/use_github_labels.Rd +++ b/man/use_github_labels.Rd @@ -10,14 +10,11 @@ \title{Manage GitHub issue labels} \usage{ use_github_labels( - repo_spec = deprecated(), labels = character(), rename = character(), colours = character(), descriptions = character(), - delete_default = FALSE, - host = deprecated(), - auth_token = deprecated() + delete_default = FALSE ) use_tidy_github_labels() @@ -31,11 +28,6 @@ tidy_label_colours() tidy_label_descriptions() } \arguments{ -\item{repo_spec, host, auth_token}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}}: These -arguments are now deprecated and will be removed in the future. Any input -provided via these arguments is not used. The target repo, host, and auth -token are all now determined from the current project's Git remotes.} - \item{labels}{A character vector giving labels to add.} \item{rename}{A named vector with names giving old names and values giving diff --git a/man/use_github_links.Rd b/man/use_github_links.Rd index b42928b29..798e9f4c4 100644 --- a/man/use_github_links.Rd +++ b/man/use_github_links.Rd @@ -4,17 +4,9 @@ \alias{use_github_links} \title{Use GitHub links in URL and BugReports} \usage{ -use_github_links( - auth_token = deprecated(), - host = deprecated(), - overwrite = FALSE -) +use_github_links(overwrite = FALSE) } \arguments{ -\item{host, auth_token}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}}: No longer consulted -now that usethis consults the current project's GitHub remotes to get the -\code{host} and then relies on gh to discover an appropriate token.} - \item{overwrite}{By default, \code{use_github_links()} will not overwrite existing fields. Set to \code{TRUE} to overwrite existing links.} } diff --git a/man/use_github_release.Rd b/man/use_github_release.Rd index 2fc78ae3b..7877fbd9f 100644 --- a/man/use_github_release.Rd +++ b/man/use_github_release.Rd @@ -4,19 +4,11 @@ \alias{use_github_release} \title{Publish a GitHub release} \usage{ -use_github_release( - publish = TRUE, - host = deprecated(), - auth_token = deprecated() -) +use_github_release(publish = TRUE) } \arguments{ \item{publish}{If \code{TRUE}, publishes a release. If \code{FALSE}, creates a draft release.} - -\item{host, auth_token}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}}: No longer -consulted now that usethis allows the gh package to lookup a token based on -a URL determined from the current project's GitHub remotes.} } \description{ Pushes the current branch (if safe) then publishes a GitHub release for the diff --git a/man/use_tidy_labels.Rd b/man/use_tidy_labels.Rd index 6cce8aca8..06a69a458 100644 --- a/man/use_tidy_labels.Rd +++ b/man/use_tidy_labels.Rd @@ -4,7 +4,7 @@ \alias{use_tidy_labels} \alias{use_tidy_ci} \alias{use_tidy_eval} -\title{Defunct tidyverse functions} +\title{Deprecated tidyverse functions} \usage{ use_tidy_labels() @@ -13,11 +13,11 @@ use_tidy_ci(...) use_tidy_eval() } \description{ -\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#defunct}{\figure{lifecycle-defunct.svg}{options: alt='[Defunct]'}}}{\strong{[Defunct]}} +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} \itemize{ \item \code{use_tidy_labels()} has been replaced by \code{\link[=use_tidy_github_labels]{use_tidy_github_labels()}}. \item \code{use_tidy_ci()} has been replaced by \code{\link[=use_tidy_github_actions]{use_tidy_github_actions()}}. -\item \code{use_tidy_eval()} is defunct because there's no longer a need to +\item \code{use_tidy_eval()} is deprecated because there's no longer a need to systematically import and re-export a large number of functions in order to use tidy evaluation. Instead, use \code{\link[=use_import_from]{use_import_from()}} to tactically import functions as you need them. diff --git a/man/use_travis.Rd b/man/use_travis.Rd deleted file mode 100644 index ee1e5b08b..000000000 --- a/man/use_travis.Rd +++ /dev/null @@ -1,31 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/usethis-defunct.R -\name{use_travis} -\alias{use_travis} -\alias{use_travis_badge} -\alias{use_pkgdown_travis} -\alias{use_appveyor} -\alias{use_appveyor_badge} -\alias{browse_travis} -\title{Defunct Travis and Appveyor functions} -\usage{ -use_travis(browse = rlang::is_interactive(), ext = c("com", "org")) - -use_travis_badge(ext = c("com", "org"), repo_spec = NULL) - -use_pkgdown_travis() - -use_appveyor(browse = rlang::is_interactive()) - -use_appveyor_badge(repo_spec = NULL) - -browse_travis(package = NULL, ext = c("com", "org")) -} -\description{ -\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#defunct}{\figure{lifecycle-defunct.svg}{options: alt='[Defunct]'}}}{\strong{[Defunct]}} - -These functions which formally supported CI on Appveyor and Travis are -now defunct as we no longer recommend using these services. We now -recommend using GitHub actions, e.g. with \code{\link[=use_github_action]{use_github_action()}}. -} -\keyword{internal} From 30af4ff80f26fcfd303837430fa699a57fa34023 Mon Sep 17 00:00:00 2001 From: Jenny Bryan Date: Thu, 25 Jul 2024 11:16:57 -0700 Subject: [PATCH 2/9] Update pkgdown --- _pkgdown.yml | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/_pkgdown.yml b/_pkgdown.yml index fbc30fc2c..9c695e329 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -155,20 +155,15 @@ reference: - use_rmarkdown_template - use_rstudio - use_rstudio_preferences - - title: Defunct and deprecated functions + - title: Deprecated functions desc: > - - Defunct lifecycle - - + Deprecated lifecycle contents: - - git_credentials - git_branch_default - use_github_actions - use_tidy_labels - - use_travis articles: - title: Basics @@ -187,8 +182,3 @@ articles: contents: - articles/ui-cli-conversion - articles/badge-accessibility - -redirects: - - ["reference/browse_github_pat.html", "reference/github-token.html"] - - ["reference/pr_pull_upstream.html","reference/pull-requests.html"] - - ["reference/browse_github_token.html", "reference/github-token.html"] From 80d3ef18c488afe4b651ae5df0a76f0902441f4d Mon Sep 17 00:00:00 2001 From: Jenny Bryan Date: Thu, 25 Jul 2024 11:18:13 -0700 Subject: [PATCH 3/9] Get rid of lifecycle stages we no longer use --- inst/templates/lifecycle-archived.svg | 21 -------------------- inst/templates/lifecycle-defunct.svg | 21 -------------------- inst/templates/lifecycle-maturing.svg | 21 -------------------- inst/templates/lifecycle-questioning.svg | 21 -------------------- inst/templates/lifecycle-soft-deprecated.svg | 21 -------------------- man/figures/lifecycle-archived.svg | 21 -------------------- man/figures/lifecycle-defunct.svg | 21 -------------------- man/figures/lifecycle-maturing.svg | 21 -------------------- man/figures/lifecycle-questioning.svg | 21 -------------------- man/figures/lifecycle-soft-deprecated.svg | 21 -------------------- 10 files changed, 210 deletions(-) delete mode 100644 inst/templates/lifecycle-archived.svg delete mode 100644 inst/templates/lifecycle-defunct.svg delete mode 100644 inst/templates/lifecycle-maturing.svg delete mode 100644 inst/templates/lifecycle-questioning.svg delete mode 100644 inst/templates/lifecycle-soft-deprecated.svg delete mode 100644 man/figures/lifecycle-archived.svg delete mode 100644 man/figures/lifecycle-defunct.svg delete mode 100644 man/figures/lifecycle-maturing.svg delete mode 100644 man/figures/lifecycle-questioning.svg delete mode 100644 man/figures/lifecycle-soft-deprecated.svg diff --git a/inst/templates/lifecycle-archived.svg b/inst/templates/lifecycle-archived.svg deleted file mode 100644 index 745ab0c78..000000000 --- a/inst/templates/lifecycle-archived.svg +++ /dev/null @@ -1,21 +0,0 @@ - - lifecycle: archived - - - - - - - - - - - - - - - lifecycle - - archived - - diff --git a/inst/templates/lifecycle-defunct.svg b/inst/templates/lifecycle-defunct.svg deleted file mode 100644 index d5c9559ed..000000000 --- a/inst/templates/lifecycle-defunct.svg +++ /dev/null @@ -1,21 +0,0 @@ - - lifecycle: defunct - - - - - - - - - - - - - - - lifecycle - - defunct - - diff --git a/inst/templates/lifecycle-maturing.svg b/inst/templates/lifecycle-maturing.svg deleted file mode 100644 index 897370ecf..000000000 --- a/inst/templates/lifecycle-maturing.svg +++ /dev/null @@ -1,21 +0,0 @@ - - lifecycle: maturing - - - - - - - - - - - - - - - lifecycle - - maturing - - diff --git a/inst/templates/lifecycle-questioning.svg b/inst/templates/lifecycle-questioning.svg deleted file mode 100644 index 7c1721d05..000000000 --- a/inst/templates/lifecycle-questioning.svg +++ /dev/null @@ -1,21 +0,0 @@ - - lifecycle: questioning - - - - - - - - - - - - - - - lifecycle - - questioning - - diff --git a/inst/templates/lifecycle-soft-deprecated.svg b/inst/templates/lifecycle-soft-deprecated.svg deleted file mode 100644 index 9c166ff30..000000000 --- a/inst/templates/lifecycle-soft-deprecated.svg +++ /dev/null @@ -1,21 +0,0 @@ - - lifecycle: soft-deprecated - - - - - - - - - - - - - - - lifecycle - - soft-deprecated - - diff --git a/man/figures/lifecycle-archived.svg b/man/figures/lifecycle-archived.svg deleted file mode 100644 index 745ab0c78..000000000 --- a/man/figures/lifecycle-archived.svg +++ /dev/null @@ -1,21 +0,0 @@ - - lifecycle: archived - - - - - - - - - - - - - - - lifecycle - - archived - - diff --git a/man/figures/lifecycle-defunct.svg b/man/figures/lifecycle-defunct.svg deleted file mode 100644 index d5c9559ed..000000000 --- a/man/figures/lifecycle-defunct.svg +++ /dev/null @@ -1,21 +0,0 @@ - - lifecycle: defunct - - - - - - - - - - - - - - - lifecycle - - defunct - - diff --git a/man/figures/lifecycle-maturing.svg b/man/figures/lifecycle-maturing.svg deleted file mode 100644 index 897370ecf..000000000 --- a/man/figures/lifecycle-maturing.svg +++ /dev/null @@ -1,21 +0,0 @@ - - lifecycle: maturing - - - - - - - - - - - - - - - lifecycle - - maturing - - diff --git a/man/figures/lifecycle-questioning.svg b/man/figures/lifecycle-questioning.svg deleted file mode 100644 index 7c1721d05..000000000 --- a/man/figures/lifecycle-questioning.svg +++ /dev/null @@ -1,21 +0,0 @@ - - lifecycle: questioning - - - - - - - - - - - - - - - lifecycle - - questioning - - diff --git a/man/figures/lifecycle-soft-deprecated.svg b/man/figures/lifecycle-soft-deprecated.svg deleted file mode 100644 index 9c166ff30..000000000 --- a/man/figures/lifecycle-soft-deprecated.svg +++ /dev/null @@ -1,21 +0,0 @@ - - lifecycle: soft-deprecated - - - - - - - - - - - - - - - lifecycle - - soft-deprecated - - From e6e489d90712251646ca919c7b78f59549b687ab Mon Sep 17 00:00:00 2001 From: Jenny Bryan Date: Thu, 25 Jul 2024 11:26:49 -0700 Subject: [PATCH 4/9] Embrace "deprecated" over "defunct" --- .covrignore | 2 +- R/{usethis-defunct.R => usethis-deprecated.R} | 0 man/git_branch_default.Rd | 2 +- man/use_github_actions.Rd | 2 +- man/use_tidy_labels.Rd | 2 +- .../_snaps/{usethis-defunct.md => usethis-deprecated.md} | 2 +- .../{test-usethis-defunct.R => test-usethis-deprecated.R} | 3 +-- 7 files changed, 6 insertions(+), 7 deletions(-) rename R/{usethis-defunct.R => usethis-deprecated.R} (100%) rename tests/testthat/_snaps/{usethis-defunct.md => usethis-deprecated.md} (91%) rename tests/testthat/{test-usethis-defunct.R => test-usethis-deprecated.R} (72%) diff --git a/.covrignore b/.covrignore index e18d9803c..1f7274455 100644 --- a/.covrignore +++ b/.covrignore @@ -1,3 +1,3 @@ R/deprec-*.R R/compat-*.R -R/usethis-defunct.R +R/usethis-deprecated.R diff --git a/R/usethis-defunct.R b/R/usethis-deprecated.R similarity index 100% rename from R/usethis-defunct.R rename to R/usethis-deprecated.R diff --git a/man/git_branch_default.Rd b/man/git_branch_default.Rd index 2d81e8542..42d5395de 100644 --- a/man/git_branch_default.Rd +++ b/man/git_branch_default.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/usethis-defunct.R +% Please edit documentation in R/usethis-deprecated.R \name{git_branch_default} \alias{git_branch_default} \title{Deprecated Git functions} diff --git a/man/use_github_actions.Rd b/man/use_github_actions.Rd index dc77d6a62..1bc46c634 100644 --- a/man/use_github_actions.Rd +++ b/man/use_github_actions.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/usethis-defunct.R +% Please edit documentation in R/usethis-deprecated.R \name{use_github_actions} \alias{use_github_actions} \alias{use_github_action_check_release} diff --git a/man/use_tidy_labels.Rd b/man/use_tidy_labels.Rd index 06a69a458..a6b43292c 100644 --- a/man/use_tidy_labels.Rd +++ b/man/use_tidy_labels.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/usethis-defunct.R +% Please edit documentation in R/usethis-deprecated.R \name{use_tidy_labels} \alias{use_tidy_labels} \alias{use_tidy_ci} diff --git a/tests/testthat/_snaps/usethis-defunct.md b/tests/testthat/_snaps/usethis-deprecated.md similarity index 91% rename from tests/testthat/_snaps/usethis-defunct.md rename to tests/testthat/_snaps/usethis-deprecated.md index 28fe75572..c752fb4d3 100644 --- a/tests/testthat/_snaps/usethis-defunct.md +++ b/tests/testthat/_snaps/usethis-deprecated.md @@ -1,4 +1,4 @@ -# use_tidy_eval() is defunct +# use_tidy_eval() is deprecated Code use_tidy_eval() diff --git a/tests/testthat/test-usethis-defunct.R b/tests/testthat/test-usethis-deprecated.R similarity index 72% rename from tests/testthat/test-usethis-defunct.R rename to tests/testthat/test-usethis-deprecated.R index c1612661b..4b385372c 100644 --- a/tests/testthat/test-usethis-defunct.R +++ b/tests/testthat/test-usethis-deprecated.R @@ -1,7 +1,6 @@ -test_that("use_tidy_eval() is defunct", { +test_that("use_tidy_eval() is deprecated", { skip_if_not_installed("roxygen2") pkg <- create_local_package() expect_snapshot(use_tidy_eval(), error = TRUE) }) - From cc1b9a3d120698a4f83c5b66f245f18f15791bde Mon Sep 17 00:00:00 2001 From: Jenny Bryan Date: Thu, 25 Jul 2024 11:31:24 -0700 Subject: [PATCH 5/9] Update NEWS --- NEWS.md | 40 +++++++++++++++++++++++++++++++++++----- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/NEWS.md b/NEWS.md index 12dea1720..8b50ae5af 100644 --- a/NEWS.md +++ b/NEWS.md @@ -44,6 +44,36 @@ * `usethis::use_version()` now tolerates empty / blank lines preceding the first section title in the package NEWS file. (#1976) +## Deprecated function and argument removal + +We are removing functions and arguments that were deprecated as of usethis +v2.0.0, which was released in December 2020. + +These changes have been in place for a long time now: + +* Switch from git2r to gert (+ credentials). +* Use of git config and the gh package to infer, e.g., the target repo spec. +* Pivot towards GitHub Actions and away from Travis and AppVeyor. + +Functions that are removed: + +* `git_credentials()` +* `use_git_credentials()` +* `use_appveyor()` +* `use_appveyor_badge()` +* `use_travis()` +* `use_travis_badge()` +* `browse_travis()` +* `use_pkgdown_travis()` + +Function arguments that are removed: + +* `create_from_github(auth_token =, credentials =)` +* `use_github(auth_token =, credentials =)` +* `use_github_labels(repo_spec =, host =, auth_token =)` +* `use_github_links(auth_token =, host =)` +* `use_github_release(host =, auth_token =)` + # usethis 2.2.3 * Patch release with changes to `.Rd` files requested by CRAN. @@ -206,14 +236,14 @@ * `use_tidy_logo()` is a new function that calls `use_logo()` on the appropriate hex sticker PNG file at (#1871). -## Defunct functions +## Deprecated functions -* `use_tidy_eval()` is now defunct because it imports and re-exports a large +* `use_tidy_eval()` is now deprecated because it imports and re-exports a large number of functions that are no longer needed in order to do tidy evaluation (#1656). * `use_travis()`, `use_pkgdown_travis()`, `browse_travis()`, and `use_appveyor()` - are now defunct because we no longer recommend Travis or Appveyor. We + are now deprecated because we no longer recommend Travis or Appveyor. We recommend GitHub actions instead (#1517). # usethis 2.1.6 @@ -531,7 +561,7 @@ GitHub Actions is the preferred platform for continuous integration, because tha `use_tidy_pkgdown()` implements the complete pkgdown configuration used by the tidyverse team (#224). -`pr_sync()` is defunct and can be replicated by calling `pr_pull()`, `pr_merge_main()`, then `pr_push()`. +`pr_sync()` is deprecated and can be replicated by calling `pr_pull()`, `pr_merge_main()`, then `pr_push()`. ## Licensing improvements @@ -1183,7 +1213,7 @@ build paths within it (#415, #425). * `create_from_github()`: the `repo` argument is renamed to `repo_spec`, since it takes input of the form "OWNER/REPO" (#376). -* `use_depsy_badge()` is defunct. The Depsy project has officially concluded and is no longer being maintained (#354). +* `use_depsy_badge()` is deprecated. The Depsy project has officially concluded and is no longer being maintained (#354). * `use_github()` fails earlier, with a more informative message, in the absence of a GitHub personal access token (PAT). Also looks for the PAT more proactively in the usual environment variables (i.e., GITHUB_PAT, GITHUB_TOKEN) (#320, #340, @cderv). From 214acefc1fd360d474b7ae08854c6fb36fa7dbb3 Mon Sep 17 00:00:00 2001 From: Jenny Bryan Date: Thu, 25 Jul 2024 11:37:10 -0700 Subject: [PATCH 6/9] Stragglers --- _pkgdown.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/_pkgdown.yml b/_pkgdown.yml index 9c695e329..0287dffec 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -91,11 +91,9 @@ reference: - title: Continuous integration contents: - use_github_action - - use_appveyor - use_circleci - use_gitlab_ci - use_jenkins - - use_travis - title: Tidyverse development desc: > Conventions used in the tidyverse and r-lib organisations From b47d363f26a1ca28d2c102fcbaef8c339f315a66 Mon Sep 17 00:00:00 2001 From: Jenny Bryan Date: Thu, 25 Jul 2024 11:42:36 -0700 Subject: [PATCH 7/9] Consolidate removal in NEWS --- NEWS.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/NEWS.md b/NEWS.md index 8b50ae5af..0aee9548b 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,9 +1,5 @@ # usethis (development version) -* `browse_github_token()`, `browse_github_pat()`, and `github_token()` have been removed after being deprecated in usethis 2.0.0. `create_github_token()`, `gh::gh_token()`, and `gh_token_help()` should be used instead. - -* `pr_pull_upstream()` and `pr_sync()` have been removed after being deprecated in usethis 2.0.0. `pr_merge_main()` and `pr_push()` should be used instead. - * `pr_merge_main()` now offers the choice to not open the files with merge conflicts (@olivroy, #1720). * `edit_rstudio_snippets()` now accepts yaml snippets (@olivroy, #1941). @@ -59,6 +55,11 @@ Functions that are removed: * `git_credentials()` * `use_git_credentials()` +* `browse_github_token()` +* `browse_github_pat()` +* `github_token()` +* `pr_pull_upstream()` +* `pr_sync()` * `use_appveyor()` * `use_appveyor_badge()` * `use_travis()` From 786d9a89cbc4c64de4b800909b8a5fe81fd0ae30 Mon Sep 17 00:00:00 2001 From: Jenny Bryan Date: Thu, 25 Jul 2024 14:46:36 -0700 Subject: [PATCH 8/9] Also remove `use_tidy_labels()` and `use_tidy_ci()` They were deprecated as of v2.1.0 as opposed to v2.0.0. But I feel OK about this because they are (1) only meant for tidyverse maintainers and (2) unlikely to be used programmatically anywhere. --- NAMESPACE | 2 -- NEWS.md | 2 ++ R/usethis-deprecated.R | 16 ---------------- _pkgdown.yml | 2 +- man/{use_tidy_labels.Rd => use_tidy_eval.Rd} | 10 +--------- 5 files changed, 4 insertions(+), 28 deletions(-) rename man/{use_tidy_labels.Rd => use_tidy_eval.Rd} (67%) diff --git a/NAMESPACE b/NAMESPACE index a22b9c57e..cc322ed12 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -176,7 +176,6 @@ export(use_template) export(use_test) export(use_testthat) export(use_tibble) -export(use_tidy_ci) export(use_tidy_coc) export(use_tidy_contributing) export(use_tidy_dependencies) @@ -186,7 +185,6 @@ export(use_tidy_github) export(use_tidy_github_actions) export(use_tidy_github_labels) export(use_tidy_issue_template) -export(use_tidy_labels) export(use_tidy_logo) export(use_tidy_style) export(use_tidy_support) diff --git a/NEWS.md b/NEWS.md index 0aee9548b..21ffad927 100644 --- a/NEWS.md +++ b/NEWS.md @@ -66,6 +66,8 @@ Functions that are removed: * `use_travis_badge()` * `browse_travis()` * `use_pkgdown_travis()` +* `use_tidy_ci()` +* `use_tidy_labels()` Function arguments that are removed: diff --git a/R/usethis-deprecated.R b/R/usethis-deprecated.R index f5892c2b3..588f78619 100644 --- a/R/usethis-deprecated.R +++ b/R/usethis-deprecated.R @@ -17,26 +17,10 @@ git_branch_default <- function() { #' @description #' `r lifecycle::badge("deprecated")` #' -#' * `use_tidy_labels()` has been replaced by [use_tidy_github_labels()]. -#' * `use_tidy_ci()` has been replaced by [use_tidy_github_actions()]. #' * `use_tidy_eval()` is deprecated because there's no longer a need to #' systematically import and re-export a large number of functions in order #' to use tidy evaluation. Instead, use [use_import_from()] to tactically #' import functions as you need them. -#' -#' @keywords internal -#' @export -use_tidy_labels <- function() { - lifecycle::deprecate_stop("2.1.0", "use_tidy_labels()", "use_tidy_github_labels()") -} - -#' @rdname use_tidy_labels -#' @export -use_tidy_ci <- function(...) { - lifecycle::deprecate_stop("2.1.0", "use_tidy_ci()", "use_tidy_github_actions()") -} - -#' @rdname use_tidy_labels #' @keywords internal #' @export use_tidy_eval <- function() { diff --git a/_pkgdown.yml b/_pkgdown.yml index 0287dffec..fe5e34c9c 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -161,7 +161,7 @@ reference: contents: - git_branch_default - use_github_actions - - use_tidy_labels + - use_tidy_eval articles: - title: Basics diff --git a/man/use_tidy_labels.Rd b/man/use_tidy_eval.Rd similarity index 67% rename from man/use_tidy_labels.Rd rename to man/use_tidy_eval.Rd index a6b43292c..f6718b83d 100644 --- a/man/use_tidy_labels.Rd +++ b/man/use_tidy_eval.Rd @@ -1,22 +1,14 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/usethis-deprecated.R -\name{use_tidy_labels} -\alias{use_tidy_labels} -\alias{use_tidy_ci} +\name{use_tidy_eval} \alias{use_tidy_eval} \title{Deprecated tidyverse functions} \usage{ -use_tidy_labels() - -use_tidy_ci(...) - use_tidy_eval() } \description{ \ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} \itemize{ -\item \code{use_tidy_labels()} has been replaced by \code{\link[=use_tidy_github_labels]{use_tidy_github_labels()}}. -\item \code{use_tidy_ci()} has been replaced by \code{\link[=use_tidy_github_actions]{use_tidy_github_actions()}}. \item \code{use_tidy_eval()} is deprecated because there's no longer a need to systematically import and re-export a large number of functions in order to use tidy evaluation. Instead, use \code{\link[=use_import_from]{use_import_from()}} to tactically From d113560f4b0f95fc64d1679b6b61946cf23f6ed0 Mon Sep 17 00:00:00 2001 From: Jenny Bryan Date: Thu, 25 Jul 2024 15:02:29 -0700 Subject: [PATCH 9/9] Mention what to do now --- NEWS.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/NEWS.md b/NEWS.md index 21ffad927..3997a2dc2 100644 --- a/NEWS.md +++ b/NEWS.md @@ -51,23 +51,23 @@ These changes have been in place for a long time now: * Use of git config and the gh package to infer, e.g., the target repo spec. * Pivot towards GitHub Actions and away from Travis and AppVeyor. -Functions that are removed: +Functions that are removed and, where applicable, what to use instead: * `git_credentials()` * `use_git_credentials()` -* `browse_github_token()` -* `browse_github_pat()` -* `github_token()` -* `pr_pull_upstream()` -* `pr_sync()` +* `browse_github_token()` (do `create_github_token()`) +* `browse_github_pat()` (do `create_github_token()`) +* `github_token()` (do `gh_token_help()` or `gh::gh_token()`) +* `pr_pull_upstream()` (do `pr_merge_main()`) +* `pr_sync()` (do `pr_merge_main(); pr_push()`) * `use_appveyor()` * `use_appveyor_badge()` * `use_travis()` * `use_travis_badge()` * `browse_travis()` * `use_pkgdown_travis()` -* `use_tidy_ci()` -* `use_tidy_labels()` +* `use_tidy_ci()` *deprecated in v2.1.0* (do `use_tidy_github_actions()`) +* `use_tidy_labels()` *deprecated in v2.1.0* (do `use_tidy_github_labels()`) Function arguments that are removed: