diff -r 2d2dd2c638e8 -r c20d7e202152 src/eric7/PipInterface/piplicenses.py --- a/src/eric7/PipInterface/piplicenses.py Fri Aug 02 14:35:21 2024 +0200 +++ b/src/eric7/PipInterface/piplicenses.py Fri Aug 02 18:02:56 2024 +0200 @@ -38,6 +38,8 @@ # - changed 'create_licenses_table' to 'create_licenses_list' # - changed 'create_summary_table' to 'create_summary_list' # - changed 'create_output_string' to return a JSON string +# - removed 'load_config_from_file()' because we only use command line +# configuration # from __future__ import annotations @@ -66,13 +68,10 @@ __pkgname__ = "pip-licenses" -__version__ = "4.4.0" -__author__ = "raimon" -__license__ = "MIT" +__version__ = "5.0.0" __summary__ = ( "Dump the software license list of Python packages installed with pip." ) -__url__ = "https://github.com/raimon49/pip-licenses" FIELD_NAMES = ( @@ -678,6 +677,12 @@ ] +def get_value_from_enum( + enum_cls: Type[NoValueEnum], value: str +) -> NoValueEnum: + return getattr(enum_cls, value_to_enum_key(value)) + + MAP_DEST_TO_ENUM = { 'from_': FromArg, 'order': OrderArg, @@ -693,11 +698,10 @@ option_string: Optional[str] = None, ) -> None: enum_cls = MAP_DEST_TO_ENUM[self.dest] - values = value_to_enum_key(values) - setattr(namespace, self.dest, getattr(enum_cls, values)) + setattr(namespace, self.dest, get_value_from_enum(enum_cls, values)) -def create_parser(): +def create_parser() -> CompatibleArgumentParser: parser = CompatibleArgumentParser( description=__summary__, formatter_class=CustomHelpFormatter )