Skip to content

Commit 42b66e6

Browse files
committed
Updates
1 parent c056050 commit 42b66e6

File tree

4 files changed

+14
-11
lines changed

4 files changed

+14
-11
lines changed

docs/quick_start/installation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ The workflow looks like this:
549549

550550
- Install `uv <https://docs.astral.sh/uv/getting-started/installation/>`_ and
551551
``docker``
552-
- Create the temp build directory, cd into it, and run `cmake /path/to/source`
552+
- Create the temp build directory, cd into it, and run ``cmake /path/to/source``
553553
- Run ``cmake --build . --target pystubs`` to generate updated stubs in
554554
``src/bindings/python/stubs/__init__.pyi``
555555
- Commit the new stubs and push to Github

src/bindings/python/stubs/PyOpenColorIO/__init__.pyi

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -844,6 +844,10 @@ class Config:
844844
def IdentifyBuiltinColorSpace(srcConfig: Config, builtinConfig: Config, builtinColorSpaceName: str) -> str: ...
845845
@staticmethod
846846
def IdentifyInterchangeSpace(srcConfig: Config, srcColorSpaceName: str, builtinConfig: Config, builtinColorSpaceName: str) -> tuple[str, str]: ...
847+
@staticmethod
848+
def ViewsAreEqual(first: Config, second: Config, dispName: str, viewName: str) -> bool: ...
849+
@staticmethod
850+
def VirtualViewsAreEqual(first: Config, second: Config, viewName: str) -> bool: ...
847851
def addColorSpace(self, colorSpace: ColorSpace) -> None: ...
848852
def addDisplaySharedView(self, display: str, view: str) -> None: ...
849853
@overload
@@ -866,8 +870,10 @@ class Config:
866870
def clearNamedTransforms(self) -> None: ...
867871
def clearProcessorCache(self) -> None: ...
868872
def clearSearchPaths(self) -> None: ...
873+
def clearSharedViews(self) -> None: ...
869874
def clearViewTransforms(self) -> None: ...
870875
def clearVirtualDisplay(self) -> None: ...
876+
def displayHasView(self, display: str, view: str) -> bool: ...
871877
def filepathOnlyMatchesDefaultRule(self, filePath: str) -> bool: ...
872878
def getActiveDisplays(self) -> str: ...
873879
def getActiveViews(self) -> str: ...
@@ -977,6 +983,7 @@ class Config:
977983
def getVirtualDisplayViews(self, display: ViewType) -> Config.VirtualViewIterator: ...
978984
def getWorkingDir(self) -> str: ...
979985
def hasRole(self, role: str) -> bool: ...
986+
def hasVirtualView(self, view: str) -> bool: ...
980987
def instantiateDisplayFromICCProfile(self, ICCProfileFilepath: str) -> int: ...
981988
def instantiateDisplayFromMonitorName(self, monitorName: str) -> int: ...
982989
def isArchivable(self) -> bool: ...
@@ -1017,6 +1024,8 @@ class Config:
10171024
def setWorkingDir(self, dirName: str) -> None: ...
10181025
def upgradeToLatestVersion(self) -> None: ...
10191026
def validate(self) -> None: ...
1027+
def viewIsShared(self, display: str, view: str) -> bool: ...
1028+
def virtualViewIsShared(self, view: str) -> bool: ...
10201029
def __deepcopy__(self, memo: dict) -> Config: ...
10211030

10221031
class Context:

src/bindings/python/stubs/generate_stubs.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ class OCIOSignatureGenerator(AdvancedSignatureGenerator):
3636
"*.__eq__": "(self, other: object) -> bool",
3737
},
3838
# Override argument types
39+
# dict of (name_pattern, arg, type) to arg_type
40+
# type can be str | re.Pattern
3941
arg_type_overrides={
40-
# (name_pattern, arg, type): arg_type
41-
# type can be str | re.Pattern
4242
("*", "*", re.compile(r"list\[(.*)]")): r"Iterable[\1]",
4343
},
4444
# Override result types
@@ -77,13 +77,6 @@ def set_defined_names(self, defined_names: set[str]) -> None:
7777
for typ in ["Buffer"]:
7878
self.add_name(f"typing_extensions.{typ}", require=False)
7979

80-
def get_members(self, obj: object) -> list[tuple[str, Any]]:
81-
return [
82-
(name, obj)
83-
for name, obj in super().get_members(obj)
84-
if not (name == "__hash__" and obj is None)
85-
]
86-
8780
def get_base_types(self, obj: type) -> list[str]:
8881
bases = super().get_base_types(obj)
8982
if obj.__name__ == "Exception":

src/bindings/python/stubs/generate_stubs_local.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ def main():
2121

2222
version_major, version_minor = args.python_version.split(".")
2323

24-
# detect the platform so that we can avoid running docker under emulation.
24+
# detect the platform so that we can avoid running docker under emulation, which
25+
# can result in the build process hanging.
2526
if platform.system() == "Darwin":
2627
# On Mac, `uname -m`, $CMAKE_HOST_SYSTEM_PROCESSOR, and platform.machine() returns
2728
# x86_64 even on arm64 processors (i.e. Apple Silicon) if cmake or python is running under

0 commit comments

Comments
 (0)