From f504245f35791f7ce5913f310d82a1f2f8433523 Mon Sep 17 00:00:00 2001 From: Ruslan Kuprieiev Date: Fri, 29 May 2020 21:20:46 +0300 Subject: [PATCH] pre-commit: don't run dvc in parallel (#3912) * pre-commit: use local hooks * pre-commit: don't run dvc in parallel By default pre-commit will try to run hooks in parallel, which results in some dvc instances failing to acquire repo locks. Fixes #3751 --- .pre-commit-config.yaml | 33 ++++++++++++++++++++++++++------- .pre-commit-hooks.yaml | 3 +++ scripts/ci/check_patch.sh | 2 +- 3 files changed, 30 insertions(+), 8 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b1f7557ef..d6787fb78 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -27,18 +27,37 @@ repos: repo: https://github.com/lovesegfault/beautysh rev: master - hooks: - - id: dvc-pre-commit - language_version: python3 + - args: + - git-hook + - pre-commit + entry: dvc + id: dvc-pre-commit + language: system + name: DVC pre-commit stages: - commit - - id: dvc-pre-push - language_version: python3 + verbose: true + require_serial: true + - args: + - git-hook + - pre-push + entry: dvc + id: dvc-pre-push + language: system + name: DVC pre-push stages: - push + require_serial: true - always_run: true + args: + - git-hook + - post-checkout + entry: dvc id: dvc-post-checkout - language_version: python3 + language: system + minimum_pre_commit_version: 2.2.0 + name: DVC post-checkout stages: - post-checkout - repo: https://github.com/iterative/dvc - rev: master + require_serial: true + repo: local diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index 7926191fb..bf58b4b97 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -6,6 +6,7 @@ language: python language_version: python3 name: DVC pre-commit + require_serial: true stages: - commit verbose: true @@ -17,6 +18,7 @@ language: python language_version: python3 name: DVC pre-push + require_serial: true stages: - push - always_run: true @@ -29,5 +31,6 @@ language_version: python3 minimum_pre_commit_version: 2.2.0 name: DVC post-checkout + require_serial: true stages: - post-checkout diff --git a/scripts/ci/check_patch.sh b/scripts/ci/check_patch.sh index f35708634..543a87b67 100755 --- a/scripts/ci/check_patch.sh +++ b/scripts/ci/check_patch.sh @@ -3,7 +3,7 @@ set -x set -e -pip install Pygments collective.checkdocs pre-commit +pip install Pygments collective.checkdocs pre-commit . # stop the build if there are any readme formatting errors python setup.py checkdocs