Skip to content

Latest commit

 

History

History
111 lines (80 loc) · 3.56 KB

CONTRIBUTING.md

File metadata and controls

111 lines (80 loc) · 3.56 KB

Contributing to rs-distributions

We actively welcome contributions to rs-distributions. You can help contribute by filing issues on the GitHub repository, adding distributions, fix outstanding issues, and by contributing with examples or to the documentation.

The following sections provide guidelines for setting up a development environment and explain how the steps to follow before submitting a pull request.

Getting Started

  1. Fork the repository on GitHub
  2. Clone your forked repository to your local machine and setup a development environment.
  3. Make your changes and commit them with descriptive commit messages.
  4. Push your changes to your forked repository.
  5. Submit a pull request to the main repository

Development setup

To setup a development environment, ensure you have Python 3.8 or higher. You will also need the Hatch package manger. Follow these steps to setup a development environment:

  1. Install Hatch package manager. Example installation with pip:
pip --upgrade pip
pip install hatch
  1. In your shell, go to the project directory and install the project dependencies:
hatch env create
  1. Activate the development environment:
hatch shell
  1. Confirm the project is installed:
pip show rs-distributions

Running Tests

We use pytest for running tests. If you are adding a new feature, we ask that you please write a test to go along with your new feature. To run all of the tests, use the following command:

hatch run test

You can also run individual test files. This will run all of the tests in path/to/test_file.py:

hatch run test path/to/test_file.py

Additionally, you can run a specific test class within a test file. This will run path/to/test_file.py::TestClassName

hatch run test path/to/test_file.py::TestClassName

Continuous Integration

The tests for rs-distributions will automatically run upon any pull request. Any issues will need to be fixed before the changes are merged into the main repository.

Code Style and Formatting

We follow the Black code style and use Ruff for linting. To check for errors in code formatting, use the following command:

hatch fmt --check

To automatically format your code, use:

hatch fmt

Please ensure that your code passes the formatting checks before submitting a pull request.

Submitting Pull Requests

When you are ready to submit a pull request, please ensure that:

  • Your changes are based on the latest main branch.
  • Your code follows the project's code style and formatting guidelines.
  • If you added a new feature, please write a test to go along with it.
  • Your commit messages are descriptive and explain the purpose of your changes.
  • Your pull request description provides a clear explanation of your changes.

Building Documentation Locally

We use MkDocs for building the project documentation. To build the documentation locally, you can use the following command:

hatch run docs:build

To preview the documentation locally, you can use:

hatch run docs:serve