From 2c40a5f66826b372eb3813670382e3167c9ebb0c Mon Sep 17 00:00:00 2001 From: andrzejnovak Date: Wed, 4 Oct 2023 06:27:14 +0200 Subject: [PATCH] docs: improve contrib --- CONTRIBUTING.md | 45 +++++++++++++++++++++------------------------ install.sh | 1 + 2 files changed, 22 insertions(+), 24 deletions(-) create mode 100644 install.sh diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 220b5a0e..b9922000 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,21 +2,9 @@ We are happy to accept contributions to `mplhep` via Pull Requests to the GitHub repo. To get started fork the repo. -## Pull Requests - -### Pull Requests Procedure - -If you would like to make a pull request please: - -1. Make a fork of the project -2. Install `pre-commit` and the project's `pre-commit` hooks -3. Commit your changes to a feature branch of your fork push to your branch -4. Test your changes with `pytest` -5. Make a PR - ## Bug Reports -TBD. +Please open an issue. ## Installing the development environment @@ -24,15 +12,22 @@ TBD. python -m pip install --upgrade --editable ".[all]" ``` - +### Pull Requests Procedure -## Running the tests +If you would like to make a pull request please: + +1. Make a fork of the project +2. Clone your fork locally +3. Install `pre-commit` and the project's `pre-commit` hooks +4. Test your changes with `pytest` +5. Commit your changes to a feature branch of your fork, push to your branch +6. Make a PR + +### Running the tests You can run the unit tests (which should be fast!) via the following command. @@ -40,21 +35,23 @@ You can run the unit tests (which should be fast!) via the following command. pytest --mpl --ignore=tests/test_notebooks.py ``` -Note: This ignores the notebook tests (which are run via [papermill](https://github.com/nteract/papermill) which run somewhat slow. +Note: This ignores the notebook tests (which are run via [papermill](https://github.com/nteract/papermill) and run somewhat slow. Make sure to run the complete suite before submitting a PR ```bash pytest --mpl ``` -## Making a pull request +### Making a pull request -We try to follow [Conventional Commit](https://www.conventionalcommits.org/) for commit messages and PR titles. Since we merge PR's using squash commits, it's fine if the final commit messages (proposed in the PR body) follow this convention. +We follow [Conventional Commit](https://www.conventionalcommits.org/) for commit messages and PR titles. Since we merge PR's using squash commits, it's fine if the final commit messages (proposed in the PR body) follow this convention. -## Generating Reference Visuals +### Generating Reference Visuals -If you modified expected outcomes of the test. New baseline visuals can be generated using this command: +If you modified expected outcomes of the tests. New baseline visuals can be generated using this command: ```bash pytest --mpl-generate-path=tests/baseline ``` + +Only include the actually modified baseline images in your PR! Running `git add -a` and the like will sometimes result in including images which are visually identially but not the same bit-wise. diff --git a/install.sh b/install.sh new file mode 100644 index 00000000..d6ab6269 --- /dev/null +++ b/install.sh @@ -0,0 +1 @@ +python -m pip install --upgrade --editable ".[all]"