pyerrors/CONTRIBUTING.md

38 lines
1.8 KiB
Markdown
Raw Permalink Normal View History

2023-03-10 14:37:50 +00:00
# Contributing
If you are new to contributing to open source software [this guide](https://opensource.guide/how-to-contribute) can help get you started.
2021-10-19 10:34:03 +01:00
### Setup
2023-03-10 14:37:50 +00:00
If you want to contribute to `pyerrors` please [fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) `pyerrors` on Github, clone the repository
2021-10-19 10:34:03 +01:00
```
2023-03-10 14:37:50 +00:00
git clone http://github.com/my_username/pyerrors.git
2021-10-19 10:34:03 +01:00
```
2023-03-10 14:25:17 +00:00
and create your own branch for the feature or bug fix
2021-10-19 10:34:03 +01:00
```
cd pyerrors
git checkout -b feature/my_feature
```
2023-03-10 14:37:50 +00:00
After committing your changes please send a pull requests to the `develop` branch. A guide on how to create a pull request can be found [here](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request).
2021-11-16 11:45:16 +00:00
2021-10-19 10:34:03 +01:00
### Documentation
2023-03-10 14:25:17 +00:00
Please add docstrings to any new function, class or method you implement. The documentation is automatically generated from these docstrings. We follow the [numpydoc style](https://numpydoc.readthedocs.io/en/latest/format.html) for docstrings. The startpage of the documentation is generated from the docstring of `pyerrors/__init__.py`.
2021-10-19 10:34:03 +01:00
### Tests
When implementing a new feature or fixing a bug please add meaningful tests to the files in the `tests` directory which cover the new code.
2021-10-21 15:05:21 +01:00
For all pull requests tests are executed for the most recent python releases via
2021-10-19 10:34:03 +01:00
```
pytest -vv -Werror
2023-03-10 14:25:17 +00:00
pytest --nbmake examples/*.ipynb
2021-10-19 10:34:03 +01:00
```
2023-03-10 14:25:17 +00:00
requiring `pytest`, `pytest-cov`, `pytest-benchmark`, `hypothesis` and `nbmake`. To install the test dependencies one can run `pip install pyerrors[test]`
To get a coverage report in html run
2021-12-07 08:37:33 +00:00
```
pytest --cov=pyerrors --cov-report html
```
The linter `flake8` is executed with the command
2021-10-19 10:34:03 +01:00
```
flake8 --ignore=E501,W503 --exclude=__init__.py pyerrors
2021-10-19 10:34:03 +01:00
```
2023-03-10 14:37:50 +00:00
Please make sure that all tests pass for a new pull requests.