Developing PyImageJ

This document describes how to do development-related tasks, if you want to hack on the PyImageJ code itself. If your goal is only to use PyImageJ to call ImageJ and friends from Python, you do not need to follow any of these instructions.

Testing local changes

This project is designed to work with uv for package management, which automatically manages cached virtual environments. uv is invoked as a wrapper around processes, reusing the cached libraries as needed.

If you have local pyimagej changes you wanted to test, you can simply start a python interpreter from the project root:

uv run python

All of the following make commands implicitly use uv in their tasks.

Local changes in downstream projects

If you are testing a project that uses pyimagej and need to see how changes in pyimagej impact your code, you have two options. Either way, you will need to install pyimagej in editable mode into the virtual environment of your choice:

  1. A uv-managed virual environment, e.g. uv venv

  2. A mamba-managed environment

Building the reference documentation

PyImageJ documentation is built as a Sphinx-built ReadTheDocs site.

You can either use the documentation’s own Makefile in the /docs directory:

make html

Alternatively, from the project root Makefile:

make docs

Results are generated to doc/_build/html. Production documentation is available online at https://py.imagej.net/.

Running the automated tests

make test

Formatting the code

make lint

Building distribution bundles

make dist