Skip to content

Commit 9a1ddea

Browse files
authored
PR: Fix Inactive Colorspaces Definitions (#94)
* Implement initial support for Python 3.11. Signed-off-by: Thomas Mansencal <[email protected]> * Fix incorrect inactive colorspaces definitions. Signed-off-by: Thomas Mansencal <[email protected]> --------- Signed-off-by: Thomas Mansencal <[email protected]>
1 parent 664c01d commit 9a1ddea

File tree

8 files changed

+89
-90
lines changed

8 files changed

+89
-90
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ jobs:
2222
echo "CI_SHA=${{ github.sha }}" >> $GITHUB_ENV
2323
echo "COVERALLS_REPO_TOKEN=${{ secrets.COVERALLS_REPO_TOKEN }}" >> $GITHUB_ENV
2424
shell: bash
25+
- name: Set up Python 3.9 for Pre-Commit
26+
uses: actions/setup-python@v1
27+
with:
28+
python-version: 3.9
2529
- name: Set up Python ${{ matrix.python-version }}
2630
uses: actions/setup-python@v1
2731
with:

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ repos:
33
rev: v2.31.0
44
hooks:
55
- id: pyupgrade
6-
args: [--py38-plus]
6+
args: [--py39-plus]
77
- repo: https://github.com/ikamensh/flynt/
88
rev: '0.76'
99
hooks:
@@ -12,7 +12,7 @@ repos:
1212
rev: 22.3.0
1313
hooks:
1414
- id: black
15-
language_version: python3.8
15+
language_version: python3.9
1616
- repo: https://github.com/PyCQA/flake8
1717
rev: 4.0.1
1818
hooks:

opencolorio_config_aces/config/cg/generate/config.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,6 +1116,18 @@ def view_filterer(transform):
11161116
if a["name"] == "Raw"
11171117
)
11181118

