This guide describes the process to setup a development environment for contributing to colour-science projects on macOS. It is by no means prescriptive, and not every step is required. The guide assumes Homebrew as the package manager and Visual Studio Code as the IDE / text editor.
It was contributed by @tjdcs and last updated on the 2024-01-28.
Install the required Python versions:
Poetry used to introduce breaking changes to the installer between minor versions, it is thus recommended to reinstall it.
graphviz and OpenImageIO
Then append the following exports to your shell dotfile, e.g.
Cloning colour's Repository
First, fork the colour repository, making sure to set or replace the environment variables in these commands.
Working with Visual Studio Code from the Terminal
The following step is optional, but helpful to store Poetry's virtual environment into colour's directory.
Install the poetry environment
Opening Visual Studio Code
In colour's directory, issue the following command to launch Visual Studio Code:
Cmd + Shift + P
to bring up the Command Palette, then type
Shell Command: Install 'code' command in PATH and press enter.
Running the Unit Tests / Preflight
colour uses the invoke framework to expose several useful preflight commands:
or if you just want to run the tests, including the doctests:
colour provides a wrapper to the AMPAS Color Transformation Language (CTL) If you want to be able to fully build and contribute to this part of the codebase, it needs to be installed. Unfortunately, the version currently provided by Homebrew does not appear to work on the latest macOS and the relevant environments, thus, it must be installed from source at the moment:
Please refer to the contributing guide for more information about the contributing process.