Incorrect replacement suggested for devtools::update_packages() without arguments
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 52/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- r
调研方向
Start from the deprecation warning that devtools::update_packages() emits when called with no arguments, and from the migration note that maps it to pak::pak(). Reproduce the no-argument call to see the exact wording, then check whether pak::pak() with no arguments really replaces it. Done means the warning and migration docs separate the three cases in the issue and name a working alternative, such as utils::update.packages(), for the no-argument case. Confirm the wording with a maintainer first, since the issue leaves the exact text open.
由索引模型根据 Issue 内容生成。
描述
Incorrect replacement suggested for devtools::update_packages() without arguments
Description
As of devtools 2.5.0, calling devtools::update_packages() without arguments produces the warning:
`update_packages()` was deprecated in devtools 2.5.0.
Please use `pak::pak()` instead.
However, pak::pak() without arguments is not a drop-in replacement for devtools::update_packages().
Reproducible example
devtools::update_packages()
# Warning: Please use `pak::pak()` instead.
pak::pak()
# Error: error in pak subprocess
# Caused by error in `find_package_root(path = root)`:
# Could not find R package in `.` or its parent directories.
The suggested replacement requires a package project in the current directory or its parent directories, whereas the original function could be called without specifying a package.
Expected behavior
The deprecation warning should provide a working replacement for the no-argument invocation or explain that there is no direct equivalent.
The migration guide currently documents:
update_packages("pkg") -> pak::pak("pkg")
However, it does not address the no-argument invocation.
Suggested improvement
Please update the deprecation warning and migration documentation to distinguish between:
- Updating a specified package.
- Updating installed packages without specifying a package.
- Installing or updating dependencies of the current package project.
If pak does not provide an equivalent for the no-argument invocation, the warning should state this explicitly and recommend an appropriate alternative, such as utils::update.packages() where applicable.
Why this matters
Following the deprecation warning verbatim results in an error in a context where the original function worked.
Deprecation warnings should provide actionable migration guidance, particularly when the recommended replacement has different default behavior.
- 主要语言
- R
- 星标
- 2.5k
- 派生
- 760
- 平均合并
- 1 天 6 小时
- 30 天内合并 PR
- 3
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
r-lib/devtools 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 86/100
-
`dev_sitrep()` says to update with `pak::pak("somePackage")` but doing so doesn't change the report可能已有人在做 @fabiandistler 于 82 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 68/100
-
难度 5/5 一周以上 新手友好度 25/100
-
devtools::load_all() has an extra warning that pkgload::load_all() doesn't可能已有人在做 @emstruong 于 278 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 45/100
-
难度 5/5 一周以上 新手友好度 30/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
hubverse-org/hubDevs#83 ·
-
data_bio2rarify - doc - dimensions wrong可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 1/5 1 小时以内 新手友好度 88/100
leppott/BioMonTools#162 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
bug
难度 1/5 1 小时以内 新手友好度 78/100
-
publications
难度 1/5 1 小时以内 新手友好度 85/100
epiforecasts/epiforecasts.github.io#161 ·
维护者通常 1 天内回复