From d460a34079afee8be36c62392efd5ac576174e3a Mon Sep 17 00:00:00 2001
From: Amir MOHAMMADI <amir.mohammadi@idiap.ch>
Date: Thu, 25 Mar 2021 15:15:33 +0100
Subject: [PATCH] [deps][conda] add pre-commit as a dependency

---
 bob/devtools/scripts/ci.py |  1 -
 conda/meta.yaml            |  1 +
 deps/order.txt             |  1 +
 deps/pre-commit/meta.yaml  | 34 ++++++++++++++++++++++++++++++++++
 4 files changed, 36 insertions(+), 1 deletion(-)
 create mode 100644 deps/pre-commit/meta.yaml

diff --git a/bob/devtools/scripts/ci.py b/bob/devtools/scripts/ci.py
index b2b49d73..4eb083e2 100644
--- a/bob/devtools/scripts/ci.py
+++ b/bob/devtools/scripts/ci.py
@@ -1019,7 +1019,6 @@ def check(root):
     if os.path.isfile(path):
         from ..bootstrap import run_cmdline
 
-        run_cmdline(["pip", "install", "pre-commit"])
         try:
             backup = os.environ.get("SKIP", "")
             os.environ["SKIP"] = "sphinx-build,sphinx-doctest"
diff --git a/conda/meta.yaml b/conda/meta.yaml
index 09a2ed1e..15feac54 100644
--- a/conda/meta.yaml
+++ b/conda/meta.yaml
@@ -51,6 +51,7 @@ requirements:
     - psutil
     - tabulate
     - python-graphviz
+    - pre-commit
 
 test:
   requires:
diff --git a/deps/order.txt b/deps/order.txt
index 9640df6c..c83dae78 100644
--- a/deps/order.txt
+++ b/deps/order.txt
@@ -2,3 +2,4 @@ repodata-patches
 python-gitlab
 untokenize
 docformatter
+pre-commit
diff --git a/deps/pre-commit/meta.yaml b/deps/pre-commit/meta.yaml
new file mode 100644
index 00000000..0a097e08
--- /dev/null
+++ b/deps/pre-commit/meta.yaml
@@ -0,0 +1,34 @@
+{% set name = "pre-commit" %}
+{% set version = "2.11.1" %}
+
+package:
+  name: "{{ name|lower }}"
+  version: "{{ version }}"
+
+source:
+  url: "https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz"
+  sha256: de55c5c72ce80d79106e48beb1b54104d16495ce7f95b0c7b13d4784193a00af
+
+build:
+  number: 0
+  script: "{{ PYTHON }} -m pip install . -vv"
+
+requirements:
+  host:
+    - pip
+    - python
+  run:
+    - python
+
+about:
+  home: The package home page
+  license: MIT
+  license_family: MIT
+  license_file:
+  summary: "A framework for managing and maintaining multi-language pre-commit hooks."
+  doc_url:
+  dev_url:
+
+extra:
+  recipe-maintainers:
+    - amohammadi
-- 
GitLab