Incorrect replacement suggested for devtools::update_packages() without arguments
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 52/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- r
- Ambito
- developer-experience, documentation, tooling
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- R
- Stelle
- 2.5k
- Fork
- 760
- Merge medio
- 1g 6h
- PR unite (30g)
- 3
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di r-lib/devtools
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
-
`dev_sitrep()` says to update with `pak::pak("somePackage")` but doing so doesn't change the reportForse già presa @fabiandistler l’ha presa 82 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
-
devtools::load_all() has an extra warning that pkgload::load_all() doesn'tForse già presa @emstruong l’ha presa 278 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
-
Respect `vacation.dcf`Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
Tutte le issue di r-lib/devtools
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
hubverse-org/hubDevs#83 ·
-
data_bio2rarify - doc - dimensions wrongForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
leppott/BioMonTools#162 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
-
publications
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
epiforecasts/epiforecasts.github.io#161 ·
I maintainer di solito rispondono entro 1 giorno