Contributing¶
How to contribute¶
Dependencies¶
We use poetry to manage the dependencies.
To install them you would need to run install command:
poetry install --all-extras --all-groups
To activate your virtualenv
run eval "$(poetry env activate)"
or source .venv/bin/activate.
One magic command¶
Run make test to run everything we have!
Tests¶
To run tests:
make unit
To run linting:
make lint
These steps are mandatory during the CI.
Documentation¶
To build docs locally:
poetry run make -C docs clean html
If docs build fails on macOS with multiprocessing-related errors while running examples, force the start method explicitly:
DMR_SPAWN_METHOD=spawn poetry run make -C docs clean html
Submitting your code¶
We use trunk based
development (we also sometimes call it wemake-git-flow).
What the point of this method?
We use protected
masterbranch, so the only way to push your code is via pull requestWe use issue branches: to implement a new feature or to fix a bug create a new branch named
issue-$TASKNUMBERThen create a pull request to
masterbranchWe use
git tags to make releases, so we can track what has changed since the latest release
So, this way we achieve an easy and scalable development process which frees us from merging hell and long-living branches.
In this method, the latest version of the app is always in the master branch.
Before submitting¶
Before submitting your code please do the following steps:
Run
make testto make sure everything was working beforeAdd any changes you want
Add tests for the new changes
Edit documentation if you have changed something significant
Update
CHANGELOG.mdwith a quick summary of your changesRun
make testagain to make sure it is still working
Translations¶
We use Django’s built-in i18n system. Translation files live in dmr/locale/.
Contributing a new language¶
Generate a
.pofile for your locale:poetry run django-admin makemessages --locale <lang>Fill in the
msgstrvalues indmr/locale/<lang>/LC_MESSAGES/django.poCompile and validate all translations:
make translationsCommit both
django.poanddjango.mofiles
Improving an existing translation¶
Edit
dmr/locale/<lang>/LC_MESSAGES/django.poCompile and validate:
make translationsCommit both
django.poanddjango.mofiles
Other help¶
You can contribute by spreading a word about this library. It would also be a huge contribution to write a short article on how you are using this project. You can also share your best practices with us.