pymc-devs / pymc-examples

Examples of PyMC models, including a library of Jupyter notebooks.
https://www.pymc.io/projects/examples/en/latest/
MIT License
280 stars 242 forks source link

pre-commit-ci fails #638

Closed maresb closed 7 months ago

maresb commented 7 months ago

The pre-commit-ci workflow is failing. To reproduce locally:

cd pymc-examples
mkdir -p /tmp/pc
docker run --user=$(id -u):$(id -g) --rm -it -v $(pwd):/pymc-examples -v /tmp/pc:/pc ghcr.io/pre-commit-ci/runner-image:2023-10-02-d016aa1 bash
cd pymc-examples/
pre-commit

Result:

[INFO] Installing environment for https://github.com/FlamingTempura/bibtex-tidy.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: CalledProcessError: command: ('/pc/repovjwigntt/node_env-default/bin/node', '/pc/repovjwigntt/node_env-default/bin/npm', 'install', '--dev', '--prod', '--ignore-prepublish', '--no-progress', '--no-save')
return code: 1
stdout: (none)
stderr:
    npm WARN config dev Please use --include=dev instead.
    npm WARN config production Use `--omit=dev` instead.
    npm notice 
    npm notice New minor version of npm available! 10.2.4 -> 10.4.0
    npm notice Changelog: <https://github.com/npm/cli/releases/tag/v10.4.0>
    npm notice Run `npm install -g npm@10.4.0` to update!
    npm notice 
    npm ERR! code 1
    npm ERR! path /pc/repovjwigntt/node_modules/puppeteer
    npm ERR! command failed
    npm ERR! command sh -c node install.js
    npm ERR! ERROR: Failed to set up Chromium r1108766! Set "PUPPETEER_SKIP_DOWNLOAD" env variable to skip download.
    npm ERR! Error: EACCES: permission denied, mkdir '/.cache'
    npm ERR!     at async mkdir (node:internal/fs/promises:855:10)
    npm ERR!     at async BrowserFetcher.download (/pc/repovjwigntt/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserFetcher.js:256:13)
    npm ERR!     at async downloadBrowser (/pc/repovjwigntt/node_modules/puppeteer/lib/cjs/puppeteer/node/install.js:61:5) {
    npm ERR!   errno: -13,
    npm ERR!   code: 'EACCES',
    npm ERR!   syscall: 'mkdir',
    npm ERR!   path: '/.cache'
    npm ERR! }

    npm ERR! A complete log of this run can be found in: /tmp/npm/_logs/2024-02-20T15_30_33_072Z-debug-0.log
Check the log at /pc/pre-commit.log

Today there was just a release of a new pre-commit-ci image, so I wonder if this will fix it. It isn't being picked up yet by the runners, so I presume it's still in testing.

Testing in #637

OriolAbril commented 7 months ago

Maybe it's only a matter of updating the pre-commit hook versions? I don't think they are updated regularly for this repo

maresb commented 7 months ago

I tried that and it didn't work. :(

It's something about Node. I wanted to look into if it's possible to set the Node version. But I suspect this is one of those things that'll resolve itself.

OriolAbril commented 7 months ago

OOohhh, it's probably the github action setup, more specifically: https://github.com/pymc-devs/pymc-examples/blob/main/.github/workflows/pre-commit.yml#L16C13-L16C34

maresb commented 7 months ago

Nope, the failure is on pre-commit-ci which runs independently of that GitHub workflow.

maresb commented 7 months ago

I don't really understand this or see how to fix it, but I also think it's not so important and we might as well just disable pre-commit-ci and use the existing hook instead.

Anyone with admin rights here able to disable pre-commit-ci here?

OriolAbril commented 7 months ago

Done, hope I didn't deactivate it for anything important while doing it though