Skip to content

Commit 0453cb5

Browse files
committed
Deprecate release() in favour of usethis::use_release_issue()
Fixes #2500
1 parent 119c46f commit 0453cb5

6 files changed

Lines changed: 39 additions & 37 deletions

File tree

NEWS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* New `check_mac_devel()` function to check a package using the macOS builder at https://mac.r-project.org/macbuilder/submit.html (@nfrerebeau, #2507)
55
* `is_loading()` is now re-exported from pkgload (#2556).
66
* `load_all()` now errors if called recursively, i.e. if you accidentally include a `load_all()` call in one of your R source files (#2617).
7+
* `release()` is deprecated in favour of `usethis::use_release_issue()`.
78
* `show_news()` now looks for NEWS files in the same locations as `utils::news()`: `inst/NEWS.Rd`, `NEWS.md`, `NEWS`, and `inst/NEWS` (@arcresu, #2499).
89

910
# devtools 2.4.6

R/release.R

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,12 @@
11
#' Release package to CRAN.
22
#'
3-
#' Run automated and manual tests, then post package to CRAN.
4-
#'
5-
#' The package release process will:
6-
#'
7-
#' * Confirm that the package passes `R CMD check` on relevant platforms
8-
#' * Confirm that important files are up-to-date
9-
#' * Build the package
10-
#' * Submit the package to CRAN, using comments in "cran-comments.md"
11-
#'
12-
#' You can add arbitrary extra questions by defining an (un-exported) function
13-
#' called `release_questions()` that returns a character vector
14-
#' of additional questions to ask.
3+
#' @description
4+
#' `r lifecycle::badge("deprecated")`
155
#'
16-
#' You also need to read the CRAN repository policy at
17-
#' 'https://cran.r-project.org/web/packages/policies.html' and make
18-
#' sure you're in line with the policies. `release` tries to automate as
19-
#' many of polices as possible, but it's impossible to be completely
20-
#' comprehensive, and they do change in between releases of devtools.
6+
#' `release()` is deprecated in favour of [usethis::use_release_issue()].
7+
#' We no longer feel confident recommrding `release()` because we don't use it
8+
#' ourselves, so there's no guarantee that it will track best practices as
9+
#' they evolve over time.
2110
#'
2211
#' @template devtools
2312
#' @param check if `TRUE`, run checking, otherwise omit it. This
@@ -29,6 +18,11 @@
2918
#' tasks that you can use in addition to or in place of `release`.
3019
#' @export
3120
release <- function(pkg = ".", check = FALSE, args = NULL) {
21+
lifecycle::deprecate_warn(
22+
"2.5.0",
23+
"release()",
24+
"usethis::use_release_issue()"
25+
)
3226
pkg <- as.package(pkg)
3327
# Figure out if this is a new package
3428
cran_version <- cran_pkg_version(pkg$package)
@@ -159,6 +153,10 @@ find_release_questions <- function(pkg = ".") {
159153
}
160154

161155
yesno <- function(msg, .envir = parent.frame()) {
156+
if (!rlang::is_interactive()) {
157+
cli::cli_abort("Called from non-interactive context.")
158+
}
159+
162160
yeses <- c(
163161
"Yes",
164162
"Definitely",

_pkgdown.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ reference:
2626
- document
2727
- load_all
2828
- reload
29-
- release
3029
- spell_check
3130
- test
3231
- title: Package Installation
@@ -49,6 +48,10 @@ reference:
4948
- wd
5049
- save_all
5150

51+
- title: Deprecated functions
52+
contents:
53+
- release
54+
5255
news:
5356
releases:
5457
- text: "Version 2.2.1"

man/release.Rd

Lines changed: 5 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/_snaps/release.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# release() is deprecated
2+
3+
Code
4+
. <- release()
5+
Condition
6+
Warning:
7+
`release()` was deprecated in devtools 2.5.0.
8+
i Please use `usethis::use_release_issue()` instead.
9+
Error in `yesno()`:
10+
! Called from non-interactive context.
11+

tests/testthat/test-release.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
test_that("release() is deprecated", {
2+
expect_snapshot(. <- release(), error = TRUE)
3+
})

0 commit comments

Comments
 (0)