Skip to content

Commit

Permalink
Revert to use invoke triggered literalise.
Browse files Browse the repository at this point in the history
  • Loading branch information
KelSolaar committed Sep 15, 2023
1 parent b6ff863 commit effcdfe
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ jobs:
ln -s /usr/local/Cellar/openimageio/*/lib/python*/site-packages/OpenImageIO/OpenImageIO*.so /Library/Frameworks/Python.framework/Versions/${{ matrix.python-version }}/lib/python${{ matrix.python-version }}/site-packages/OpenImageIO.so
shell: bash
- name: Pre-Commit (All Files)
# "poetry" is not available on Windows from within "pre-commit".
if: matrix.os == 'macOS-latest' || matrix.os == 'ubuntu-22.04'
run: |
poetry run pre-commit run --all-files
shell: bash
Expand Down
8 changes: 0 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
repos:
- repo: local
hooks:
- id: literalise
name: literalise
entry: poetry run python utilities/literalise.py
always_run: true
language: system
types: [ python ]
- repo: https://github.com/ikamensh/flynt/
rev: '1.0.1'
hooks:
Expand Down
21 changes: 20 additions & 1 deletion tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"PYPI_PACKAGE_NAME",
"PYPI_ARCHIVE_NAME",
"BIBLIOGRAPHY_NAME",
"literalise",
"clean",
"formatting",
"quality",
Expand Down Expand Up @@ -66,6 +67,24 @@
BIBLIOGRAPHY_NAME: str = "BIBLIOGRAPHY.bib"


@task
def literalise(ctx: Context):
"""
Write various literals in the `colour.hints` module.
Parameters
----------
ctx
Context.
"""

message_box("Literalising...")
with ctx.cd("utilities"):
ctx.run("./literalise.py")

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


@task
def clean(
ctx: Context,
Expand Down Expand Up @@ -347,7 +366,7 @@ def requirements(ctx: Context):
)


@task(clean, preflight, docs, todo, requirements)
@task(literalise, clean, preflight, docs, todo, requirements)
def build(ctx: Context):
"""
Build the project and runs dependency tasks, i.e. *docs*, *todo*, and
Expand Down
3 changes: 0 additions & 3 deletions utilities/literalise.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from textwrap import dedent

import sys
import subprocess

sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))

Expand Down Expand Up @@ -75,8 +74,6 @@ def literalise(path_module_hints: str = PATH_MODULE_HINTS):
with open(path_module_hints, "w") as file_module_hints:
file_module_hints.write(content)

subprocess.run(["black", PATH_MODULE_HINTS]) # noqa: PLW1510, S603, S607


if __name__ == "__main__":
os.chdir(os.path.dirname(__file__))
Expand Down

0 comments on commit effcdfe

Please sign in to comment.