Skip to content

Contributing

Contributions to the project are welcome. If you are not a collaborator on the GitHub repository then you should fork the repository, make your changes on the fork and then create a Pull Request. Collaborators can clone and make contributions directly, although the main branch is protected so all changes should be made on dedicated branches and a Pull Request used to merge the changes to the main branch.

Style

We employ pre-commit hooks to apply a number of linting, type-hints and style rules using the following tools.

If you follow the development installation instructions you should have all necessary tools installed and find that your IDE recognises and uses some of these automatically.

Virtual Environments

It is recommended that you use Virtual Environments to install the LayOpt package and its dependencies. We use uv and recommend it. After installing uv you will need to create a virtual environment, synchronise and install the package.

# Change directory to where LayOpt is cloned
cd ~/path/to/LayOpt
# Create a virtual environment with uv
uv env
# Synchronise and install the package and its dependencies
uv sync
# Install the development packages
uv pip install --group dev

Pre-commit

The pre-commit hooks need installing after you have installed the development packages

pre-commit install

You should now find that the pre-commit hooks run before each commit is made. If the hooks do not pass then the commit will fail (although this can be over-ridden at the command line using the -n flag).