Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# devtools (development version)

* `bash()`, `create()`, `missing_s3()`, `reload()`, `show_news()`, and `wd()` are now deprecated. These functions are all historical parts of our workflow that we no longer use or recommend. `create()` is superseded by `usethis::create_package()`.
* `build_manual()` reports more details on failure (#2586).
* `build_vignettes()` and `clean_vignettes()` are now deprecated. We no longer recommend building vignettes in this way; instead use `pkgdown::build_article()` to render articles locally (#2488).
* `build_site()` now just calls `pkgdown::build_site()`, meaning that you will get more (informative) output by default (#2578).
Expand Down
8 changes: 8 additions & 0 deletions R/bash.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
#' Open bash shell in package directory
#'
#' @description
#' `r lifecycle::badge("deprecated")`
#'
#' `bash()` is deprecated because we no longer use or recommend this workflow.
#' Open bash shell in package directory
#'
#' @template devtools
#' @export
#' @keywords internal
bash <- function(pkg = ".") {
lifecycle::deprecate_warn("2.5.0", "bash()")
pkg <- as.package(pkg)

withr::with_dir(pkg$path, system("bash"))
Expand Down
8 changes: 8 additions & 0 deletions R/create.R
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
#' Create a package
#'
#' @description
#' `r lifecycle::badge("deprecated")`
#'
#' `create()` is deprecated. Please use [usethis::create_package()] directly
#' instead.
#'
#' @param path A path. If it exists, it is used. If it does not exist, it is
#' created, provided that the parent path exists.
#' @param ... Additional arguments passed to [usethis::create_package()]
#' @inheritParams usethis::create_package
#' @return The path to the created package, invisibly.
#' @export
#' @keywords internal
create <- function(path, ..., open = FALSE) {
lifecycle::deprecate_warn("2.5.0", "create()", "usethis::create_package()")
usethis::create_package(path, ..., open = open)
}
9 changes: 8 additions & 1 deletion R/missing-s3.R
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
#' Find missing s3 exports
#'
#' The method is heuristic - looking for objs with a period in their name.
#' @description
#' `r lifecycle::badge("deprecated")`
#'
#' `missing_s3()` is deprecated because roxygen2 now provides the same
#' functionality. Run `devtools::document()` and look for
#' `"Missing documentation for S3 method"` warnings.
#'
#' @template devtools
#' @export
#' @keywords internal
missing_s3 <- function(pkg = ".") {
lifecycle::deprecate_warn("2.5.0", "missing_s3()")
pkg <- as.package(pkg)
loaded <- load_all(pkg$path)

Expand Down
25 changes: 8 additions & 17 deletions R/reload.R
Original file line number Diff line number Diff line change
@@ -1,28 +1,19 @@
#' Unload and reload package
#'
#' This attempts to unload and reload an _installed_ package. If the package is
#' not loaded already, it does nothing. It's not always possible to cleanly
#' unload a package: see the caveats in [unload()] for some of the potential
#' failure points. If in doubt, restart R and reload the package with
#' [library()].
#' @description
#' `r lifecycle::badge("deprecated")`
#'
#' `reload()` is deprecated because we no longer use or recommend this
#' workflow. Instead, we recommend [load_all()] to load a package for
#' interactive development.
#'
#' @template devtools
#' @param quiet if `TRUE` suppresses output from this function.
#' @seealso [load_all()] to load a package for interactive development.
#' @examples
#' \dontrun{
#' # Reload package that is in current directory
#' reload(".")
#'
#' # Reload package that is in ./ggplot2/
#' reload("ggplot2/")
#'
#' # Can use inst() to find the package path
#' # This will reload the installed ggplot2 package
#' reload(pkgload::inst("ggplot2"))
#' }
#' @export
#' @keywords internal
reload <- function(pkg = ".", quiet = FALSE) {
lifecycle::deprecate_warn("2.5.0", "reload()", "load_all()")
pkg <- as.package(pkg)

if (is_attached(pkg)) {
Expand Down
8 changes: 8 additions & 0 deletions R/show-news.R
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
#' Show package news
#'
#' @description
#' `r lifecycle::badge("deprecated")`
#'
#' `show_news()` is deprecated because we no longer use or recommend this
#' workflow.
#'
#' @template devtools
#' @param latest if `TRUE`, only show the news for the most recent
#' version.
#' @param ... other arguments passed on to `news`
#' @export
#' @keywords internal
show_news <- function(pkg = ".", latest = TRUE, ...) {
lifecycle::deprecate_warn("2.5.0", "show_news()")
pkg <- as.package(pkg)
news_path <- find_news(pkg$path)

Expand Down
8 changes: 8 additions & 0 deletions R/wd.R
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
#' Set working directory
#'
#' @description
#' `r lifecycle::badge("deprecated")`
#'
#' `wd()` is deprecated because we no longer use or recommend this workflow.
#' Set working directory
#'
#' @template devtools
#' @param path path within package. Leave empty to change working directory
#' to package directory.
#' @export
#' @keywords internal
wd <- function(pkg = ".", path = "") {
lifecycle::deprecate_warn("2.5.0", "wd()")
pkg <- as.package(pkg)
path <- path(pkg$path, path)

Expand Down
17 changes: 9 additions & 8 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@ reference:
- build_site
- starts_with("check_")
- check
- create
- document
- load_all
- reload
- spell_check
- test

Expand All @@ -38,24 +36,27 @@ reference:

- title: Utilities
contents:
- bash
- dev_sitrep
- lint
- missing_s3
- run_examples
- session_info
- show_news
- starts_with("source_")
- wd
- save_all

- title: Deprecated
contents:
- bash
- build_vignettes
- clean_vignettes
- release
- create
- dev_mode
- install-deprecated
- install_deps
- missing_s3
- reload
- release
- show_news
- wd
- devtools-deprecated

news:
Expand Down
4 changes: 4 additions & 0 deletions man/bash.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion man/create.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion man/missing_s3.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 5 additions & 17 deletions man/reload.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion man/show_news.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions man/wd.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions tests/testthat/test-reload.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
test_that("reload works", {
withr::local_options(lifecycle_verbosity = "quiet")
withr::local_temp_libpaths()

pkg <- as.package(test_path("testTest"))
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-show-news.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ test_that("find_news() finds NEWS in all expected locations", {
})

test_that("fails when NEWS is missing or improperly formatted", {
withr::local_options(lifecycle_verbosity = "quiet")
skip_on_cran()
skip_unless_r(">= 4.2.0") # different error message

Expand Down