Skip to content

Commit ef3d516

Browse files
authored
Remove lots of deprecated functions, arguments, badges (#2027)
* Remove long-deprecated functions and arguments * Update pkgdown * Get rid of lifecycle stages we no longer use * Embrace "deprecated" over "defunct" * Update NEWS * Stragglers * Consolidate removal in NEWS * 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. * Mention what to do now
1 parent 46e3fef commit ef3d516

33 files changed

+228
-810
lines changed

.covrignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
R/deprec-*.R
22
R/compat-*.R
3-
R/usethis-defunct.R
3+
R/usethis-deprecated.R

NAMESPACE

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ export(browse_github_issues)
1414
export(browse_github_pulls)
1515
export(browse_package)
1616
export(browse_project)
17-
export(browse_travis)
1817
export(create_download_url)
1918
export(create_from_github)
2019
export(create_github_token)
@@ -34,7 +33,6 @@ export(edit_rstudio_snippets)
3433
export(edit_template)
3534
export(gh_token_help)
3635
export(git_branch_default)
37-
export(git_credentials)
3836
export(git_default_branch)
3937
export(git_default_branch_configure)
4038
export(git_default_branch_rediscover)
@@ -87,8 +85,6 @@ export(use_agpl3_license)
8785
export(use_agpl_license)
8886
export(use_apache_license)
8987
export(use_apl2_license)
90-
export(use_appveyor)
91-
export(use_appveyor_badge)
9288
export(use_article)
9389
export(use_author)
9490
export(use_badge)
@@ -121,7 +117,6 @@ export(use_devtools)
121117
export(use_directory)
122118
export(use_git)
123119
export(use_git_config)
124-
export(use_git_credentials)
125120
export(use_git_hook)
126121
export(use_git_ignore)
127122
export(use_git_protocol)
@@ -159,7 +154,6 @@ export(use_partial_warnings)
159154
export(use_pipe)
160155
export(use_pkgdown)
161156
export(use_pkgdown_github_pages)
162-
export(use_pkgdown_travis)
163157
export(use_posit_cloud_badge)
164158
export(use_proprietary_license)
165159
export(use_r)
@@ -182,7 +176,6 @@ export(use_template)
182176
export(use_test)
183177
export(use_testthat)
184178
export(use_tibble)
185-
export(use_tidy_ci)
186179
export(use_tidy_coc)
187180
export(use_tidy_contributing)
188181
export(use_tidy_dependencies)
@@ -192,14 +185,11 @@ export(use_tidy_github)
192185
export(use_tidy_github_actions)
193186
export(use_tidy_github_labels)
194187
export(use_tidy_issue_template)
195-
export(use_tidy_labels)
196188
export(use_tidy_logo)
197189
export(use_tidy_style)
198190
export(use_tidy_support)
199191
export(use_tidy_thanks)
200192
export(use_tidy_upkeep_issue)
201-
export(use_travis)
202-
export(use_travis_badge)
203193
export(use_tutorial)
204194
export(use_upkeep_issue)
205195
export(use_usethis)

NEWS.md

Lines changed: 42 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
# usethis (development version)
22

3-
* `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.
4-
5-
* `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.
6-
73
* `pr_merge_main()` now offers the choice to not open the files with merge conflicts (@olivroy, #1720).
84

95
* `edit_rstudio_snippets()` now accepts yaml snippets (@olivroy, #1941).
@@ -44,6 +40,43 @@
4440
* `usethis::use_version()` now tolerates empty / blank lines preceding the
4541
first section title in the package NEWS file. (#1976)
4642

43+
## Deprecated function and argument removal
44+
45+
We are removing functions and arguments that were deprecated as of usethis
46+
v2.0.0, which was released in December 2020.
47+
48+
These changes have been in place for a long time now:
49+
50+
* Switch from git2r to gert (+ credentials).
51+
* Use of git config and the gh package to infer, e.g., the target repo spec.
52+
* Pivot towards GitHub Actions and away from Travis and AppVeyor.
53+
54+
Functions that are removed and, where applicable, what to use instead:
55+
56+
* `git_credentials()`
57+
* `use_git_credentials()`
58+
* `browse_github_token()` (do `create_github_token()`)
59+
* `browse_github_pat()` (do `create_github_token()`)
60+
* `github_token()` (do `gh_token_help()` or `gh::gh_token()`)
61+
* `pr_pull_upstream()` (do `pr_merge_main()`)
62+
* `pr_sync()` (do `pr_merge_main(); pr_push()`)
63+
* `use_appveyor()`
64+
* `use_appveyor_badge()`
65+
* `use_travis()`
66+
* `use_travis_badge()`
67+
* `browse_travis()`
68+
* `use_pkgdown_travis()`
69+
* `use_tidy_ci()` *deprecated in v2.1.0* (do `use_tidy_github_actions()`)
70+
* `use_tidy_labels()` *deprecated in v2.1.0* (do `use_tidy_github_labels()`)
71+
72+
Function arguments that are removed:
73+
74+
* `create_from_github(auth_token =, credentials =)`
75+
* `use_github(auth_token =, credentials =)`
76+
* `use_github_labels(repo_spec =, host =, auth_token =)`
77+
* `use_github_links(auth_token =, host =)`
78+
* `use_github_release(host =, auth_token =)`
79+
4780
# usethis 2.2.3
4881

4982
* Patch release with changes to `.Rd` files requested by CRAN.
@@ -206,14 +239,14 @@
206239
* `use_tidy_logo()` is a new function that calls `use_logo()` on the appropriate
207240
hex sticker PNG file at <https://github.com/rstudio/hex-stickers> (#1871).
208241

209-
## Defunct functions
242+
## Deprecated functions
210243

211-
* `use_tidy_eval()` is now defunct because it imports and re-exports a large
244+
* `use_tidy_eval()` is now deprecated because it imports and re-exports a large
212245
number of functions that are no longer needed in order to do tidy
213246
evaluation (#1656).
214247

215248
* `use_travis()`, `use_pkgdown_travis()`, `browse_travis()`, and `use_appveyor()`
216-
are now defunct because we no longer recommend Travis or Appveyor. We
249+
are now deprecated because we no longer recommend Travis or Appveyor. We
217250
recommend GitHub actions instead (#1517).
218251

219252
# usethis 2.1.6
@@ -531,7 +564,7 @@ GitHub Actions is the preferred platform for continuous integration, because tha
531564

532565
`use_tidy_pkgdown()` implements the complete pkgdown configuration used by the tidyverse team (#224).
533566

534-
`pr_sync()` is defunct and can be replicated by calling `pr_pull()`, `pr_merge_main()`, then `pr_push()`.
567+
`pr_sync()` is deprecated and can be replicated by calling `pr_pull()`, `pr_merge_main()`, then `pr_push()`.
535568

536569
## Licensing improvements
537570

@@ -1183,7 +1216,7 @@ build paths within it (#415, #425).
11831216
11841217
* `create_from_github()`: the `repo` argument is renamed to `repo_spec`, since it takes input of the form "OWNER/REPO" (#376).
11851218
1186-
* `use_depsy_badge()` is defunct. The Depsy project has officially concluded and is no longer being maintained (#354).
1219+
* `use_depsy_badge()` is deprecated. The Depsy project has officially concluded and is no longer being maintained (#354).
11871220
11881221
* `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).
11891222

R/create.R

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -188,15 +188,7 @@ create_from_github <- function(repo_spec,
188188
rstudio = NULL,
189189
open = rlang::is_interactive(),
190190
protocol = git_protocol(),
191-
host = NULL,
192-
auth_token = deprecated(),
193-
credentials = deprecated()) {
194-
if (lifecycle::is_present(auth_token)) {
195-
deprecate_warn_auth_token("create_from_github")
196-
}
197-
if (lifecycle::is_present(credentials)) {
198-
deprecate_warn_credentials("create_from_github")
199-
}
191+
host = NULL) {
200192
check_protocol(protocol)
201193

202194
parsed_repo_spec <- parse_repo_url(repo_spec)

R/github-labels.R

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,6 @@
4343
#' This keeps the issue page visually harmonious while still giving enough
4444
#' variation to easily distinguish different types of label.
4545
#'
46-
#' @param repo_spec,host,auth_token `r lifecycle::badge("deprecated")`: These
47-
#' arguments are now deprecated and will be removed in the future. Any input
48-
#' provided via these arguments is not used. The target repo, host, and auth
49-
#' token are all now determined from the current project's Git remotes.
5046
#' @param labels A character vector giving labels to add.
5147
#' @param rename A named vector with names giving old names and values giving
5248
#' new names.
@@ -77,24 +73,11 @@
7773
#' descriptions = c("foofiest" = "the foofiest issue you ever saw")
7874
#' )
7975
#' }
80-
use_github_labels <- function(repo_spec = deprecated(),
81-
labels = character(),
76+
use_github_labels <- function(labels = character(),
8277
rename = character(),
8378
colours = character(),
8479
descriptions = character(),
85-
delete_default = FALSE,
86-
host = deprecated(),
87-
auth_token = deprecated()) {
88-
if (lifecycle::is_present(repo_spec)) {
89-
deprecate_warn_repo_spec("use_github_labels")
90-
}
91-
if (lifecycle::is_present(host)) {
92-
deprecate_warn_host("use_github_labels")
93-
}
94-
if (lifecycle::is_present(auth_token)) {
95-
deprecate_warn_auth_token("use_github_labels")
96-
}
97-
80+
delete_default = FALSE) {
9881
tr <- target_repo(github_get = TRUE, ok_configs = c("ours", "fork"))
9982
check_can_push(tr = tr, "to modify labels")
10083

R/github.R

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,6 @@
3939
#' For a hypothetical GitHub Enterprise instance, either
4040
#' "https://github.acme.com/api/v3" or "https://github.acme.com" is
4141
#' acceptable.
42-
#' @param auth_token,credentials `r lifecycle::badge("deprecated")`: No longer
43-
#' consulted now that usethis uses the gert package for Git operations,
44-
#' instead of git2r; gert relies on the credentials package for auth. The API
45-
#' requests are now authorized with the token associated with the `host`, as
46-
#' retrieved by [gh::gh_token()].
4742
#'
4843
#' @export
4944
#' @examples
@@ -61,16 +56,7 @@ use_github <- function(organisation = NULL,
6156
private = FALSE,
6257
visibility = c("public", "private", "internal"),
6358
protocol = git_protocol(),
64-
host = NULL,
65-
auth_token = deprecated(),
66-
credentials = deprecated()) {
67-
if (lifecycle::is_present(auth_token)) {
68-
deprecate_warn_auth_token("use_github")
69-
}
70-
if (lifecycle::is_present(credentials)) {
71-
deprecate_warn_credentials("use_github")
72-
}
73-
59+
host = NULL) {
7460
visibility_specified <- !missing(visibility)
7561
visibility <- match.arg(visibility)
7662
check_protocol(protocol)
@@ -197,9 +183,6 @@ use_github <- function(organisation = NULL,
197183
#' an interactive session, the user can confirm which repo to use for the
198184
#' links. In a noninteractive session, links are formed using `upstream`.
199185
#'
200-
#' @param host,auth_token `r lifecycle::badge("deprecated")`: No longer consulted
201-
#' now that usethis consults the current project's GitHub remotes to get the
202-
#' `host` and then relies on gh to discover an appropriate token.
203186
#' @param overwrite By default, `use_github_links()` will not overwrite existing
204187
#' fields. Set to `TRUE` to overwrite existing links.
205188
#' @export
@@ -208,16 +191,7 @@ use_github <- function(organisation = NULL,
208191
#' use_github_links()
209192
#' }
210193
#'
211-
use_github_links <- function(auth_token = deprecated(),
212-
host = deprecated(),
213-
overwrite = FALSE) {
214-
if (lifecycle::is_present(auth_token)) {
215-
deprecate_warn_auth_token("use_github_links")
216-
}
217-
if (lifecycle::is_present(host)) {
218-
deprecate_warn_host("use_github_links")
219-
}
220-
194+
use_github_links <- function(overwrite = FALSE) {
221195
check_is_package("use_github_links()")
222196

223197
gh_url <- github_url_from_git_remotes()

R/release.R

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -217,22 +217,11 @@ release_type <- function(version) {
217217
#' assume that current state (SHA of `HEAD`, package version, NEWS) is the
218218
#' submitted state.
219219
#'
220-
#' @param host,auth_token `r lifecycle::badge("deprecated")`: No longer
221-
#' consulted now that usethis allows the gh package to lookup a token based on
222-
#' a URL determined from the current project's GitHub remotes.
223220
#' @param publish If `TRUE`, publishes a release. If `FALSE`, creates a draft
224221
#' release.
225222
#' @export
226-
use_github_release <- function(publish = TRUE,
227-
host = deprecated(),
228-
auth_token = deprecated()) {
223+
use_github_release <- function(publish = TRUE) {
229224
check_is_package("use_github_release()")
230-
if (lifecycle::is_present(host)) {
231-
deprecate_warn_host("use_github_release")
232-
}
233-
if (lifecycle::is_present(auth_token)) {
234-
deprecate_warn_auth_token("use_github_release")
235-
}
236225

237226
tr <- target_repo(github_get = TRUE, ok_configs = c("ours", "fork"))
238227
check_can_push(tr = tr, "to create a release")

0 commit comments

Comments
 (0)