Skip to content

Contributing

Sharing feedback

This project is still quite new and therefore having your feedback will really help to prioritize relevant feature developments 🚀.

The easiest way to share feedback and discuss about the project is to join the Gitter chatroom.

If you want to contribute (thanks a lot ! 😃), you can open an issue on Github.

Before creating a non obvious (typo, documentation fix) Pull Request, please make sure to open an issue.

Developing locally

With the VSCode's devcontainer feature

This feature will make the tools/environment installation very simple as you will develop in a container that has already been configured to run this project.

Here are the steps:

  1. Clone the repository and open it with Visual Studio Code.
  2. Make sure that the Remote - Containers (ms-vscode-remote.remote-containers) extension is installed.
  3. Run the Remote-Container: Reopen in Container command (press Ctrl+Shift+P and then type the command).
  4. After the setup script completes, the environment is ready. You can start the local development 🔥.

You can go to the development tasks section to see the available task commands.

MongoDB container

In this containerized development environment, a MongoDB instance should already be running as a part of the development docker-compose.yml file internally used by VSCode.

Regular environment setup

Installing the tools

  • Git LFS: used to store documentation assets in the repository
  • Docker: used to run a local MongoDB instance
  • Docker Compose (Optional): used to run a local MongoDB cluster (replica set or shards)
  • Task: task manager

Installing python based development tools

In order to install the devtools written in python, it's recommended to use pipx.

python3 -m pip install --user pipx
python3 -m pipx ensurepath
  • flit: packaging system and dependency manager

    pipx install flit
    

  • tox: multi-environment test runner

    pipx install tox
    

  • pre-commit: pre commit hook manager

    pipx install pre-commit
    

Python versions

If you want to test the project with multiple python versions, you'll need to install them manually.

You can use pyenv to install them easily.

# Install the versions
pyenv install "3.7.9"
pyenv install "3.8.9"
pyenv install "3.9.0"
# Make the versions available locally in the project
pyenv local 3.8.6 3.7.9 3.9.0

Configuring the local environment

task setup

Running development tasks

The following tasks are available for the project:

  • task setup: Configure the development environment.

  • task lint: Run the linting checks.

  • task format: Format the code (and imports).

  • mongodb:standalone-docker: Start a standalone MongoDB instance using a docker container

  • mongodb:standalone-docker:down: Stop the standalone instance

  • mongodb:replica-compose: Start a replica set MongoDB cluster using docker-compose

  • mongodb:replica-compose:down: Stop the replica set cluster

  • mongodb:sharded-compose: Start a sharded MongoDB cluster using docker-compose

  • mongodb:sharded-compose:down: Stop the sharded MongoDB cluster

  • task test: Run the tests with the current version.

  • task full-test: Run the tests against all supported versions.

  • task coverage: Get the test coverage (xml and html) with the current version.

  • task docs: Start the local documentation server.