Skip to content

add Python type hints to piuparts.py and its dependencies

Helmut Grohne requested to merge helmutg/typehints into develop

In order to fix a few type errors, some semantic changes are included.

  • Methods of the Defaults class raise NotImplementedError rather than returning None.
  • The settings class assigns default values for apt_unauthenticated, distro_config and testobjects in its constructor.
  • Renamed a few variables that were used with different types.
  • Added a number of assert something is not None to guide mypy.
  • get_state_meta_data constructs its result at once.
  • TimeOffsetFormatter.formatTime signature updated to match super class: Added default value.
  • The type of the warn_only argument changed to bool in two methods.
  • Added missing return statements and None values to existing return statements.
  • find_default_debian_mirrors returns [] when it previously returned None.
  • Rewrote DistroConfig.get as get_field to avoid conflicting with the super class type.
  • DistroConfig.get_deb_lines caches a lookup to help mypy track state.
  • unqualify always returns a list now.

Merge request reports

Loading