Example of a script to patch wheels run during the cibuildwheel repair-wheel step
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
class NumericLookup(dict): | |
""" | |
Extends *dict* type to provide a lookup by value(s), including numpy arrays. | |
Methods | |
------- | |
keys_from_value | |
first_key_from_value |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name = "python" | |
version = "3.10.14" | |
authors = ["Guido van Rossum"] | |
description = "The Python programming language" | |
@early() | |
def variants(): | |
import rez.package_py_utils as rezutils, platform | |
p = 'platform-%s' % {'darwin':'osx','windows':'windows','linux':'linux'}[platform.system().lower()] | |
return [rezutils.expand_requires(p, "arch-**")] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name = 'rust' | |
version = '1.78.0' | |
description = 'Rust is an interpreted, interactive, object-oriented programming language' | |
help = "https://www.rust-lang.org" | |
@early() | |
def uuid(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import binascii | |
import os | |
import re | |
from logging import getLogger | |
logger = getLogger(__name__) | |
def patch_avif_header_cicp(input_file, P=9, T=16, M=9, output_file=None, preset=None, dryrun=False): | |
"""Patch nclx data into AVIF file header for specified Primaries / TRC / YUV Matrix Coeff enums.""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name = 'boost' | |
version = "1.85.0" | |
authors = ['boost.org'] | |
hased_variants= True | |
description = \ | |
''' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ocio_profile_version: 2.2 | |
name: example-egamut2-config_v1.0 | |
description: | | |
Demonstrates the use of EGamut2 D65 as the scene reference space and the rest of the display color space / view transform architecture | |
search_path: | |
- ./luts |
Example of using custom CIBW repair-wheel-command
to invoke "stub_generation.py" (not included, assumed to be in the same directory as the "oiio_wheels_repair.py" file
Here's what happens:
- Just before the build initializes,
uv
is installed to the local CIBW instance. - The wheel is built as normal...
- We use
uv run --no-config
to run our custom script: A. The cross-platformrepairwheel
utility produces a "repaired" wheel consistent with what CIBW normally does if you don't specify a custom repair-wheel-command B. (Optionally, we strip out stuff we know we don't want -- this isn't doing much now, but if/when we start bundling dynamic (e.g. LGPL) libraries with the distribution, we'll want to strip out redundant "namelink copies" of shared libs to reduce wheel file size) C. Invoke the stub_generator.py script withuv run --with --no-config stub_generator.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from functools import lru_cache | |
from typing import Sequence, Callable, Tuple | |
from fastprogress import progress_bar | |
import numpy as np | |
import OpenImageIO as oiio | |
@lru_cache | |
def compute_maxcll_maxfall( | |
image_sequence: Sequence[Union[str, Path, oiio.ImageBuf]], | |
convert_to_pq: Callable[[oiio.ImageBuf], oiio.ImageBuf] | None = None, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name = "python" | |
version = "3.13.1" | |
authors = ["Guido van Rossum"] | |
description = "The Python programming language" | |
private_build_requires = ['uv-0.7.13+<1'] |
OlderNewer