Skip to content

Commit d613fe6

Browse files
authored
Deprecate outdated workflows (#2650)
Fixes #2427
1 parent 393fdd5 commit d613fe6

16 files changed

Lines changed: 89 additions & 46 deletions

NEWS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# devtools (development version)
22

3+
* `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()`.
34
* `build_manual()` reports more details on failure (#2586).
45
* `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).
56
* `build_site()` now just calls `pkgdown::build_site()`, meaning that you will get more (informative) output by default (#2578).

R/bash.R

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
#' Open bash shell in package directory
22
#'
3+
#' @description
4+
#' `r lifecycle::badge("deprecated")`
5+
#'
6+
#' `bash()` is deprecated because we no longer use or recommend this workflow.
7+
#' Open bash shell in package directory
8+
#'
39
#' @template devtools
410
#' @export
11+
#' @keywords internal
512
bash <- function(pkg = ".") {
13+
lifecycle::deprecate_warn("2.5.0", "bash()")
614
pkg <- as.package(pkg)
715

816
withr::with_dir(pkg$path, system("bash"))

R/create.R

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
#' Create a package
22
#'
3+
#' @description
4+
#' `r lifecycle::badge("deprecated")`
5+
#'
6+
#' `create()` is deprecated. Please use [usethis::create_package()] directly
7+
#' instead.
8+
#'
39
#' @param path A path. If it exists, it is used. If it does not exist, it is
410
#' created, provided that the parent path exists.
511
#' @param ... Additional arguments passed to [usethis::create_package()]
612
#' @inheritParams usethis::create_package
713
#' @return The path to the created package, invisibly.
814
#' @export
15+
#' @keywords internal
916
create <- function(path, ..., open = FALSE) {
17+
lifecycle::deprecate_warn("2.5.0", "create()", "usethis::create_package()")
1018
usethis::create_package(path, ..., open = open)
1119
}

R/missing-s3.R

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
#' Find missing s3 exports
22
#'
3-
#' The method is heuristic - looking for objs with a period in their name.
3+
#' @description
4+
#' `r lifecycle::badge("deprecated")`
5+
#'
6+
#' `missing_s3()` is deprecated because roxygen2 now provides the same
7+
#' functionality. Run `devtools::document()` and look for
8+
#' `"Missing documentation for S3 method"` warnings.
49
#'
510
#' @template devtools
611
#' @export
12+
#' @keywords internal
713
missing_s3 <- function(pkg = ".") {
14+
lifecycle::deprecate_warn("2.5.0", "missing_s3()")
815
pkg <- as.package(pkg)
916
loaded <- load_all(pkg$path)
1017

R/reload.R

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,19 @@
11
#' Unload and reload package
22
#'
3-
#' This attempts to unload and reload an _installed_ package. If the package is
4-
#' not loaded already, it does nothing. It's not always possible to cleanly
5-
#' unload a package: see the caveats in [unload()] for some of the potential
6-
#' failure points. If in doubt, restart R and reload the package with
7-
#' [library()].
3+
#' @description
4+
#' `r lifecycle::badge("deprecated")`
5+
#'
6+
#' `reload()` is deprecated because we no longer use or recommend this
7+
#' workflow. Instead, we recommend [load_all()] to load a package for
8+
#' interactive development.
89
#'
910
#' @template devtools
1011
#' @param quiet if `TRUE` suppresses output from this function.
1112
#' @seealso [load_all()] to load a package for interactive development.
12-
#' @examples
13-
#' \dontrun{
14-
#' # Reload package that is in current directory
15-
#' reload(".")
16-
#'
17-
#' # Reload package that is in ./ggplot2/
18-
#' reload("ggplot2/")
19-
#'
20-
#' # Can use inst() to find the package path
21-
#' # This will reload the installed ggplot2 package
22-
#' reload(pkgload::inst("ggplot2"))
23-
#' }
2413
#' @export
14+
#' @keywords internal
2515
reload <- function(pkg = ".", quiet = FALSE) {
16+
lifecycle::deprecate_warn("2.5.0", "reload()", "load_all()")
2617
pkg <- as.package(pkg)
2718

2819
if (is_attached(pkg)) {

R/show-news.R

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
#' Show package news
22
#'
3+
#' @description
4+
#' `r lifecycle::badge("deprecated")`
5+
#'
6+
#' `show_news()` is deprecated because we no longer use or recommend this
7+
#' workflow.
8+
#'
39
#' @template devtools
410
#' @param latest if `TRUE`, only show the news for the most recent
511
#' version.
612
#' @param ... other arguments passed on to `news`
713
#' @export
14+
#' @keywords internal
815
show_news <- function(pkg = ".", latest = TRUE, ...) {
16+
lifecycle::deprecate_warn("2.5.0", "show_news()")
917
pkg <- as.package(pkg)
1018
news_path <- find_news(pkg$path)
1119

R/wd.R

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
#' Set working directory
22
#'
3+
#' @description
4+
#' `r lifecycle::badge("deprecated")`
5+
#'
6+
#' `wd()` is deprecated because we no longer use or recommend this workflow.
7+
#' Set working directory
8+
#'
39
#' @template devtools
410
#' @param path path within package. Leave empty to change working directory
511
#' to package directory.
612
#' @export
13+
#' @keywords internal
714
wd <- function(pkg = ".", path = "") {
15+
lifecycle::deprecate_warn("2.5.0", "wd()")
816
pkg <- as.package(pkg)
917
path <- path(pkg$path, path)
1018

_pkgdown.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,8 @@ reference:
2424
- build_site
2525
- starts_with("check_")
2626
- check
27-
- create
2827
- document
2928
- load_all
30-
- reload
3129
- spell_check
3230
- test
3331

@@ -38,24 +36,27 @@ reference:
3836

3937
- title: Utilities
4038
contents:
41-
- bash
4239
- dev_sitrep
4340
- lint
44-
- missing_s3
4541
- run_examples
4642
- session_info
47-
- show_news
4843
- starts_with("source_")
49-
- wd
5044
- save_all
51-
45+
5246
- title: Deprecated
5347
contents:
48+
- bash
5449
- build_vignettes
5550
- clean_vignettes
56-
- release
51+
- create
52+
- dev_mode
5753
- install-deprecated
5854
- install_deps
55+
- missing_s3
56+
- reload
57+
- release
58+
- show_news
59+
- wd
5960
- devtools-deprecated
6061

6162
news:

man/bash.Rd

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

man/create.Rd

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

0 commit comments

Comments
 (0)