-
-
Notifications
You must be signed in to change notification settings - Fork 51
Description
Before filing a bug
- I have installed the latest dev version of {precommit} with
remotes::install_github('lorenzwalthert/precommit') - I have installed the latest hook revisions (update with
precommit::autoupdate()) - I have installed the latest release of the upstream Python framework pre-comit as described under the update instructions.
Describe the bug
Dependency errors when using precommit. Says xfun: conflicts with [email protected]
$ git commit -m "test"
[INFO] Initializing environment for https://github.com/lorenzwalthert/precommit.
[INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Initializing environment for https://github.com/pre-commit-ci/pre-commit-ci-config.
[INFO] Installing environment for https://github.com/lorenzwalthert/precommit.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: CalledProcessError: command: ('C:/PROGRA1/R/R-451.1\bin\Rscript.exe', '--vanilla', 'C:\Users\name\AppData\Local\Temp\tmp_fkmnpbn\script.R')
return code: 1
stdout:
# Bootstrapping renv 1.1.5 ---------------------------------------------------
- Downloading renv ... OK
- Installing renv ... OK
- One or more packages recorded in the lockfile are not installed.
- Use `renv::status()` for more details.
The following package(s) will be installed:
- pak [0.9.0]
These packages will be installed into "~/.cache/pre-commit/reponkl02hgo/renv-default/renv/library/windows/R-4.5/x86_64-w64-mingw32".
# Installing packages --------------------------------------------------------
- Installing pak ... OK [linked from cache]
Successfully installed 1 package in 14 milliseconds.
Traceback (most recent calls last):
6: renv::restore()
5: renv_pak_restore(lockfile = lockfile, packages = packages, exclude = exclude,
prompt = prompt, project = project)
4: pak$pkg_install(pkg = remotes, ask = prompt)
3: remote(function(...) get("pkg_install_make_plan", asNamespace("pak"))(...),
list(pkg = pkg, lib = lib, upgrade = upgrade, ask = ask,
start = start, dependencies = dependencies, loaded = loaded_packages(lib)))
2: err$throw(res$error)
1: base::stop(cond)
stderr:
ℹ Loading metadata database
✔ Loading metadata database ... done
Error:
! error in pak subprocess
Caused by error:
! Could not solve package dependencies:
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: Can't install dependency xfun (>= 0.18)
* xfun: Conflicts with [email protected]
* [email protected]: Can't install dependency xfun (>= 0.51)
* ...
$ pre-commit --version
pre-commit 4.3.0
To Reproduce
Steps to reproduce the behavior:
- Make a new R package using package template from RStudio: File -> New project... -> New directory -> New R package
- Use precommit:
library(precommit)
use_precommit()
ℹ Using local config from C:/Users/name/AppData/Local/R/win-library/4.5/precommit/pre-commit-config-pkg.yaml.
✔ Copied .pre-commit-config.yaml to C:/Users/name/Documents/GitHub/rprecommit
✔ Adding ^.pre-commit-config.yaml$ to C:/Users/name/Documents/GitHub/rprecommit/.Rbuildignore.
• Edit .precommit-config.yaml to (de)activate the hooks you want to use.
• All available hooks: https://pre-commit.com/hooks.html
• R specific hooks: https://github.com/lorenzwalthert/precommit
✔ Ranpre-commit autoupdate ()to get the latest version of the hooks.
ℹ Installing hooks in non-blocking background process. If you experience problems or prefer a blocking process, useoptions("precommit.block_install_hooks" = TRUE).
• Sign in with GitHub to authenticate https://pre-commit.ci and then come back to complete the set-up process. • It seems like you are using the roxygenize hook. This requires further edits in your.pre-commit-config.yaml, please runprecommit::snippet_generate('additional-deps-roxygenize')to proceed.
precommit::snippet_generate('additional-deps-roxygenize')
Generating snippet using CRAN versions. If you need another source, specify with syntax thatrenv::install()understands (see examples in help file).
✔ According to `DESCRIPTION``, there are no hard dependencies of your package. You are set.
NULL
- Commit with git:
$ git add .
warning: in the working copy of '.Rbuildignore', CRLF will be replaced by LF the next time Git touches it
warning: in the working copy of '.gitignore', CRLF will be replaced by LF the next time Git touches it
warning: in the working copy of 'DESCRIPTION', CRLF will be replaced by LF the next time Git touches it
warning: in the working copy of 'NAMESPACE', CRLF will be replaced by LF the next time Git touches it
warning: in the working copy of 'R/hello.R', CRLF will be replaced by LF the next time Git touches it
warning: in the working copy of 'man/hello.Rd', CRLF will be replaced by LF the next time Git touches it
warning: in the working copy of 'rprecommit.Rproj', CRLF will be replaced by LF the next time Git touches it
$ git commit -m "test"
[INFO] Locking pre-commit directory
[INFO] Installing environment for https://github.com/lorenzwalthert/precommit.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: CalledProcessError: command: ('C:/PROGRA1/R/R-451.1\bin\Rscript.exe', '--vanilla', 'C:\Users\name\AppData\Local\Temp\tmpejlzrqbv\script.R')
return code: 1
stdout:
# Bootstrapping renv 1.1.5 ---------------------------------------------------
- Downloading renv ... OK
- Installing renv ... OK
- One or more packages recorded in the lockfile are not installed.
- Use `renv::status()` for more details.
The following package(s) will be installed:
- pak [0.9.0]
These packages will be installed into "~/.cache/pre-commit/reponkl02hgo/renv-default/renv/library/windows/R-4.5/x86_64-w64-mingw32".
# Installing packages --------------------------------------------------------
- Installing pak ... OK [linked from cache]
Successfully installed 1 package in 35 milliseconds.
Traceback (most recent calls last):
6: renv::restore()
5: renv_pak_restore(lockfile = lockfile, packages = packages, exclude = exclude,
prompt = prompt, project = project)
4: pak$pkg_install(pkg = remotes, ask = prompt)
3: remote(function(...) get("pkg_install_make_plan", asNamespace("pak"))(...),
list(pkg = pkg, lib = lib, upgrade = upgrade, ask = ask,
start = start, dependencies = dependencies, loaded = loaded_packages(lib)))
2: err$throw(res$error)
1: base::stop(cond)
stderr:
ℹ Loading metadata database
✔ Loading metadata database ... done
Error:
! error in pak subprocess
Caused by error:
! Could not solve package dependencies:
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: Can't install dependency xfun (>= 0.18)
* xfun: Conflicts with [email protected]
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: Can't install dependency xfun (>= 0.51)
* [email protected]: dependency conflict
* [email protected]: Can't install dependency knitr
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: Can't install dependency knitr
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: Can't install dependency knitr
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
* [email protected]: dependency conflict
---
Backtrace:
1. renv::restore()
2. renv:::renv_pak_restore(lockfile = lockfile, packages = packages, exclude = exclu…
3. pak$pkg_install(pkg = remotes, ask = prompt)
4. pak:::remote(function(...) get("pkg_install_make_plan", asNamespace("pak"))(...)…
5. err$throw(res$error)
---
Subprocess backtrace:
1. base::withCallingHandlers(cli_message = function(msg) { …
2. get("pkg_install_make_plan", asNamespace("pak"))(...)
3. prop$stop_for_solution_error()
4. private$plan$stop_for_solve_error()
5. pkgdepends:::pkgplan_stop_for_solve_error(self, private)
6. base::throw(new_error("Could not solve package dependencies:\n", msg, …
7. | base::signalCondition(cond)
8. global (function (e) …
Execution halted
Check the log at C:\Users\name.cache\pre-commit\pre-commit.log
Expected behavior
That precommit works.
Additional context
- My operating system is: Windows 11
- My project uses {renv}.
- the output of
packageVersion('renv')1.1.5