spyder-ide / spyder-docs

Documentation for Spyder, the Scientific Python Development Environment
https://docs.spyder-ide.org
MIT License
32 stars 274 forks source link

Use `require_serial` for `sphinx-lint` in `.pre-commit-config.yaml` #353

Closed ezio-melotti closed 9 months ago

ezio-melotti commented 9 months ago

Pull Request

Pull Request Checklist

Description of Changes

sphinx-lint already uses multiprocessing internally, and this might interfere with precommit, since it will try to use multiple processes too. By setting require_serial we prevent precommit from doing that.

See:

CAM-Gerlach commented 9 months ago

I'm a little confused—wasn't the purpose of including this in the pre-commit-hooks config in sphinx-contrib/sphinx-lint#95 , released in Sphinx-Lint 0.8.1 which we adopted in #351 , such that each individual project wouldn't need to add this?

Testing locally with time pre-commit run --all sphinx-lint on an old, slow single-threaded by decent multi-threaded with pre-commit 2.20.0 on both master and this branch that are identical except for this setting, I get essentially identical times for running this check, well within the margin of error (3.75 s +/- 0.3 s vs 3.87 s, +/- 0.4 s across 5 trials each), which suggests it has no measurable effect.

Is there something I'm missing here? Thanks!

ezio-melotti commented 9 months ago

Is there something I'm missing here?

Actually I was the one who got confused.

To summarize:

IOW, this PR is not necessary, and can be closed. Sorry for the noise!

CAM-Gerlach commented 9 months ago

Thanks Ezio!