diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-02-27 10:32:18 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-02-27 10:32:18 +0000 |
commit | a75e61fbe483eb1f3bbfb2d61d7c15615f56172b (patch) | |
tree | 2200a67ca0cbe0c8091c69a447c70c3b0ca0a79c /pre_commit/repository.py | |
parent | Adding upstream version 3.0.4. (diff) | |
download | pre-commit-a75e61fbe483eb1f3bbfb2d61d7c15615f56172b.tar.xz pre-commit-a75e61fbe483eb1f3bbfb2d61d7c15615f56172b.zip |
Adding upstream version 3.1.0.upstream/3.1.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'pre_commit/repository.py')
-rw-r--r-- | pre_commit/repository.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/pre_commit/repository.py b/pre_commit/repository.py index 616faf5..040f238 100644 --- a/pre_commit/repository.py +++ b/pre_commit/repository.py @@ -3,17 +3,18 @@ from __future__ import annotations import json import logging import os +import shlex from typing import Any from typing import Sequence import pre_commit.constants as C +from pre_commit.all_languages import languages from pre_commit.clientlib import load_manifest from pre_commit.clientlib import LOCAL from pre_commit.clientlib import META from pre_commit.clientlib import parse_version from pre_commit.hook import Hook -from pre_commit.languages.all import languages -from pre_commit.languages.helpers import environment_dir +from pre_commit.lang_base import environment_dir from pre_commit.prefix import Prefix from pre_commit.store import Store from pre_commit.util import clean_path_on_failure @@ -32,7 +33,7 @@ def _state_filename_v2(venv: str) -> str: def _state(additional_deps: Sequence[str]) -> object: - return {'additional_dependencies': sorted(additional_deps)} + return {'additional_dependencies': additional_deps} def _read_state(venv: str) -> object | None: @@ -68,6 +69,14 @@ def _hook_install(hook: Hook) -> None: logger.info('Once installed this environment will be reused.') logger.info('This may take a few minutes...') + if hook.language == 'python_venv': + logger.warning( + f'`repo: {hook.src}` uses deprecated `language: python_venv`. ' + f'This is an alias for `language: python`. ' + f'Often `pre-commit autoupdate --repo {shlex.quote(hook.src)}` ' + f'will fix this.', + ) + lang = languages[hook.language] assert lang.ENVIRONMENT_DIR is not None |