Setting Up the Development Environment on macOS
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.
Additionally, the installation of complex dependencies such as OpenImageIO and PyGraphviz is described.
It was contributed by @tjdcs and last updated on the 2024-10-10.
Homebrew
Install Homebrew:
Install the required Python versions:
uv
(Re)Install uv:
graphviz and OpenImageIO
Using Homebrew:
Then append the following exports to your shell dotfile, e.g., ~/.zshrc
:
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
Create the virtual 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:
CTL (Optional)
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:
See Also
Please refer to the contributing guide for more information about the contributing process.