rstudioapi dependency not installed by roxygenize hook
**Before filing a bug**
- [x] I have installed the latest dev version of {precommit} with `remotes::install_github('lorenzwalthert/precommit')`
- [x] I have installed the latest hook revisions (update with `precommit::autoupdate()`)
- [x] I have installed the latest release of the upstream Python framework pre-comit as described under the [update instructions](https://lorenzwalthert.github.io/precommit/dev/articles/precommit.html#update).
**Describe the bug**
I have a package that depends on `rstudioapi` and declares so in its DESCRIPTION
```
Imports:
yaml,
glue,
here,
stringr,
methods,
rlang,
rstudioapi (>= 0.11)
```
The package uses the `roxygenize` hook:
```
repos:
- repo: https://github.com/lorenzwalthert/precommit
rev: v0.4.3.9003
hooks:
- id: roxygenize
```
When running
```
pre-commit run --all-files
```
it fails with
```
roxygenize...............................................................Failed
- hook id: roxygenize
- exit code: 1
- The project is out-of-sync -- use `renv::status()` for details.
- The project is out-of-sync -- use `renv::status()` for details.
ℹ Loading dso
Error in `precommit::roxygenize_with_cache()`:
! The package "rstudioapi" (>= 0.11) is required.
Backtrace:
▆
1. └─precommit::roxygenize_with_cache(key = wd, dirs = path_relative_cache)
2. └─rlang::abort(conditionMessage(out)) at repocskrdn2t/R/roxygen2.R:103:5
Execution halted
```
**Expected behavior**
All declared dependencies are automatically installed
**Additional context**
- My operating system is: Rocky 9.4
- ~~[ ] My project uses {renv}.~~
- ~~[ ] the output of `packageVersion('renv')`~~
I was wondering if this is the same as https://github.com/lorenzwalthert/precommit/issues/589, but it https://github.com/lorenzwalthert/precommit/issues/589 already fails on installing the hook, whereas in my case it only fails open executing the hook. I also tried the pre-commit version from the branch you mention in that issue and it didn't help.
关闭于 2025-01-31 3 条评论