Contributing

Requirements

Install Poetry. Poetry is used to manage dependencies and so called Poetry shells, which are essentially virtual environments.

Make sure you have git and make.

Debian and Ubuntu (and derivatives)
sudo apt install git make

Getting the source code

Generate an SSH key pair following the instructions from https://docs.gitlab.com/ee/ssh/#rsa-ssh-keys.

Clone the repository into your favourite directory using:

git clone git@gitlab.discretization.de:pyddg/pyddg.git

This will create a directory pyddg.

To push local changes on git don’t forget to tell git who you are by running

git config --global user.email "you@example.com"
git config --global user.name "Your Name"

Installing the library and Blender

Warning

Don’t install Blender using other methods unless you know what you are doing. The setup_blender script ensures that Blender can use virtual environments. For more details, consult the Blender documentation and the setup_blender source code.

Install Blender

# Install Blender 3.3.0 to ~/blender
scripts/setup_blender ~/blender 3 3 0

Warning

Blender is expected to crash if you attempt to run it now. Blender won’t work until you enter the Poetry shell or virtual environment and set certain environment variables as described below.

Then run

cd pyddg    # the project directory
poetry env use ~/blender/blender-3.3.0/3.3/_python/bin/python3.10
poetry install --with dev --with docs --with tests --with coverage

Enter the virtual environment with

# poetry
export PATH="$HOME/blender/blender-3.3.0:$PATH"
export PYTHONPATH="$(poetry env info -p)/lib/python3.10/site-packages/"
poetry shell

Run tests with

python3 test.py

You can run tests selectively. For all options, consult

python3 test.py --help

Build documentation with

Linux and macOS
make -C docs/ docs
Windows
docs\make.bat docs

and open docs/build/index.html in your favorite browser.

Clean the build artifacts with

Linux and macOS
make -C docs/ clean
Windows
docs\make.bat clean

Exit the Poetry shell with

exit