Contributing guide lines

We appreciate all contributions. If you are planning to contribute bug-fixes or documentation improvements, please open a pull request (PR) without further discussion. If you planning to contribute new features, please open an issue and discuss the feature with us first.

To start working on pyimagetest-new clone from the latest version and install the development requirements:

PYIMAGETEST-NEW_ROOT = pyimagetest-new
git clone https://github.com/pmeier/pyimagetest-new $PYIMAGETEST-NEW_ROOT
cd $PYIMAGETEST-NEW_ROOT
pip install -r requirements-dev.txt
pre-commit install

Every PR is subjected to multiple checks that it has to pass before it can be merged. The checks are performed by tox . Below you can find details and instructions how to run the checks locally.

Code format and linting

pyimagetest-new uses isort to sort the imports, black to format the code, and flake8 to enforce PEP8 compliance.

Furthermore, pyimagetest-new is PEP561 compliant and checks the type annotations with mypy .

To format your code run

cd $PYIMAGETEST-NEW_ROOT
tox -e format

Note

Amongst others, isort and black are run by pre-commit before every commit.

To run the full lint check locally run

cd $PYIMAGETEST-NEW_ROOT
tox -e lint

Tests

pyimagetest-new uses pytest to run the test suite. You can run it locally with

cd $PYIMAGETEST-NEW_ROOT
tox

Note

pyimagetest-new adds the following custom options with the corresponding @pytest.mark.* decorators: - --skip-large-download: @pytest.mark.large_download - --skip-slow: @pytest.mark.slow - --run-flaky: @pytest.mark.flaky

Options prefixed with --skip are run by default and skipped if the option is given. Options prefixed with --run are skipped by default and run if the option is given.

These options are passed through tox if given after a -- flag. For example, the CI invocation command is equivalent to:

cd $PYIMAGETEST-NEW_ROOT
tox -- --skip-large-download

Documentation

To build the html and latex documentation locally, run

cd $PYIMAGETEST-NEW_ROOT
tox -e docs