Skip to content

Latest commit

 

History

History
72 lines (58 loc) · 2.76 KB

CHANGELOG.md

File metadata and controls

72 lines (58 loc) · 2.76 KB

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

0.4.0 - 2022-07-07

Added

  • Support for parsing arguments based on attrs attributes.

Changed

  • Removed Choices in favor of Literal.
  • Changed packaging and tool configurations to using pyproject.toml.
  • Changed certain fields in ArgumentSpecs; added a note that this class is internal and offers no stability guarantees.

Fixed

  • Fixed a bug where arguments are not collected in the correct method resolution order (MRO).

0.3.1 - 2021-05-16

Added

  • Support for snake_case (underscore style) arguments. (#6)
  • A DeprecationWarning is now shown when using Choices instead of Literal.

0.3.0 - 2021-01-08

Added

  • Support for list arguments. (#1)
  • __repr__ method for Arguments. (#2)
  • Defined arguments are now stored in a special class variable __arguments__ in the Arguments subclass namespace. A utility function argtyped.argument_specs(Args) is provided to inspect the specifications of the arguments.

Changed

  • Annotations are now parsed on class construction, and the argparse.ArgumentParser object is stored for the whole lifetime of the class as __parser__.
  • Exceptions thrown for invalid type annotations are changed from ValueErrors to TypeErrors.

Fixed

  • It is now possible to override an argument with default value defined in the base class with a new argument that does not have a default. Namely, the following code is now valid (although discouraged):
    from argtyped import Arguments, Choices
    
    class BaseArgs(Arguments):
        foo: int = 0
    
    class DerivedArgs(BaseArgs):
        foo: Choices["a", "b"]
  • Optional[Literal[...]] is now correctly supported.
  • Optional[Switch] is now correctly detected (although invalid).

0.2.0 - 2020-06-15

Added

  • Literal types: Literal. They act mostly the same as Choices.

Changed

  • Arguments is now pickle-able.

0.1 - 2020-02-16

Added

  • The base of everything: the Argument class.
  • Choice types: Choices.
  • Custom enum types: Enum. They differ from built-in Enum in that auto() produces the enum name instead of numbers.
  • Switch types: Switch.