Skip to content

Latest commit

 

History

History
93 lines (66 loc) · 3.02 KB

CONTRIBUTING.md

File metadata and controls

93 lines (66 loc) · 3.02 KB

How to contribute

Dependencies

We use poetry to manage the dependencies. If you do not have poetry installed, you should run the command below.

make download-poetry

To install dependencies and prepare pre-commit hooks you would need to run install command:

make install

To activate your virtualenv run poetry shell.

Codestyle

After you run make install you can execute the automatic code formatting.

make codestyle

We require the black code style, with 88 characters per line maximum width (exceptions are only permitted for imports and comments that disable, e.g., a pylint warning). Imports are ordered using isort. Docstrings shall conform to the Google Python Style Guide. Except for the above-mentioned differences, we suggest to conform to the Google Python Style Guide as much as possible.

In particular, we want to point to Sec. 2.14 of Google's style guide, regarding None checks.

Imports from __future__ are not permitted except for the from __future__ import annotations feature that allows more concise type hints. Pynguin requires at least Python 3.8—there is not need to support older versions!

Checks

Many checks are configured for this project. Command make check-style will run black diffs, darglint docstring style and mypy. The make check-safety command will look at the security of your code.

Note: darglint on Windows only runs in git bash or the Linux subsystem.

You can also use STRICT=1 flag to make the check be strict.

Before submitting

Before submitting your code please do the following steps:

  1. Add any changes you want
  2. Add tests for the new changes
  3. Edit documentation if you have changed something significant
  4. Run make codestyle to format your changes.
  5. Run STRICT=1 make check-style to ensure that types and docs are correct
  6. Run STRICT=1 make check-safety to ensure that security of your code is correct

Unit Tests

Pynguin uses pytest to execute the tests. You can find the tests in the tests folder. The target make test executes pytest with the appropriate parameters.

To combine all analysis tools and the test execution we provide the target make check, which executes all of them in a row.

We automatically deploy the coverage report (HTML version) from the CI chain to an external server (only for the master branch). It is necessary to test code! Untested code cannot be accepted—or only under rare conditions.

Other help

You can contribute by spreading a word about this library. It would also be a huge contribution to write a short article on how you are using this project. You can also share your best practices with us.