Skip to content

Latest commit

 

History

History
101 lines (71 loc) · 3.6 KB

CONTRIBUTING.md

File metadata and controls

101 lines (71 loc) · 3.6 KB

Contributing

Welcome to axem's contribution guide. We would like to work together with anyone and everyone in a fun, enjoyable, and educational way. To achieve this please follow our CoC.

All contributions, including new features, bug fixes, new docs, graphics, and more are welcome. Please create new issues for bugs, feature ideas, or any improvements.

Reach out to us at

Before contributing don't forget to read the DEM's documentation or try the tutorial for hand-on experience.

Creating a new issue

  1. Select 'New issue'
  2. Select issue type
  3. Write a small description as the Title
  4. Fill the issue template
  5. Set extra labels if needed
  6. Set the project to DEM Open and status to 🆕 New
  7. Submit the new issue

Working on an issue

  1. Select an issue which has the status 🔖 Ready to implement under the issue's project settings
  2. Discuss the selected issue with the maintainers -> you can reach out at the Discussions or Discord
  3. Set the selected issue's status to 🏗️ In progress when you start to work on it
  4. Fork the DEM, if you haven't done it already
  5. Create a new feature branch for your modifications (you can name it as you wish, but our best practice is to name it after the issue ID)
  6. Create the implementation
  7. Write the new test cases to achieve 100% coverage for your modifications
  8. Update the documentation
  9. Open a PR from your fork to the upstream main and fill the PR template
  10. Set the persea group as reviewer, then set the issue's status to 👀 In review
  11. Fix the findings if there is any
  12. The reviewer who approved the PR can set the status to ✅ Done
  13. The branch can be merged to the upstream main

Rules for the implementation

  1. 100% code coverage must be achieved for every modification you make in the production code.
  2. Use type annotation for the function parameters and return values.
  3. Use the appropriate Third-party modules where applicable:
    1. Typer: Create CLI commands and get input from the user.
    2. Rich: Format output.
    3. Requests: Create HTTP requests.
    4. Readchar: Get single character input from the user.
    5. Docker: Communicate with the Docker Engine.

Working with the DEM source

The following steps are mandatory to be able to work with the DEM source.

We use poetry to manage dependencies and create a virtual environment for DEM. Install it with:

curl -sSL https://install.python-poetry.org | python3 -

You should enter the preconfigured virtual environment to ensure that you use the correct version of the required modules.

First, install the environment with the required dependencies:

poetry install

Enter the virtual environment:

poetry shell

The recommended way to test your modifications is to use the poetry shell.

As an alternative, you can use DEM as a Python module. To do this, you must add the -m flag to your command.

For example:

python -m dem list --local --env

Running Unit Tests

Run unit tests:

pytest tests

Run unit tests with coverage information as HTML:

pytest --cov-report=html --cov=dem tests/

If you'd like the coverage results right in your terminal:

pytest --cov-report term-missing --cov=dem tests/