Skip to content

Commit 7f09bc3

Browse files
committed
Merge branch 'feature/prek' into develop
2 parents bf7697c + bdcf604 commit 7f09bc3

File tree

4 files changed

+11
-17
lines changed

4 files changed

+11
-17
lines changed

.github/workflows/continuous-integration-quality-unit-tests.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ jobs:
2323
# https://github.com/scipy/scipy/issues/20613
2424
echo "OMP_NUM_THREADS=1" >> $GITHUB_ENV
2525
shell: bash
26-
- name: Set up Python 3.10 for Pre-Commit
27-
uses: actions/setup-python@v5
28-
with:
29-
python-version: "3.10"
3026
- name: Set up Python ${{ matrix.python-version }}
3127
uses: actions/setup-python@v5
3228
with:
@@ -51,9 +47,10 @@ jobs:
5147
uv sync --all-extras
5248
uv run python -c "import imageio;imageio.plugins.freeimage.download()"
5349
shell: bash
54-
- name: Pre-Commit (All Files)
50+
- name: Prek (All Files)
51+
if: matrix.os == 'macOS-latest'
5552
run: |
56-
uv run pre-commit run --all-files
53+
uv run prek run --all-files
5754
shell: bash
5855
- name: Test Optimised Python Execution
5956
run: |

colour/utilities/verbose.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,6 @@ def describe_environment(
792792
* coverage : 6.5.0 *
793793
* coveralls : 4.0.1 *
794794
* invoke : 2.2.0 *
795-
* pre-commit : 3.8.0 *
796795
* pydata-sphinx-theme : 0.15.4 *
797796
* pyright : 1.1.382.post1 *
798797
* pytest : 8.3.3 *
@@ -883,7 +882,6 @@ def _get_package_version(package: str, mapping: Mapping) -> str:
883882
if development_packages:
884883
mapping = {
885884
"biblib.bib": "biblib-simple",
886-
"pre_commit": "pre-commit",
887885
"pydata_sphinx_theme": "pydata-sphinx-theme",
888886
"pytest_cov": "pytest-cov",
889887
"pytest_xdist": "pytest-xdist",
@@ -896,7 +894,6 @@ def _get_package_version(package: str, mapping: Mapping) -> str:
896894
"coveralls",
897895
"invoke",
898896
"jupyter",
899-
"pre_commit",
900897
"pydata_sphinx_theme",
901898
"pyright",
902899
"pytest",

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ dev = [
9090
"hatch",
9191
"invoke",
9292
"jupyter",
93-
"pre-commit",
93+
"prek",
9494
"pyright",
9595
"pytest",
9696
"pytest-cov<7.0.0",

tasks.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"clean",
4545
"formatting",
4646
"quality",
47-
"precommit",
47+
"prek",
4848
"tests",
4949
"examples",
5050
"preflight",
@@ -85,7 +85,7 @@ def literalise(ctx: Context) -> None:
8585
with ctx.cd("utilities"):
8686
ctx.run("./literalise.py")
8787

88-
ctx.run("pre-commit run --files colour/hints/__init__.py", warn=True)
88+
ctx.run("prek run --files colour/hints/__init__.py", warn=True)
8989

9090

9191
@task
@@ -202,18 +202,18 @@ def quality(
202202

203203

204204
@task
205-
def precommit(ctx: Context) -> None:
205+
def prek(ctx: Context) -> None:
206206
"""
207-
Run the "pre-commit" hooks on the codebase.
207+
Run the "prek" hooks on the codebase.
208208
209209
Parameters
210210
----------
211211
ctx
212212
Context.
213213
"""
214214

215-
message_box('Running "pre-commit" hooks on the codebase...')
216-
ctx.run("pre-commit run --all-files")
215+
message_box('Running "prek" hooks on the codebase...')
216+
ctx.run("prek run --all-files")
217217

218218

219219
@task
@@ -268,7 +268,7 @@ def examples(ctx: Context, plots: bool = False) -> None:
268268
ctx.run(f"python {os.path.join(root, filename)}")
269269

270270

271-
@task(formatting, quality, precommit, tests, examples)
271+
@task(formatting, quality, prek, tests, examples)
272272
def preflight(ctx: Context) -> None: # noqa: ARG001
273273
"""
274274
Perform the preflight tasks.

0 commit comments

Comments
 (0)