python3Packages.pre-commit: 2.15.0 -> 2.16.0
This commit is contained in:
parent
461a7d223c
commit
574e92dac6
2 changed files with 16 additions and 29 deletions
|
@ -1,47 +1,47 @@
|
||||||
{ lib
|
{ lib
|
||||||
, fetchPypi
|
|
||||||
, buildPythonPackage
|
, buildPythonPackage
|
||||||
, pythonOlder
|
|
||||||
, aspy-yaml
|
|
||||||
, cached-property
|
|
||||||
, cfgv
|
, cfgv
|
||||||
|
, fetchPypi
|
||||||
, identify
|
, identify
|
||||||
, importlib-metadata
|
, importlib-metadata
|
||||||
, importlib-resources
|
, importlib-resources
|
||||||
, nodeenv
|
, nodeenv
|
||||||
, python
|
, python
|
||||||
, six
|
, pythonOlder
|
||||||
|
, pyyaml
|
||||||
, toml
|
, toml
|
||||||
, virtualenv
|
, virtualenv
|
||||||
}:
|
}:
|
||||||
|
|
||||||
buildPythonPackage rec {
|
buildPythonPackage rec {
|
||||||
pname = "pre-commit";
|
pname = "pre-commit";
|
||||||
version = "2.15.0";
|
version = "2.16.0";
|
||||||
|
format = "setuptools";
|
||||||
|
|
||||||
disabled = pythonOlder "3.6";
|
disabled = pythonOlder "3.6";
|
||||||
|
|
||||||
src = fetchPypi {
|
src = fetchPypi {
|
||||||
inherit version;
|
inherit version;
|
||||||
pname = "pre_commit";
|
pname = "pre_commit";
|
||||||
sha256 = "sha256-PCWt1429+2ooplF4DVwxGsQN0X8WDrOVSgxZ2kClBac=";
|
sha256 = "sha256-/piXysgwqnFk29AqTnuQyuSWMEUc6IRkvKc9tIa6n2U=";
|
||||||
};
|
};
|
||||||
|
|
||||||
patches = [
|
patches = [
|
||||||
./hook-tmpl-use-the-hardcoded-path-to-pre-commit.patch
|
|
||||||
./languages-use-the-hardcoded-path-to-python-binaries.patch
|
./languages-use-the-hardcoded-path-to-python-binaries.patch
|
||||||
];
|
];
|
||||||
|
|
||||||
propagatedBuildInputs = [
|
propagatedBuildInputs = [
|
||||||
aspy-yaml
|
|
||||||
cached-property
|
|
||||||
cfgv
|
cfgv
|
||||||
identify
|
identify
|
||||||
nodeenv
|
nodeenv
|
||||||
six
|
pyyaml
|
||||||
toml
|
toml
|
||||||
virtualenv
|
virtualenv
|
||||||
] ++ lib.optional (pythonOlder "3.8") importlib-metadata
|
] ++ lib.optional (pythonOlder "3.8") [
|
||||||
++ lib.optional (pythonOlder "3.7") importlib-resources;
|
importlib-metadata
|
||||||
|
] ++ lib.optional (pythonOlder "3.7") [
|
||||||
|
importlib-resources
|
||||||
|
];
|
||||||
|
|
||||||
# slow and impure
|
# slow and impure
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
|
@ -55,7 +55,9 @@ buildPythonPackage rec {
|
||||||
--subst-var-by nodeenv ${nodeenv}
|
--subst-var-by nodeenv ${nodeenv}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
pythonImportsCheck = [ "pre_commit" ];
|
pythonImportsCheck = [
|
||||||
|
"pre_commit"
|
||||||
|
];
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "A framework for managing and maintaining multi-language pre-commit hooks";
|
description = "A framework for managing and maintaining multi-language pre-commit hooks";
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
diff --git a/pre_commit/resources/hook-tmpl b/pre_commit/resources/hook-tmpl
|
|
||||||
index 299144e..6d12543 100755
|
|
||||||
--- a/pre_commit/resources/hook-tmpl
|
|
||||||
+++ b/pre_commit/resources/hook-tmpl
|
|
||||||
@@ -25,8 +25,8 @@ ARGS.append('--')
|
|
||||||
ARGS.extend(sys.argv[1:])
|
|
||||||
|
|
||||||
DNE = '`pre-commit` not found. Did you forget to activate your virtualenv?'
|
|
||||||
-if os.access(INSTALL_PYTHON, os.X_OK):
|
|
||||||
- CMD = [INSTALL_PYTHON, '-mpre_commit']
|
|
||||||
+if os.access('@pre-commit@/bin/pre-commit', os.X_OK):
|
|
||||||
+ CMD = ['@pre-commit@/bin/pre-commit']
|
|
||||||
elif which('pre-commit'):
|
|
||||||
CMD = ['pre-commit']
|
|
||||||
else:
|
|
Loading…
Reference in a new issue