Incorrect replacement suggested for devtools::update_packages() without arguments
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Accessibilité débutants
- 52/100
- Type d'issue
- Bug
- Clarté
- Plutôt claire
- Activité
- Active
- Stack technique
- r
- Domaine
- developer-experience, documentation, tooling
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- R
- Étoiles
- 2.5k
- Forks
- 762
- Merge moyen
- 1 j 6 h
- PR mergées (30 j)
- 3
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de r-lib/devtools
-
Difficulté 2/5 1-3 heures Accessibilité débutants 86/100
-
`dev_sitrep()` says to update with `pak::pak("somePackage")` but doing so doesn't change the reportPeut-être pris @fabiandistler l’a pris il y a 82 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 25/100
-
devtools::load_all() has an extra warning that pkgload::load_all() doesn'tPeut-être pris @emstruong l’a pris il y a 279 jours. Ouverte
Difficulté 3/5 1-2 jours Accessibilité débutants 45/100
-
Respect `vacation.dcf`Ouverte
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 30/100
Toutes les issues de r-lib/devtools
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
hubverse-org/hubDevs#83 ·
-
data_bio2rarify - doc - dimensions wrongPeut-être pris Une pull request liée à cette issue est ouverte ou déjà fusionnée. Ouverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 88/100
leppott/BioMonTools#162 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
r-lib/rig#535 · 2 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 1/5 Moins d'une heure Accessibilité débutants 78/100