Skip to content

6.103.1

Compare
Choose a tag to compare
@NGPixel NGPixel released this 16 Mar 22:44
· 4849 commits to main since this release

Release Date: Mon, September 30, 2019 at 4:55 PM UTC
Release Author: Henrik Levkowetz


Test improvement: Starting to use Python type hints and mypy type checking

This release addresses two issues with the previous release, and as a result
of a test case failing to discover one of the issues, it also introduces the
use of Python type hints according to PEP 484. Type hints for common Python
library modules are provided by mypy, and type hints for Django are provided
by the django-stubs module. The problematic function that was used with the
wrong call signature has received a type annotation that will reveal similar
errors in the future.

This does not provide type annotation generally in the datatracker code;
that will require a lot of additional work (some of which can be automated),
but it gives us static type checking for Django and Python library calls,
and makes type hints useful when we provide them in datatracker code.

From the commit log:

  • Fixed up mypy issues or added type:ignore comments as needed for a
    clean mypy run.

  • Added a mypy .ini file

  • Added mypy and django-stubs to Py3 requirements, and added a mypy test
    case.

  • Changed the call signature of docevent_from_submission() to take an
    optional Person object, rather than person name. Added a type hint for the
    signature.

  • Tweaked the condition for waiving submission email confirmation
    slightly.


Coverage

chart