ESMValGroup / ESMValTool

ESMValTool: A community diagnostic and performance metrics tool for routine evaluation of Earth system models in CMIP
https://www.esmvaltool.org
Apache License 2.0
210 stars 121 forks source link

Update `precommit` rev to fix `precommit` installation error #3666

Open mo-gill opened 1 week ago

mo-gill commented 1 week ago

This issue is to look at updating the precommit to a more recent version than v0.3.2.9007 that still functions correctly.

Using rev v0.3.2.9007of pre-commit to check for R was causing precommit installs to fail in this issue

[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: ('<mo-environmentlocation>', '--vanilla', '/var/tmp/tmp0bxucmjx/script.R')
return code: 1
stdout: (none)
stderr:
    # Bootstrapping renv 0.16.0 --------------------------------------------------
    Warning: unable to access index for repository https://cran.rstudio.com/src/contrib:
      cannot open URL 'https://cran.rstudio.com/src/contrib/PACKAGES'
    Warning: unable to access index for repository https://cloud.r-project.org/src/contrib:
      cannot open URL 'https://cloud.r-project.org/src/contrib/PACKAGES'
    * Downloading renv 0.16.0 ... FAILED
    Error in bootstrap(version, libpath) : failed to download renv 0.16.0
    Calls: source ... eval.parent -> eval -> eval -> eval -> eval -> bootstrap
    Execution halted

In commit https://github.com/ESMValGroup/ESMValTool/pull/3652/commits/9378a1e3e6a607b54602ce68acb913aad8990530 the rev of precommit was changed to rev: 'v0.1.3' in .pre-commit-config.yaml, which fixed the issue. However there is a more recent version worth trying as @bouweandela has suggested here.