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.
- Fork the repository on GitHub
- Clone your forked repository to your local machine and setup a development environment.
- Make your changes and commit them with descriptive commit messages.
- Push your changes to your forked repository.
- Submit a pull request to the main repository
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:
- Install Hatch package manager. Example installation with pip:
pip --upgrade pip
pip install hatch
- In your shell, go to the project directory and install the project dependencies:
hatch env create
- Activate the development environment:
hatch shell
- Confirm the project is installed:
pip show rs-distributions
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
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.
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.
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.
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