|
1 | | -#' @importFrom ellipsis check_dots_used |
2 | | -with_ellipsis <- function(fun) { |
3 | | - b <- body(fun) |
4 | | - |
5 | | - f <- function(...) { |
6 | | - ellipsis::check_dots_used( |
7 | | - action = getOption("devtools.ellipsis_action", rlang::warn) |
8 | | - ) |
9 | | - |
10 | | - !!b |
11 | | - } |
12 | | - f <- rlang::expr_interp(f) |
13 | | - |
14 | | - body(fun) <- body(f) |
15 | | - fun |
16 | | -} |
17 | | - |
18 | | -with_pkgbuild_build_tools <- function(fun) { |
19 | | - b <- body(fun) |
20 | | - pkgbuild_call <- as.call(c( |
21 | | - call("::", as.symbol("pkgbuild"), as.symbol("with_build_tools")), |
22 | | - b, |
23 | | - list(required = FALSE) |
24 | | - )) |
25 | | - |
26 | | - body(fun) <- pkgbuild_call |
27 | | - fun |
28 | | -} |
29 | | - |
30 | | -#' Functions re-exported from the remotes package |
| 1 | +#' Deprecated package installation functions |
31 | 2 | #' |
32 | | - |
33 | | -#' These functions are re-exported from the remotes package. They differ only |
34 | | -#' that the ones in devtools use the [ellipsis] package to ensure all dotted |
35 | | -#' arguments are used. |
| 3 | +#' @description |
| 4 | +#' `r lifecycle::badge("deprecated")` |
| 5 | +#' |
| 6 | +#' These functions have been deprecated in favor of [pak](https://pak.r-lib.org/), |
| 7 | +#' as that is what we now recommend for package installation. There are a few |
| 8 | +#' functions which have no pak equivalent, where you can instead call the |
| 9 | +#' old remotes functions directly. |
| 10 | +#' |
| 11 | +#' ## Migration guide |
36 | 12 | #' |
37 | | -#' Follow the links below to see the documentation. |
38 | | -#' [remotes::install_bioc()], [remotes::install_bitbucket()], [remotes::install_cran()], [remotes::install_dev()], |
39 | | -#' [remotes::install_git()], [remotes::install_github()], [remotes::install_gitlab()], [remotes::install_local()], |
40 | | -#' [remotes::install_svn()], [remotes::install_url()], [remotes::install_version()], [remotes::update_packages()], |
41 | | -#' [remotes::dev_package_deps()]. |
| 13 | +#' | devtools function | Replacement | |
| 14 | +#' |-------------------|-------------| |
| 15 | +#' | `install_bioc("pkg")` | `pak::pak("bioc::pkg")` | |
| 16 | +#' | `install_bitbucket("user/repo")` | `remotes::install_bitbucket("user/repo")` | |
| 17 | +#' | `install_cran("pkg")` | `pak::pak("pkg")` | |
| 18 | +#' | `install_dev("pkg")` | `remotes::install_dev("pkg")` | |
| 19 | +#' | `install_git("url")` | `pak::pak("git::url")` | |
| 20 | +#' | `install_github("user/repo")` | `pak::pak("user/repo")` | |
| 21 | +#' | `install_gitlab("user/repo")` | `pak::pak("gitlab::user/repo")` | |
| 22 | +#' | `install_local("path")` | `pak::pak("local::path")` | |
| 23 | +#' | `install_svn("url")` | `remotes::install_svn("url")` | |
| 24 | +#' | `install_url("url")` | `pak::pak("url::url")` | |
| 25 | +#' | `install_version("pkg", "1.0.0")` | `pak::pak("pkg@1.0.0")` | |
| 26 | +#' | `update_packages("pkg")` | `pak::pak("pkg")` | |
| 27 | +#' | `dev_package_deps()` | `pak::local_dev_deps()` | |
| 28 | +#' | `github_pull("123")` | `remotes::github_pull("123")` | |
| 29 | +#' | `github_release()` | `remotes::github_release()` | |
42 | 30 | #' |
43 | | -#' @importFrom remotes install_bioc |
44 | | -#' @name remote-reexports |
| 31 | +#' @name install-deprecated |
45 | 32 | #' @keywords internal |
| 33 | +NULL |
| 34 | + |
| 35 | +#' @rdname install-deprecated |
46 | 36 | #' @export |
47 | | -install_bioc <- with_pkgbuild_build_tools(with_ellipsis(remotes::install_bioc)) |
| 37 | +install_bioc <- function(...) { |
| 38 | + lifecycle::deprecate_warn( |
| 39 | + "2.5.0", |
| 40 | + "install_bioc()", |
| 41 | + I('pak::pak("bioc::pkg")') |
| 42 | + ) |
| 43 | + pkgbuild::with_build_tools(remotes::install_bioc(...), required = FALSE) |
| 44 | +} |
48 | 45 |
|
49 | | -#' @importFrom remotes install_bitbucket |
50 | | -#' @rdname remote-reexports |
| 46 | +#' @rdname install-deprecated |
51 | 47 | #' @export |
52 | | -install_bitbucket <- with_pkgbuild_build_tools(with_ellipsis( |
53 | | - remotes::install_bitbucket |
54 | | -)) |
| 48 | +install_bitbucket <- function(...) { |
| 49 | + lifecycle::deprecate_warn( |
| 50 | + "2.5.0", |
| 51 | + "install_bitbucket()", |
| 52 | + "remotes::install_bitbucket()" |
| 53 | + ) |
| 54 | + pkgbuild::with_build_tools(remotes::install_bitbucket(...), required = FALSE) |
| 55 | +} |
55 | 56 |
|
56 | | -#' @importFrom remotes install_cran |
57 | | -#' @rdname remote-reexports |
| 57 | +#' @rdname install-deprecated |
58 | 58 | #' @export |
59 | | -install_cran <- with_pkgbuild_build_tools(with_ellipsis(remotes::install_cran)) |
| 59 | +install_cran <- function(...) { |
| 60 | + lifecycle::deprecate_warn("2.5.0", "install_cran()", "pak::pak()") |
| 61 | + pkgbuild::with_build_tools(remotes::install_cran(...), required = FALSE) |
| 62 | +} |
60 | 63 |
|
61 | | -#' @importFrom remotes install_dev |
62 | | -#' @rdname remote-reexports |
| 64 | +#' @rdname install-deprecated |
63 | 65 | #' @export |
64 | | -install_dev <- with_pkgbuild_build_tools(with_ellipsis(remotes::install_dev)) |
| 66 | +install_dev <- function(...) { |
| 67 | + lifecycle::deprecate_warn("2.5.0", "install_dev()", "remotes::install_dev()") |
| 68 | + pkgbuild::with_build_tools(remotes::install_dev(...), required = FALSE) |
| 69 | +} |
65 | 70 |
|
66 | | -#' @importFrom remotes install_git |
67 | | -#' @rdname remote-reexports |
| 71 | +#' @rdname install-deprecated |
68 | 72 | #' @export |
69 | | -install_git <- with_pkgbuild_build_tools(with_ellipsis(remotes::install_git)) |
| 73 | +install_git <- function(...) { |
| 74 | + lifecycle::deprecate_warn("2.5.0", "install_git()", I('pak::pak("git::url")')) |
| 75 | + pkgbuild::with_build_tools(remotes::install_git(...), required = FALSE) |
| 76 | +} |
70 | 77 |
|
71 | | -#' @importFrom remotes install_github |
72 | | -#' @rdname remote-reexports |
| 78 | +#' @rdname install-deprecated |
73 | 79 | #' @export |
74 | | -install_github <- with_pkgbuild_build_tools(with_ellipsis( |
75 | | - remotes::install_github |
76 | | -)) |
| 80 | +install_github <- function(...) { |
| 81 | + lifecycle::deprecate_warn( |
| 82 | + "2.5.0", |
| 83 | + "install_github()", |
| 84 | + I('pak::pak("user/repo")') |
| 85 | + ) |
| 86 | + pkgbuild::with_build_tools(remotes::install_github(...), required = FALSE) |
| 87 | +} |
77 | 88 |
|
78 | | -#' @importFrom remotes github_pull |
79 | | -#' @rdname reexports |
| 89 | +#' @rdname install-deprecated |
80 | 90 | #' @export |
81 | | -remotes::github_pull |
| 91 | +install_gitlab <- function(...) { |
| 92 | + lifecycle::deprecate_warn( |
| 93 | + "2.5.0", |
| 94 | + "install_gitlab()", |
| 95 | + I('pak::pak("gitlab::user/repo")') |
| 96 | + ) |
| 97 | + pkgbuild::with_build_tools(remotes::install_gitlab(...), required = FALSE) |
| 98 | +} |
82 | 99 |
|
83 | | -#' @importFrom remotes github_release |
84 | | -#' @rdname reexports |
| 100 | +#' @rdname install-deprecated |
85 | 101 | #' @export |
86 | | -remotes::github_release |
| 102 | +install_local <- function(...) { |
| 103 | + lifecycle::deprecate_warn( |
| 104 | + "2.5.0", |
| 105 | + "install_local()", |
| 106 | + I('pak::pak("local::path")') |
| 107 | + ) |
| 108 | + pkgbuild::with_build_tools(remotes::install_local(...), required = FALSE) |
| 109 | +} |
87 | 110 |
|
88 | | -#' @importFrom remotes install_gitlab |
89 | | -#' @rdname remote-reexports |
| 111 | +#' @rdname install-deprecated |
90 | 112 | #' @export |
91 | | -install_gitlab <- with_pkgbuild_build_tools(with_ellipsis( |
92 | | - remotes::install_gitlab |
93 | | -)) |
| 113 | +install_svn <- function(...) { |
| 114 | + lifecycle::deprecate_warn("2.5.0", "install_svn()", "remotes::install_svn()") |
| 115 | + pkgbuild::with_build_tools(remotes::install_svn(...), required = FALSE) |
| 116 | +} |
94 | 117 |
|
95 | | -#' @importFrom remotes install_local |
96 | | -#' @rdname remote-reexports |
| 118 | +#' @rdname install-deprecated |
97 | 119 | #' @export |
98 | | -install_local <- with_pkgbuild_build_tools(with_ellipsis( |
99 | | - remotes::install_local |
100 | | -)) |
| 120 | +install_url <- function(...) { |
| 121 | + lifecycle::deprecate_warn("2.5.0", "install_url()", I('pak::pak("url::url")')) |
| 122 | + pkgbuild::with_build_tools(remotes::install_url(...), required = FALSE) |
| 123 | +} |
101 | 124 |
|
102 | | -#' @importFrom remotes install_svn |
103 | | -#' @rdname remote-reexports |
| 125 | +#' @rdname install-deprecated |
104 | 126 | #' @export |
105 | | -install_svn <- with_pkgbuild_build_tools(with_ellipsis(remotes::install_svn)) |
| 127 | +install_version <- function(...) { |
| 128 | + lifecycle::deprecate_warn( |
| 129 | + "2.5.0", |
| 130 | + "install_version()", |
| 131 | + I('pak::pak("pkg@version")') |
| 132 | + ) |
| 133 | + pkgbuild::with_build_tools(remotes::install_version(...), required = FALSE) |
| 134 | +} |
106 | 135 |
|
107 | | -#' @importFrom remotes install_url |
108 | | -#' @rdname remote-reexports |
| 136 | +#' @rdname install-deprecated |
109 | 137 | #' @export |
110 | | -install_url <- with_pkgbuild_build_tools(with_ellipsis(remotes::install_url)) |
| 138 | +update_packages <- function(...) { |
| 139 | + lifecycle::deprecate_warn("2.5.0", "update_packages()", "pak::pak()") |
| 140 | + pkgbuild::with_build_tools(remotes::update_packages(...), required = FALSE) |
| 141 | +} |
111 | 142 |
|
112 | | -#' @importFrom remotes install_version |
113 | | -#' @rdname remote-reexports |
| 143 | +#' @rdname install-deprecated |
114 | 144 | #' @export |
115 | | -install_version <- with_pkgbuild_build_tools(with_ellipsis( |
116 | | - remotes::install_version |
117 | | -)) |
| 145 | +dev_package_deps <- function(...) { |
| 146 | + lifecycle::deprecate_warn( |
| 147 | + "2.5.0", |
| 148 | + "dev_package_deps()", |
| 149 | + "pak::local_dev_deps()" |
| 150 | + ) |
| 151 | + pkgbuild::with_build_tools(remotes::dev_package_deps(...), required = FALSE) |
| 152 | +} |
118 | 153 |
|
119 | | -#' @importFrom remotes update_packages |
120 | | -#' @rdname remote-reexports |
| 154 | +#' @rdname install-deprecated |
121 | 155 | #' @export |
122 | | -update_packages <- with_pkgbuild_build_tools(with_ellipsis( |
123 | | - remotes::update_packages |
124 | | -)) |
| 156 | +github_pull <- function(...) { |
| 157 | + lifecycle::deprecate_warn("2.5.0", "github_pull()", "remotes::github_pull()") |
| 158 | + remotes::github_pull(...) |
| 159 | +} |
125 | 160 |
|
126 | | -#' @importFrom remotes dev_package_deps |
127 | | -#' @rdname remote-reexports |
| 161 | +#' @rdname install-deprecated |
128 | 162 | #' @export |
129 | | -dev_package_deps <- with_pkgbuild_build_tools(remotes::dev_package_deps) |
| 163 | +github_release <- function(...) { |
| 164 | + lifecycle::deprecate_warn( |
| 165 | + "2.5.0", |
| 166 | + "github_release()", |
| 167 | + "remotes::github_release()" |
| 168 | + ) |
| 169 | + remotes::github_release(...) |
| 170 | +} |
0 commit comments