diff --git a/NEWS.md b/NEWS.md index 3d9740ba0..3a4ac7fc3 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,6 +4,7 @@ * New `check_mac_devel()` function to check a package using the macOS builder at https://mac.r-project.org/macbuilder/submit.html (@nfrerebeau, #2507) * `is_loading()` is now re-exported from pkgload (#2556). * `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). +* `release()` is deprecated in favour of `usethis::use_release_issue()`. * `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). # devtools 2.4.6 diff --git a/R/release.R b/R/release.R index 65c6c8c11..9482912ed 100644 --- a/R/release.R +++ b/R/release.R @@ -1,23 +1,12 @@ #' Release package to CRAN. #' -#' Run automated and manual tests, then post package to CRAN. -#' -#' The package release process will: -#' -#' * Confirm that the package passes `R CMD check` on relevant platforms -#' * Confirm that important files are up-to-date -#' * Build the package -#' * Submit the package to CRAN, using comments in "cran-comments.md" -#' -#' You can add arbitrary extra questions by defining an (un-exported) function -#' called `release_questions()` that returns a character vector -#' of additional questions to ask. +#' @description +#' `r lifecycle::badge("deprecated")` #' -#' You also need to read the CRAN repository policy at -#' 'https://cran.r-project.org/web/packages/policies.html' and make -#' sure you're in line with the policies. `release` tries to automate as -#' many of polices as possible, but it's impossible to be completely -#' comprehensive, and they do change in between releases of devtools. +#' `release()` is deprecated in favour of [usethis::use_release_issue()]. +#' We no longer feel confident recommrding `release()` because we don't use it +#' ourselves, so there's no guarantee that it will track best practices as +#' they evolve over time. #' #' @template devtools #' @param check if `TRUE`, run checking, otherwise omit it. This @@ -29,6 +18,15 @@ #' tasks that you can use in addition to or in place of `release`. #' @export release <- function(pkg = ".", check = FALSE, args = NULL) { + lifecycle::deprecate_warn( + "2.5.0", + "release()", + "usethis::use_release_issue()" + ) + if (!rlang::is_interactive()) { + cli::cli_abort("Interactive session required.") + } + pkg <- as.package(pkg) # Figure out if this is a new package cran_version <- cran_pkg_version(pkg$package) @@ -159,6 +157,10 @@ find_release_questions <- function(pkg = ".") { } yesno <- function(msg, .envir = parent.frame()) { + if (!rlang::is_interactive()) { + cli::cli_abort("Called from non-interactive context.") + } + yeses <- c( "Yes", "Definitely", diff --git a/_pkgdown.yml b/_pkgdown.yml index 2cb2f760c..55cd1ee89 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -26,7 +26,6 @@ reference: - document - load_all - reload - - release - spell_check - test - title: Package Installation @@ -49,6 +48,10 @@ reference: - wd - save_all +- title: Deprecated functions + contents: + - release + news: releases: - text: "Version 2.2.1" diff --git a/man/release.Rd b/man/release.Rd index d0efd4d00..038672f69 100644 --- a/man/release.Rd +++ b/man/release.Rd @@ -18,26 +18,12 @@ release it.} line arguments to be passed to \verb{R CMD build}.} } \description{ -Run automated and manual tests, then post package to CRAN. -} -\details{ -The package release process will: -\itemize{ -\item Confirm that the package passes \verb{R CMD check} on relevant platforms -\item Confirm that important files are up-to-date -\item Build the package -\item Submit the package to CRAN, using comments in "cran-comments.md" -} - -You can add arbitrary extra questions by defining an (un-exported) function -called \code{release_questions()} that returns a character vector -of additional questions to ask. +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} -You also need to read the CRAN repository policy at -'https://cran.r-project.org/web/packages/policies.html' and make -sure you're in line with the policies. \code{release} tries to automate as -many of polices as possible, but it's impossible to be completely -comprehensive, and they do change in between releases of devtools. +\code{release()} is deprecated in favour of \code{\link[usethis:use_release_issue]{usethis::use_release_issue()}}. +We no longer feel confident recommrding \code{release()} because we don't use it +ourselves, so there's no guarantee that it will track best practices as +they evolve over time. } \seealso{ \code{\link[usethis:use_release_issue]{usethis::use_release_issue()}} to create a checklist of release diff --git a/tests/testthat/_snaps/release.md b/tests/testthat/_snaps/release.md new file mode 100644 index 000000000..0be558b2d --- /dev/null +++ b/tests/testthat/_snaps/release.md @@ -0,0 +1,11 @@ +# release() is deprecated + + Code + . <- release() + Condition + Warning: + `release()` was deprecated in devtools 2.5.0. + i Please use `usethis::use_release_issue()` instead. + Error in `release()`: + ! Interactive session required. + diff --git a/tests/testthat/test-release.R b/tests/testthat/test-release.R new file mode 100644 index 000000000..2be6ea9f7 --- /dev/null +++ b/tests/testthat/test-release.R @@ -0,0 +1,3 @@ +test_that("release() is deprecated", { + expect_snapshot(. <- release(), error = TRUE) +})