From 4e4feaa4b00b627ef464c6b83f95eab414710f38 Mon Sep 17 00:00:00 2001 From: Thomas Mansencal Date: Tue, 3 May 2022 21:13:00 +1200 Subject: [PATCH 01/13] Ensure that "latest" docker tag is built. --- tasks.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tasks.py b/tasks.py index 07a28d9..f9332c7 100644 --- a/tasks.py +++ b/tasks.py @@ -168,6 +168,7 @@ def docker_build(ctx: Context): for platform in ("arm64", "amd64"): ctx.run( f"docker build --platform=linux/{platform} " + f"-t {ORG}/{CONTAINER}:latest " f"-t {ORG}/{CONTAINER}:latest-{platform} " f"-t {ORG}/{CONTAINER}:v{app.__version__}-{platform} ." ) From 5a16a9b0b85a2cf37395a68b37855a1c3fa516c5 Mon Sep 17 00:00:00 2001 From: Thomas Mansencal Date: Tue, 3 May 2022 21:25:15 +1200 Subject: [PATCH 02/13] Ensure that proper docker architecture can be run. --- tasks.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tasks.py b/tasks.py index f9332c7..1658d2f 100644 --- a/tasks.py +++ b/tasks.py @@ -3,6 +3,8 @@ ============== """ +import platform + from invoke import Context, task from invoke.exceptions import Failure @@ -165,12 +167,12 @@ def docker_build(ctx: Context): message_box('Building "docker" image...') - for platform in ("arm64", "amd64"): + for archictecture in ("arm64", "amd64"): ctx.run( - f"docker build --platform=linux/{platform} " + f"docker build --platform=linux/{archictecture} " f"-t {ORG}/{CONTAINER}:latest " - f"-t {ORG}/{CONTAINER}:latest-{platform} " - f"-t {ORG}/{CONTAINER}:v{app.__version__}-{platform} ." + f"-t {ORG}/{CONTAINER}:latest-{archictecture} " + f"-t {ORG}/{CONTAINER}:v{app.__version__}-{archictecture} ." ) @@ -220,7 +222,7 @@ def docker_run(ctx: Context): "https://www.colour-science.org/assets/js/analytics.js," "https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/3.6.1/" "iframeResizer.contentWindow.min.js " - f"-p 8010:8000 {ORG}/{CONTAINER}" + f"-p 8010:8000 {ORG}/{CONTAINER}:latest-{platform.uname()[4].lower()}" ) From 8b8795f2c033f0fa46911d25b53155c08b6b2612 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 9 May 2022 21:59:41 +0000 Subject: [PATCH 03/13] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/pyupgrade: v2.32.0 → v2.32.1](https://github.com/asottile/pyupgrade/compare/v2.32.0...v2.32.1) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 189d658..55c0a44 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/asottile/pyupgrade - rev: v2.32.0 + rev: v2.32.1 hooks: - id: pyupgrade args: [--py38-plus] From 61ec9cd82c7e50b425dc736ff2099d4ca7ee4ee3 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 6 Jun 2022 21:50:45 +0000 Subject: [PATCH 04/13] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/pyupgrade: v2.32.1 → v2.33.0](https://github.com/asottile/pyupgrade/compare/v2.32.1...v2.33.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 55c0a44..d44f059 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/asottile/pyupgrade - rev: v2.32.1 + rev: v2.33.0 hooks: - id: pyupgrade args: [--py38-plus] From 03e98b49d7fcf209e2755ab2bffebb419940dee8 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 13 Jun 2022 23:56:27 +0000 Subject: [PATCH 05/13] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/pyupgrade: v2.33.0 → v2.34.0](https://github.com/asottile/pyupgrade/compare/v2.33.0...v2.34.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d44f059..cf55165 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/asottile/pyupgrade - rev: v2.33.0 + rev: v2.34.0 hooks: - id: pyupgrade args: [--py38-plus] From 3b7560dda25cfd95f0feec869986d58d32827feb Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 5 Jul 2022 00:06:55 +0000 Subject: [PATCH 06/13] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 22.3.0 → 22.6.0](https://github.com/psf/black/compare/22.3.0...22.6.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index cf55165..1eca9aa 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,7 +9,7 @@ repos: hooks: - id: flynt - repo: https://github.com/psf/black - rev: 22.3.0 + rev: 22.6.0 hooks: - id: black language_version: python3.8 From ffb5ca4b79c4ac27c422f38083d7fe3d97da4aba Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 11 Jul 2022 23:10:25 +0000 Subject: [PATCH 07/13] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/pyupgrade: v2.34.0 → v2.37.1](https://github.com/asottile/pyupgrade/compare/v2.34.0...v2.37.1) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1eca9aa..a4a920d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/asottile/pyupgrade - rev: v2.34.0 + rev: v2.37.1 hooks: - id: pyupgrade args: [--py38-plus] From afc62592945b50f59f4e8f14b4ac9d47a446605b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 25 Jul 2022 23:34:50 +0000 Subject: [PATCH 08/13] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/pyupgrade: v2.37.1 → v2.37.2](https://github.com/asottile/pyupgrade/compare/v2.37.1...v2.37.2) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a4a920d..342b74a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/asottile/pyupgrade - rev: v2.37.1 + rev: v2.37.2 hooks: - id: pyupgrade args: [--py38-plus] From 5a9c916da5e4ff7a3056fe5e75a5dc99043bf450 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 2 Aug 2022 00:52:08 +0000 Subject: [PATCH 09/13] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/pyupgrade: v2.37.2 → v2.37.3](https://github.com/asottile/pyupgrade/compare/v2.37.2...v2.37.3) - [github.com/PyCQA/flake8: 4.0.1 → 5.0.3](https://github.com/PyCQA/flake8/compare/4.0.1...5.0.3) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 342b74a..a05d6a9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/asottile/pyupgrade - rev: v2.37.2 + rev: v2.37.3 hooks: - id: pyupgrade args: [--py38-plus] @@ -14,7 +14,7 @@ repos: - id: black language_version: python3.8 - repo: https://github.com/PyCQA/flake8 - rev: 4.0.1 + rev: 5.0.3 hooks: - id: flake8 - repo: https://github.com/pycqa/pydocstyle From 844a5c151cf8c07ca4ab4606d6cb3e0badf90acd Mon Sep 17 00:00:00 2001 From: Thomas Mansencal Date: Sat, 27 Aug 2022 12:52:08 +1200 Subject: [PATCH 10/13] Fix typo in "tasks.py" file. --- tasks.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tasks.py b/tasks.py index 1658d2f..de4e85e 100644 --- a/tasks.py +++ b/tasks.py @@ -167,12 +167,12 @@ def docker_build(ctx: Context): message_box('Building "docker" image...') - for archictecture in ("arm64", "amd64"): + for architecture in ("arm64", "amd64"): ctx.run( - f"docker build --platform=linux/{archictecture} " + f"docker build --platform=linux/{architecture} " f"-t {ORG}/{CONTAINER}:latest " - f"-t {ORG}/{CONTAINER}:latest-{archictecture} " - f"-t {ORG}/{CONTAINER}:v{app.__version__}-{archictecture} ." + f"-t {ORG}/{CONTAINER}:latest-{architecture} " + f"-t {ORG}/{CONTAINER}:v{app.__version__}-{architecture} ." ) From 8bdeef9df84ce35c378fe16bd12a89e9a9a13d62 Mon Sep 17 00:00:00 2001 From: Thomas Mansencal Date: Sun, 22 Jan 2023 10:45:39 +1300 Subject: [PATCH 11/13] Implement support for "Colour" 0.4.2. --- .pre-commit-config.yaml | 17 ++- Dockerfile | 2 +- apps/common.py | 17 +-- ...urspace_chromatically_adapted_primaries.py | 21 ++-- apps/rgb_colourspace_transformation_matrix.py | 16 +-- pyproject.toml | 33 ++++-- requirements.txt | 107 +++++++++--------- tasks.py | 62 +++------- 8 files changed, 130 insertions(+), 145 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a05d6a9..f93c2c9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,20 +1,25 @@ repos: - repo: https://github.com/asottile/pyupgrade - rev: v2.37.3 + rev: v3.2.2 hooks: - id: pyupgrade - args: [--py38-plus] + args: [--py39-plus] - repo: https://github.com/ikamensh/flynt/ - rev: '0.76' + rev: '0.77' hooks: - id: flynt - repo: https://github.com/psf/black - rev: 22.6.0 + rev: 22.10.0 hooks: - id: black - language_version: python3.8 + language_version: python3.9 +- repo: https://github.com/keewis/blackdoc + rev: v0.3.8 + hooks: + - id: blackdoc + language_version: python3.9 - repo: https://github.com/PyCQA/flake8 - rev: 5.0.3 + rev: 6.0.0 hooks: - id: flake8 - repo: https://github.com/pycqa/pydocstyle diff --git a/Dockerfile b/Dockerfile index 3912340..63dfb7d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.8 +FROM python:3.11 WORKDIR /tmp COPY ./requirements.txt /tmp diff --git a/apps/common.py b/apps/common.py index 74a052b..9ef2dfd 100644 --- a/apps/common.py +++ b/apps/common.py @@ -3,9 +3,12 @@ ====== """ -import colour +from colour.adaptation import CHROMATIC_ADAPTATION_TRANSFORMS +from colour.colorimetry import CCS_ILLUMINANTS +from colour.models import RGB_COLOURSPACES +from colour.utilities import as_float_array -from colour.hints import ArrayLike, Dict, Integer, Iterable, List +from colour.hints import ArrayLike, Dict, Iterable, List __author__ = "Colour Developers" __copyright__ = "Copyright 2018 Colour Developers" @@ -24,7 +27,7 @@ RGB_COLOURSPACE_OPTIONS: List[Dict] = [ {"label": key, "value": key} - for key in sorted(colour.RGB_COLOURSPACES.keys()) + for key in sorted(RGB_COLOURSPACES.keys()) if key not in ("aces", "adobe1998", "prophoto") ] """ @@ -33,7 +36,7 @@ CHROMATIC_ADAPTATION_TRANSFORM_OPTIONS: List[Dict] = [ {"label": key, "value": key} - for key in sorted(colour.CHROMATIC_ADAPTATION_TRANSFORMS.keys()) + for key in sorted(CHROMATIC_ADAPTATION_TRANSFORMS.keys()) ] """ *Chromatic adaptation transform* options for a :class:`Dropdown` class @@ -43,7 +46,7 @@ ILLUMINANTS_OPTIONS: List[Dict] = [ {"label": key, "value": key} for key in sorted( - colour.CCS_ILLUMINANTS["CIE 1931 2 Degree Standard Observer"].keys() + CCS_ILLUMINANTS["CIE 1931 2 Degree Standard Observer"].keys() ) ] """ @@ -69,7 +72,7 @@ """ -def nuke_format_matrix(M: ArrayLike, decimals: Integer = 10) -> str: +def nuke_format_matrix(M: ArrayLike, decimals: int = 10) -> str: """ Format given matrix for usage in *The Foundry Nuke*, i.e. *TCL* code for a *ColorMatrix* node. @@ -87,7 +90,7 @@ def nuke_format_matrix(M: ArrayLike, decimals: Integer = 10) -> str: *The Foundry Nuke* formatted matrix. """ - M = colour.utilities.as_float_array(M) + M = as_float_array(M) def pretty(x: Iterable) -> str: """Prettify given number.""" diff --git a/apps/rgb_colourspace_chromatically_adapted_primaries.py b/apps/rgb_colourspace_chromatically_adapted_primaries.py index eaa6f06..964695c 100644 --- a/apps/rgb_colourspace_chromatically_adapted_primaries.py +++ b/apps/rgb_colourspace_chromatically_adapted_primaries.py @@ -9,8 +9,9 @@ from dash.dependencies import Input, Output from dash.html import A, Code, Div, H3, H5, Li, Pre, Ul -import colour -from colour.hints import Integer +from colour.colorimetry import CCS_ILLUMINANTS +from colour.models import RGB_COLOURSPACES, chromatically_adapted_primaries +from colour.utilities import numpy_print_options from app import APP, SERVER_URL from apps.common import ( @@ -55,7 +56,7 @@ App description. """ -APP_UID: Integer = hash(APP_NAME) +APP_UID: int = hash(APP_NAME) """ App unique id. """ @@ -179,7 +180,7 @@ def set_primaries_output( illuminant: str, chromatic_adaptation_transform: str, formatter: str, - decimals: Integer, + decimals: int, ) -> str: """ Compute and write the chromatically adapted *primaries *of the given @@ -207,16 +208,14 @@ def set_primaries_output( Chromatically adapted *primaries*. """ - P = colour.chromatically_adapted_primaries( - colour.RGB_COLOURSPACES[colourspace].primaries, - colour.RGB_COLOURSPACES[colourspace].whitepoint, - colour.CCS_ILLUMINANTS["CIE 1931 2 Degree Standard Observer"][ - illuminant - ], + P = chromatically_adapted_primaries( + RGB_COLOURSPACES[colourspace].primaries, + RGB_COLOURSPACES[colourspace].whitepoint, + CCS_ILLUMINANTS["CIE 1931 2 Degree Standard Observer"][illuminant], chromatic_adaptation_transform, ) - with colour.utilities.numpy_print_options( + with numpy_print_options( formatter={"float": f"{{: 0.{decimals}f}}".format}, threshold=sys.maxsize, ): diff --git a/apps/rgb_colourspace_transformation_matrix.py b/apps/rgb_colourspace_transformation_matrix.py index 98d0505..5de2b3b 100644 --- a/apps/rgb_colourspace_transformation_matrix.py +++ b/apps/rgb_colourspace_transformation_matrix.py @@ -10,8 +10,8 @@ from dash.dependencies import Input, Output from dash.html import A, Code, Div, H3, H5, Li, Pre, Ul -import colour -from colour.hints import Integer +from colour.models import RGB_COLOURSPACES, matrix_RGB_to_RGB +from colour.utilities import numpy_print_options from app import APP, SERVER_URL from apps.common import ( @@ -57,7 +57,7 @@ App description. """ -APP_UID: Integer = hash(APP_NAME) +APP_UID: int = hash(APP_NAME) """ App unique id. """ @@ -190,7 +190,7 @@ def set_RGB_to_RGB_matrix_output( output_colourspace: str, chromatic_adaptation_transform: str, formatter: str, - decimals: Integer, + decimals: int, ) -> str: """ Compute and write the colour transformation matrix from given input *RGB* @@ -217,13 +217,13 @@ def set_RGB_to_RGB_matrix_output( Colour transformation matrix. """ - M = colour.matrix_RGB_to_RGB( - colour.RGB_COLOURSPACES[input_colourspace], - colour.RGB_COLOURSPACES[output_colourspace], + M = matrix_RGB_to_RGB( + RGB_COLOURSPACES[input_colourspace], + RGB_COLOURSPACES[output_colourspace], chromatic_adaptation_transform, ) - with colour.utilities.numpy_print_options( + with numpy_print_options( formatter={"float": f"{{: 0.{decimals}f}}".format}, threshold=sys.maxsize, ): diff --git a/pyproject.toml b/pyproject.toml index f1a4c7a..1aa438f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,46 +39,51 @@ classifiers = [ ] [tool.poetry.dependencies] -python = ">= 3.8, < 3.11" -colour-science = ">= 0.4.0" +python = ">= 3.9, < 3.12" +colour-science = ">= 0.4.2" imageio = ">= 2, < 3" -numpy = ">= 1.19, < 2" -scipy = ">= 1.5, < 2" +numpy = ">= 1.20, < 2" +scipy = ">= 1.7, < 2" dash = "*" dash-renderer = "*" gunicorn = "*" plotly = "*" black = { version = "*", optional = true } # Development dependency. +blackdoc = { version = "*", optional = true } # Development dependency. coverage = { version = "!= 6.3", optional = true } # Development dependency. coveralls = { version = "*", optional = true } # Development dependency. flake8 = { version = "*", optional = true } # Development dependency. flynt = { version = "*", optional = true } # Development dependency. invoke = { version = "*", optional = true } # Development dependency. -mypy = { version = "*", optional = true } # Development dependency. pre-commit = { version = "*", optional = true } # Development dependency. pydocstyle = { version = "*", optional = true } # Development dependency. +pyright = { version = "*", optional = true } # Development dependency. pytest = { version = "*", optional = true } # Development dependency. pytest-cov = { version = "*", optional = true } # Development dependency. +pytest-xdist = { version = "*", optional = true } # Development dependency. pyupgrade = { version = "*", optional = true } # Development dependency. [tool.poetry.dev-dependencies] black = "*" +blackdoc = "*" coverage = "*" coveralls = "*" flake8 = "*" flynt = "*" invoke = "*" -mypy = "*" pre-commit = "*" pydocstyle = "*" +pyright = "*" pytest = "*" pytest-cov = "*" +pytest-xdist = "*" pyupgrade = "*" [tool.poetry.extras] development = [ "black", + "blackdoc", "coverage", "coveralls", "flake8", @@ -87,8 +92,10 @@ development = [ "mypy", "pre-commit", "pydocstyle", + "pyright", "pytest", "pytest-cov", + "pytest-xdist", "pyupgrade", ] @@ -97,7 +104,6 @@ line-length = 79 exclude = ''' /( \.git - | \.mypy_cache | build | dist )/ @@ -106,14 +112,19 @@ exclude = ''' [tool.flynt] line_length=999 -[tool.mypy] -plugins = "numpy.typing.mypy_plugin" -ignore_missing_imports = true - [tool.pydocstyle] convention = "numpy" add-ignore = "D104,D200,D202,D205,D301,D400" +[tool.pyright] +reportMissingImports = false +reportMissingModuleSource = false +reportUnboundVariable = false +reportUnnecessaryCast = true +reportUnnecessaryTypeIgnoreComment = true +reportUnsupportedDunderAll = false +reportUnusedExpression = false + [build-system] requires = [ "poetry_core>=1.0.0" ] build-backend = "poetry.core.masonry.api" diff --git a/requirements.txt b/requirements.txt index adabf83..79c6db2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,71 +1,70 @@ astor==0.8.1 -attrs==21.4.0 -black==22.3.0 -Brotli==1.0.9 -certifi==2021.10.8 +attrs==22.2.0 +black==22.12.0 +blackdoc==0.3.8 +certifi==2022.12.7 cfgv==3.3.1 -charset-normalizer==2.0.12 +charset-normalizer==3.0.1 click==8.1.3 -colour-science==0.4.1 -coverage==6.3.2 +colour-science==0.4.2 +coverage==6.5.0 coveralls==3.3.1 -dash==2.3.1 +dash==2.7.1 dash-core-components==2.0.0 dash-html-components==2.0.0 dash-renderer==1.9.1 dash-table==5.0.0 -distlib==0.3.4 +distlib==0.3.6 docopt==0.6.2 -filelock==3.6.0 -flake8==4.0.1 -Flask==2.1.2 -Flask-Compress==1.12 -flynt==0.76 +execnet==1.9.0 +filelock==3.9.0 +flake8==6.0.0 +Flask==2.2.2 +flynt==0.77 gunicorn==20.1.0 -identify==2.5.0 -idna==3.3 -imageio==2.18.0 -importlib-metadata==4.11.3 -iniconfig==1.1.1 -invoke==1.7.0 +identify==2.5.13 +idna==3.4 +imageio==2.24.0 +iniconfig==2.0.0 +invoke==2.0.0 itsdangerous==2.1.2 Jinja2==3.1.2 -MarkupSafe==2.1.1 -mccabe==0.6.1 -mypy==0.950 +markdown-it-py==2.1.0 +MarkupSafe==2.1.2 +mccabe==0.7.0 +mdurl==0.1.2 +more-itertools==9.0.0 mypy-extensions==0.4.3 -nodeenv==1.6.0 -numpy==1.22.3 -packaging==21.3 -pathspec==0.9.0 -Pillow==9.1.0 -pip==22.0.4 -platformdirs==2.5.2 -plotly==5.7.0 +nodeenv==1.7.0 +numpy==1.24.1 +packaging==23.0 +pathspec==0.10.3 +Pillow==9.4.0 +pip==22.3.1 +platformdirs==2.6.2 +plotly==5.12.0 pluggy==1.0.0 -pre-commit==2.18.1 -py==1.11.0 -pycodestyle==2.8.0 -pydocstyle==6.1.1 -pyflakes==2.4.0 -pyparsing==3.0.8 -pytest==7.1.2 -pytest-cov==3.0.0 -pyupgrade==2.32.0 +pre-commit==2.21.0 +pycodestyle==2.10.0 +pydocstyle==6.3.0 +pyflakes==3.0.1 +Pygments==2.14.0 +pyright==1.1.290 +pytest==7.2.1 +pytest-cov==4.0.0 +pytest-xdist==3.1.0 +pyupgrade==3.3.1 PyYAML==6.0 -requests==2.27.1 -scipy==1.8.0 -setuptools==61.3.1 -six==1.16.0 +requests==2.28.2 +rich==13.2.0 +scipy==1.10.0 +setuptools==66.1.1 snowballstemmer==2.2.0 -tenacity==8.0.1 -tokenize-rt==4.2.1 -toml==0.10.2 +tenacity==8.1.0 +tokenize-rt==5.0.0 tomli==2.0.1 -types-setuptools==57.4.14 -typing_extensions==4.2.0 -urllib3==1.26.9 -virtualenv==20.14.1 -Werkzeug==2.1.2 -wheel==0.37.1 -zipp==3.8.0 +typing_extensions==4.4.0 +urllib3==1.26.14 +virtualenv==20.17.1 +Werkzeug==2.2.2 +wheel==0.38.4 diff --git a/tasks.py b/tasks.py index de4e85e..1fe432a 100644 --- a/tasks.py +++ b/tasks.py @@ -4,16 +4,19 @@ """ import platform - -from invoke import Context, task from invoke.exceptions import Failure -from colour.hints import Boolean - from colour.utilities import message_box import app +import inspect + +if not hasattr(inspect, "getargspec"): + inspect.getargspec = inspect.getfullargspec # pyright: ignore + +from invoke import Context, task + __author__ = "Colour Developers" __copyright__ = "Copyright 2018 Colour Developers" __license__ = "New BSD License - https://opensource.org/licenses/BSD-3-Clause" @@ -41,33 +44,8 @@ CONTAINER: str = APPLICATION_NAME.replace(" ", "").lower() -def _patch_invoke_annotations_support(): - """See https://github.com/pyinvoke/invoke/issues/357.""" - - import invoke - from unittest.mock import patch - from inspect import getfullargspec, ArgSpec - - def patched_inspect_getargspec(function): - spec = getfullargspec(function) - return ArgSpec(*spec[0:4]) - - org_task_argspec = invoke.tasks.Task.argspec - - def patched_task_argspec(*args, **kwargs): - with patch( - target="inspect.getargspec", new=patched_inspect_getargspec - ): - return org_task_argspec(*args, **kwargs) - - invoke.tasks.Task.argspec = patched_task_argspec - - -_patch_invoke_annotations_support() - - @task -def clean(ctx, bytecode=False): +def clean(ctx: Context, bytecode: bool = False): """ Clean the project. @@ -92,32 +70,22 @@ def clean(ctx, bytecode=False): @task def quality( ctx: Context, - mypy: Boolean = True, + pyright: bool = True, ): """ - Check the codebase with *Mypy* and lints various *restructuredText* files - with *rst-lint*. + Check the codebase with *Pyright*. Parameters ---------- ctx Context. - mypy - Whether to check the codebase with *Mypy*. + pyright + Whether to check the codebase with *Pyright*. """ - if mypy: - message_box('Checking codebase with "Mypy"...') - ctx.run( - "mypy " - "--install-types " - "--non-interactive " - "--show-error-codes " - "--warn-unused-ignores " - "--warn-redundant-casts " - "app.py index.py apps" - "|| true" - ) + if pyright: + message_box('Checking codebase with "Pyright"...') + ctx.run("pyright --skipunannotated") @task From e9b2bba754c351677849744d373886488d217e14 Mon Sep 17 00:00:00 2001 From: Thomas Mansencal Date: Sun, 22 Jan 2023 10:47:06 +1300 Subject: [PATCH 12/13] Update "CONTRIBUTORS.rst" file. --- CONTRIBUTORS.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 32b59d8..28f5827 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -4,7 +4,7 @@ Contributors Colour - Dash ------------- -- **Thomas Mansencal**, *Lead Pipeline Developer @ WetaFX* +- **Thomas Mansencal**, *Technology Supervisor @ Wētā FX* Project coordination, writing. From a7692adc62035c6f9e5802de8262cad11033d89a Mon Sep 17 00:00:00 2001 From: Thomas Mansencal Date: Sun, 22 Jan 2023 10:48:34 +1300 Subject: [PATCH 13/13] Raise app version to 0.1.15. --- app.py | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index 47c20aa..e122e76 100644 --- a/app.py +++ b/app.py @@ -20,7 +20,7 @@ __major_version__ = "0" __minor_version__ = "1" -__change_version__ = "14" +__change_version__ = "15" __version__ = ".".join( (__major_version__, __minor_version__, __change_version__) ) diff --git a/pyproject.toml b/pyproject.toml index 1aa438f..e6b91e1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "colour-dash" -version = "0.1.14" +version = "0.1.15" description = "Various colour science Dash apps built on top of Colour" license = "BSD-3-Clause" authors = [ "Colour Developers " ]