Skip to content

Contributing to Chainmock

We appreciate your interest in contributing to our open-source project. Please take a moment to review the following instructions to make sure everything goes smoothly.

Table of Contents

How can I contribute?

Reporting bugs

If you discover a bug, please create an issue and include as much detail as possible. Describe the issue, steps to reproduce, and the expected and actual behavior.

Suggesting enhancements

If you have an idea for an enhancement or new feature, please create an issue on GitHub to discuss it. Provide a clear and concise description of the proposed feature and its use case.

Contributing code

We welcome code contributions! If you would like to contribute code, please follow the instructions below.

Getting started

Before you start contributing, ensure that you have the latest version of Poetry installed. See Poetry documentation for installation instructions.

After installing Poetry, run the following command to install the project's dependencies:

poetry install

After installing the dependencies, run the following command to activate the project's virtual environment:

poetry shell

Pull Request Guidelines

Please follow these guidelines when submitting a pull request:

  • Update documentation related to your changes if applicable.
  • Include tests for your changes if applicable.
  • Ensure that your pull request has a clear title and description.
  • Reference any related issues in the description.

Testing and linters

Tests and linters are automatically run on every pull request. You can run them locally with the following Makefile commands:

# Run tests and linters
make
# Run only linters
make lint
# Run only tests
make test

Running tests with Tox

Tox is used to run tests in multiple Python environments. To execute tests with different Python versions you need to first have the Python versions installed locally. You can use, for example, pyenv project to install multiple Python versions.

After installing the Python versions, you can run the tests with the following command:

tox

The above command will run all the tests in all the Python versions defined in tox.ini file. You can also run the tests in a specific Python version with the -e flag:

tox -e py312

For more information see the Tox documentation.

Updating documentation

The documentation is created using Mkdocs. To test the documentation locally, run the following command:

mkdocs serve

For more details see the Mkdocs documentation and Material for Mkdocs documentation.

The documentation is hosted in Read the Docs and is automatically built and deployed when a pull request is merged.

License

By contributing to this project, you agree to the License of this repository.

Thank you for your contributions!