Any contributions are welcomed:
- Source code.
- Documentation improvements.
- Bug reports and code reviews.
- Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug.
- Fork the repository on GitHub and make your changes.
- Write some unit tests which shows that the bug was fixed or the feature works as expected.
- Send a pull request, the PR must pass code review and GitHub workflow before merging.
This step is optional.
-
Clone the forked repository and cd into it.
-
Install tox.
pip install tox
-
Start ClickHouse cluster. Docker and docker compose are required.
docker compose up -d
-
Install dependencies.
pip install -e .
This project use:
If tox is installed, code formatting can be run as:
tox -e format
code linting can be run as:
tox -e lint
As a Django derivative project, code conventions should follow Django source code whenever possible, including but not limited to:
- Code directories arrangement.
- Variable names.
- Feature implementation.
For example:
- Non-aggregation SQL functions are placed in
clickhouse_backend/models/functions
, because Django place them indjango/db/models/functions
. - Fields should be named as XXXField instead XXXType or XXXColumn.
- Index implementation should refer to Django index, not a completely new one.
Any bug fix or feature implementation must be followed by some tests. This project use Django test suite for tests.
Run tests:
python tests/runtests.py
If tox is installed, a list of default environments can be seen as follows:
tox -l
Run test for specific Python version and Django version:
tox -e py3.9-django3.2
run test for all supported Python version and Django version:
tox