We use poetry to manage the dependencies.
If you do not have poetry installed, you should run the command below.
make download-poetryTo install dependencies and prepare pre-commit hooks you would need to run install command:
make installTo activate your virtualenv run poetry shell.
After you run make install you can execute the automatic code formatting.
make codestyleWe 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!
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 your code please do the following steps:
- Add any changes you want
- Add tests for the new changes
- Edit documentation if you have changed something significant
- Run
make codestyleto format your changes. - Run
STRICT=1 make check-styleto ensure that types and docs are correct - Run
STRICT=1 make check-safetyto ensure that security of your code is correct
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.
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.