Contribution and development hints

The dasf-broker-django project is developed by the Helmholtz-Zentrum Hereon. It is open-source as we believe that this package can be helpful for multiple other django applications, and we are looking forward for your feedback, questions and especially for your contributions.

Contributing in the development

Thanks for your wish to contribute to this app!! The source code of the dasf-broker-django package is hosted at https://gitlab.hzdr.de/hcdc/django/dasf-broker-django. It’s an open gitlab where you can register via GitHub, or via the Helmholtz AAI. Once you created an account, you can fork this repository to your own user account and implement the changes. Afterwards, please make a merge request into the main repository. If you have any questions, please do not hesitate to create an issue on gitlab and contact the developers.

Warning

For local development, you need a redis server available. They can be configured via environment variables (REDIS_HOST, see the settings.py file in the testproject).

Once you created you fork, you can clone it via

git clone https://gitlab.hzdr.de/<your-user>/dasf-broker-django.git

and install it in development mode with the [dev] option via:

pip install -e ./dasf-broker-django/[dev]

Once you installed the package, run the migrations:

cd dasf-broker-django/
python manage.py migrate

which will setup the database for you.

Fixing the docs

The documentation for this package is written in restructured Text and built with sphinx and deployed on readthedocs.

If you found something in the docs that you want to fix, head over to the docs folder and build the docs with make html (or make.bat on windows). The docs are then available in docs/_build/html/index.html that you can open with your local browser.

Implement your fixes in the corresponding .rst-file and push them to your fork on gitlab.

Contributing to the code

We use automated formatters (see their config in pyproject.toml and setup.cfg), namely

  • Black for standardized code formatting

  • blackdoc for standardized code formatting in documentation

  • Flake8 for general code quality

  • isort for standardized order in imports.

  • mypy for static type checking on type hints

We highly recommend that you setup pre-commit hooks to automatically run all the above tools every time you make a git commit. This can be done by running:

pre-commit install

from the root of the repository. You can skip the pre-commit checks with git commit --no-verify but note that the CI will fail if it encounters any formatting errors.

You can also run the pre-commit step manually by invoking:

pre-commit run --all-files