Skip to content

Commit 670b563

Browse files
billdenneyjennybc
andauthored
Deprecate dev_mode() (#2476)
* Deprecate dev_mode() * More work on the deprecation * Update NEWS bullet --------- Co-authored-by: Jenny Bryan <jenny.f.bryan@gmail.com>
1 parent a027efd commit 670b563

File tree

6 files changed

+51
-37
lines changed

6 files changed

+51
-37
lines changed

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020

2121
* `test()` and `test_active_file()` once again work with testthat itself.
2222

23+
* `dev_mode()` is deprecated (@billdenney, #2467).
24+
2325
# devtools 2.4.4
2426

2527
* `install(reload = TRUE)` now calls `pkgload::unregister()` instead

R/dev-mode.R

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,28 @@
1-
#' Activate and deactivate development mode.
1+
#' Activate and deactivate development mode
22
#'
3-
#' When activated, `dev_mode` creates a new library for storing installed
4-
#' packages. This new library is automatically created when `dev_mode` is
5-
#' activated if it does not already exist.
6-
#' This allows you to test development packages in a sandbox, without
7-
#' interfering with the other packages you have installed.
3+
#' @description
4+
#' `r lifecycle::badge("deprecated")`
85
#'
9-
#' @param on turn dev mode on (`TRUE`) or off (`FALSE`). If omitted
10-
#' will guess based on whether or not `path` is in
11-
#' [.libPaths()]
6+
7+
#' We no longer recommend `dev_mode()` and it will be removed in a future
8+
#' release of devtools. Instead, we now rely on [load_all()] to test drive an
9+
#' in-development package. If you really like the idea of corralling
10+
#' experimental packages in a special library, you might enjoy
11+
#' `withr::local_libpaths()`. If you are concerned about different projects
12+
#' interfering with each other through the use of a shared library, consider
13+
#' using the [renv package](https://rstudio.github.io/renv/).
14+
#'
15+
#' Original description: When activated, `dev_mode` creates a new library for
16+
#' storing installed packages. This new library is automatically created when
17+
#' `dev_mode` is activated if it does not already exist. This allows you to test
18+
#' development packages in a sandbox, without interfering with the other
19+
#' packages you have installed.
20+
#'
21+
#' @param on turn dev mode on (`TRUE`) or off (`FALSE`). If omitted will guess
22+
#' based on whether or not `path` is in [.libPaths()]
1223
#' @param path directory to library.
1324
#' @export
25+
#' @keywords internal
1426
#' @examples
1527
#' \dontrun{
1628
#' dev_mode()
@@ -20,6 +32,7 @@ dev_mode <- local({
2032
.prompt <- NULL
2133

2234
function(on = NULL, path = getOption("devtools.path")) {
35+
lifecycle::deprecate_warn("2.4.5", "dev_mode()")
2336
lib_paths <- .libPaths()
2437

2538
path <- path_real(path)

R/devtools-package.R

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
#' @section Package options:
22
#'
33
#' Devtools uses the following [options()] to configure behaviour:
4-
#'
5-
#' \itemize{
6-
#' \item `devtools.path`: path to use for [dev_mode()]
7-
#'
8-
#' \item `devtools.name`: your name, used when signing draft
9-
#' emails.
10-
#'
11-
#' \item `devtools.install.args`: a string giving extra arguments passed
12-
#' to `R CMD install` by [install()].
13-
#' }
4+
#' * `devtools.install.args`: a string giving extra arguments passed to
5+
#' `R CMD install` by [install()].
6+
#' * `devtools.path`: Deprecated. Path used by the now-deprecated [dev_mode()]
7+
#' function.
148
#' @docType package
159
#' @keywords internal
1610
"_PACKAGE"

_pkgdown.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ reference:
3636
contents:
3737
- bash
3838
- clean_vignettes
39-
- dev_mode
4039
- dev_sitrep
4140
- github_pull
4241
- lint

man/dev_mode.Rd

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

man/devtools-package.Rd

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

0 commit comments

Comments
 (0)