1.9 KiB
Development Guide
Docker local development setup
You should have docker installed in your system, if not click here.
-
Go to diagrams root directory.
-
Build the docker image.
docker build --tag diagrams:1.0 -f ./docker/dev/Dockerfile .
-
Create the container, run in background and mount the project source code.
docker run -d \ -it \ --name diagrams \ --mount type=bind,source="$(pwd)",target=/usr/src/diagrams \ diagrams:1.0
-
Run unit tests in the host using the container to confirm that it's working.
docker exec diagrams python -m unittest tests/*.py -v
-
Run the bash script
autogen.sh
to test.docker exec diagrams ./autogen.sh
-
If the unit tests and the bash script
autogen.sh
is working correctly, then your system is now ready for development.
Mac local development setup
To be able to develop and run diagrams locally on you Mac device, you should have Python, Go, and brew installed on your system.
-
Go to diagrams root directory.
-
Install poetry, the Python project management package used by diagrams.
pip install poetry
-
Install the project's Python dependencies.
poetry install
-
Install diagrams binary dependencies.
brew install imagemagick inkscape black go get github.com/mingrammer/round
-
Run unit tests to confirm that it's working.
python -m unittest tests/*.py -v
-
Run the bash script
autogen.sh
to test../autogen.sh
-
If the unit tests and the bash script
autogen.sh
is working correctly, then your system is now ready for development.