1119+
# Inactive Colorspaces Filtering
1120+
colorspace_named_transform_names = [a["name"] for a in data.colorspaces]
1121+
inactive_colorspaces = []
1122+
for colorspace in data.inactive_colorspaces:
1123+
if colorspace not in colorspace_named_transform_names:
1124+
logger.info(f'Removing "{colorspace}" inactive colorspace.')
1125+
continue
1126+
1127+
inactive_colorspaces.append(colorspace)
1128+
1129+
data.inactive_colorspaces = inactive_colorspaces
1130+
11191131
# Roles Filtering & Update
11201132
for role in (
11211133
# A config contains multiple possible "Rendering" color spaces.

opencolorio_config_aces/config/generation/common.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,12 @@ class ConfigData:
124124
default_view_transform
125125
"""
126126

127-
schema_version: ProfileVersion = ProfileVersion(1, 0)
128-
profile_version: ProfileVersion = PROFILE_VERSION_DEFAULT
127+
schema_version: ProfileVersion = field(
128+
default_factory=lambda: ProfileVersion(1, 0)
129+
)
130+
profile_version: ProfileVersion = field(
131+
default_factory=lambda: PROFILE_VERSION_DEFAULT
132+
)
129133
name: str = field(default_factory=str)
130134
description: str = (
131135
'An "OpenColorIO" config generated by "OpenColorIO-Config-ACES".'

opencolorio_config_aces/config/reference/generate/config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1207,7 +1207,8 @@ def generate_config_aces(
12071207
)
12081208
display["transforms_data"] = [transform_data]
12091209
display_name = display["name"]
1210-
inactive_colorspaces.append(display["name"])
1210+
if display_name not in inactive_colorspaces:
1211+
inactive_colorspaces.append(display_name)
12111212

12121213
if display_name not in display_names:
12131214
displays.append(display)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ keywords = [
1818
]
1919

2020
[tool.poetry.dependencies]
21-
python = ">= 3.9, < 3.11"
21+
python = ">= 3.9, < 3.12"
2222
# numpy = ">= 1.19, < 2"
2323
opencolorio = ">= 2, < 3"
2424
requests = ">= 2, < 3"

requirements.txt

Lines changed: 55 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,87 @@
1-
alabaster==0.7.12
1+
alabaster==0.7.13
22
astor==0.8.1
3-
attrs==22.1.0
4-
Babel==2.10.3
5-
beautifulsoup4==4.11.1
6-
black==22.10.0
7-
bleach==5.0.1
8-
certifi==2022.9.24
3+
attrs==22.2.0
4+
Babel==2.11.0
5+
beautifulsoup4==4.11.2
6+
black==23.1.0
7+
bleach==6.0.0
8+
certifi==2022.12.7
99
cfgv==3.3.1
10-
charset-normalizer==2.1.1
10+
charset-normalizer==3.0.1
1111
click==8.1.3
12-
colour-science==0.4.1
13-
commonmark==0.9.1
12+
colour-science==0.4.2
1413
coverage==6.5.0
1514
coveralls==3.3.1
1615
distlib==0.3.6
1716
docopt==0.6.2
1817
docutils==0.17.1
19-
filelock==3.8.0
20-
flake8==5.0.4
21-
flynt==0.76
22-
identify==2.5.6
18+
filelock==3.9.0
19+
flake8==6.0.0
20+
flynt==0.77
21+
identify==2.5.18
2322
idna==3.4
24-
imageio==2.22.1
23+
imageio==2.25.1
2524
imagesize==1.4.1
26-
importlib-metadata==5.0.0
27-
iniconfig==1.1.1
28-
invoke==1.7.3
25+
importlib-metadata==6.0.0
26+
iniconfig==2.0.0
27+
invoke==2.0.0
2928
jaraco.classes==3.2.3
3029
Jinja2==3.1.2
3130
jsonpickle==2.2.0
32-
keyring==23.9.3
33-
MarkupSafe==2.1.1
31+
keyring==23.13.1
32+
markdown-it-py==2.1.0
33+
MarkupSafe==2.1.2
3434
mccabe==0.7.0
35-
more-itertools==8.14.0
36-
mypy==0.982
37-
mypy-extensions==0.4.3
38-
networkx==2.8.7
35+
mdurl==0.1.2
36+
more-itertools==9.0.0
37+
mypy==1.0.0
38+
mypy-extensions==1.0.0
39+
networkx==3.0
3940
nodeenv==1.7.0
40-
numpy==1.23.3
41-
opencolorio==2.1.2
42-
packaging==21.3
43-
pathspec==0.10.1
44-
Pillow==9.2.0
45-
pip==22.2.2
46-
pkginfo==1.8.3
47-
platformdirs==2.5.2
41+
numpy==1.24.2
42+
opencolorio==2.2.1
43+
packaging==23.0
44+
pathspec==0.11.0
45+
Pillow==9.4.0
46+
pip==22.3.1
47+
pkginfo==1.9.6
48+
platformdirs==3.0.0
4849
pluggy==1.0.0
49-
pre-commit==2.20.0
50-
py==1.11.0
51-
pycodestyle==2.9.1
52-
pydata-sphinx-theme==0.11.0
53-
pydocstyle==6.1.1
54-
pyflakes==2.5.0
55-
Pygments==2.13.0
56-
pygraphviz==1.10
57-
pyparsing==3.0.9
58-
pytest==7.1.3
50+
pre-commit==3.0.4
51+
pycodestyle==2.10.0
52+
pydata-sphinx-theme==0.12.0
53+
pydocstyle==6.3.0
54+
pyflakes==3.0.1
55+
Pygments==2.14.0
56+
pytest==7.2.1
5957
pytest-cov==4.0.0
60-
pytz==2022.4
61-
pyupgrade==3.0.0
58+
pytz==2022.7.1
59+
pyupgrade==3.3.1
6260
PyYAML==6.0
63-
readme-renderer==37.2
64-
requests==2.28.1
65-
requests-toolbelt==0.10.0
61+
readme-renderer==37.3
62+
requests==2.28.2
63+
requests-toolbelt==0.10.1
6664
restructuredtext-lint==1.4.0
6765
rfc3986==2.0.0
68-
rich==12.6.0
69-
scipy==1.9.1
70-
setuptools==65.3.0
66+
rich==13.3.1
67+
scipy==1.10.0
68+
setuptools==67.2.0
7169
six==1.16.0
7270
snowballstemmer==2.2.0
7371
soupsieve==2.3.2.post1
7472
Sphinx==4.5.0
75-
sphinxcontrib-applehelp==1.0.2
73+
sphinxcontrib-applehelp==1.0.4
7674
sphinxcontrib-devhelp==1.0.2
77-
sphinxcontrib-htmlhelp==2.0.0
75+
sphinxcontrib-htmlhelp==2.0.1
7876
sphinxcontrib-jsmath==1.0.1
7977
sphinxcontrib-qthelp==1.0.3
8078
sphinxcontrib-serializinghtml==1.1.5
8179
tokenize-rt==5.0.0
82-
toml==0.10.2
8380
tomli==2.0.1
84-
twine==4.0.1
81+
twine==4.0.2
8582
typing_extensions==4.4.0
86-
urllib3==1.26.12
87-
virtualenv==20.16.5
83+
urllib3==1.26.14
84+
virtualenv==20.19.0
8885
webencodings==0.5.1
89-
wheel==0.37.1
90-
zipp==3.8.1
86+
wheel==0.38.4
87+
zipp==3.13.0

tasks.py

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import os
1111

1212
import requests
13-
from invoke import Context, task
1413
from invoke.exceptions import Failure
1514
from pathlib import Path
1615
import opencolorio_config_aces
@@ -25,6 +24,13 @@
2524
)
2625
from opencolorio_config_aces.utilities import google_sheet_title, message_box
2726

27+
import inspect
28+
29+
if not hasattr(inspect, "getargspec"):
30+
inspect.getargspec = inspect.getfullargspec
31+
32+
from invoke import Context, task
33+
2834
__author__ = "OpenColorIO Contributors"
2935
__copyright__ = "Copyright Contributors to the OpenColorIO Project."
3036
__license__ = "New BSD License - https://opensource.org/licenses/BSD-3-Clause"
@@ -86,31 +92,6 @@
8692
CONTAINER = PYPI_PACKAGE_NAME
8793

8894

89-
def _patch_invoke_annotations_support():
90-
"""See https://github.com/pyinvoke/invoke/issues/357."""
91-
92-
import invoke
93-
from unittest.mock import patch
94-
from inspect import getfullargspec, ArgSpec
95-
96-
def patched_inspect_getargspec(function):
97-
spec = getfullargspec(function)
98-
return ArgSpec(*spec[0:4])
99-
100-
org_task_argspec = invoke.tasks.Task.argspec
101-
102-
def patched_task_argspec(*args, **kwargs):
103-
with patch(
104-
target="inspect.getargspec", new=patched_inspect_getargspec
105-
):
106-
return org_task_argspec(*args, **kwargs)
107-
108-
invoke.tasks.Task.argspec = patched_task_argspec
109-
110-
111-
_patch_invoke_annotations_support()
112-
113-
11495
@task
11596
def clean(
11697
ctx: Context,

0 commit comments

Comments
 (0)