Skip to content
Open
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).
* 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).
Expand Down
9 changes: 8 additions & 1 deletion R/bash.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
#' Open bash shell in package directory.
#' Open bash shell in package directory
#'
#' @description
#' `r lifecycle::badge("deprecated")`
#'
#' `bash()` is deprecated because we no longer use or recommend this workflow.
#'
#' @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)
}
11 changes: 9 additions & 2 deletions R/missing-s3.R
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
#' Find missing s3 exports.
#' 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
27 changes: 9 additions & 18 deletions R/reload.R
Original file line number Diff line number Diff line change
@@ -1,28 +1,19 @@
#' Unload and reload package.
#' 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
9 changes: 8 additions & 1 deletion R/wd.R
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
#' Set working directory.
#' Set working directory
#'
#' @description
#' `r lifecycle::badge("deprecated")`
#'
#' `wd()` is deprecated because we no longer use or recommend this workflow.
#'
#' @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
15 changes: 9 additions & 6 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@ reference:
- starts_with("build_")
- starts_with("check_")
- check
- create
- document
- load_all
- reload
- release
- spell_check
- test
Expand All @@ -35,19 +33,24 @@ reference:
- uninstall
- title: Utilities
contents:
- bash
- clean_vignettes
- dev_sitrep
- github_pull
- lint
- missing_s3
- run_examples
- session_info
- show_news
- starts_with("source_")
- update_packages
- wd
- save_all
- title: Deprecated
contents:
- bash
- create
- dev_mode
- missing_s3
- reload
- show_news
- wd

news:
releases:
Expand Down
7 changes: 5 additions & 2 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.

9 changes: 7 additions & 2 deletions man/missing_s3.Rd

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

24 changes: 6 additions & 18 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.

7 changes: 5 additions & 2 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