Incorrect replacement suggested for devtools::update_packages() without arguments

Aperta
#2,709 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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

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

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di r-lib/devtools

Tutte le issue di r-lib/devtools

Issue simili

Altre issue su R

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.