Release notes

4.0 (2017-04-19)

  • Clize now parses Sphinx-style docstrings. It becomes the recommended way of documenting functions, as it is interoperable and not specific to Clize.
  • Value converters can now convert the default value for their parameter. Specify convert_default=True when decorating with value_converter.
  • clize.converters.file:
    • you can use it without parenthesis now: def func(infile:converters.file):
    • it now converts the default parameter: infile:converters.file='-' gives a file opener for stdin if no value was provided by the user
  • parameters.mapped: Raises an error when two identical values are given.
  • Improved error messages for incorrect annotations.
  • Parameter converters must have a name. You can now specify one using the name= keyword argument to parameter_converter.
  • Clize now shows a hint if a subcommand is misspelled.
  • Dropped Python 2.6 support. Use Clize 3.1 if you need to support it.
  • Fix wrong docstring being used for header/footer text when the intended function had no (visible) parameters.
  • Extension API changes:
    • parser.CliBoundArguments now uses the attrs package. Instead of parsing arguments on instantiation, it has a process_arguments method for this. This is a breaking change if you were instantiating it directly rather than use parser.CliSignature.read_arguments
    • Separate the value setting logic in ParameterWithValue to a set_value method. Most parameter types don’t need to override read_argument anymore.
    • Separated the help CLI from documentation generation and display. Also comes with more attrs. This API is now documented.

3.1 (2016-10-03)

  • Support for sigtools’ automatic signature discovery. This is reflected in the function composition tutorial: In most cases you no longer have to specify how your decorators use *args and **kwargs exactly
  • Suggestions are provided when named parameters are misspelled. (Contributed by Karan Parikh.)
  • You can supply ‘alternative actions’ (i.e. –version) even when using multiple commands.
  • Improve hackability of argument parsing: named parameters are now sourced from the bound arguments instance, so a parameter could modify it duing parsing without changing the original signature.
  • Various documenation improvements.

3.0 (2015-05-13)

Version 3.0 packs a full rewrite. While it retains backwards-compatibility, the old interface is deprecated. See Upgrading from clize 1 and 2.

  • The argument parsing logic has been split between a loop over the parameters and parameter classes. New parameter classes can be made to implement cusom kinds of parameters.
  • The CLI inference is now based on sigtools.specifiers.signature rather than inspect.getfullargspec. This enables a common interface for the function signature to be manipulated prior to being passed to Clize. Namely, the __signature__ attribute can be overriden or sigtools’s lazy forger_function method can be employed.
  • The @clize decorator is deprecated in favor of directly passing functions to run, thus leaving the original function intact.
  • Named parameters are now obtained exclusively through keyword-only parameters. Other information about each parameter is communicated through parameter annotations. sigtools.modifiers provides backwards-compatibility for Python 2.
  • As a result of implementing the function signature-based abstraction, there are ways to set up decorators that work with Clize.
  • The help system now accepts subsection headers for named parameters.
  • Coercion functions have been renamed to value converters. Except for a few notable exceptions, they must be tagged with a decorator. This also applies to the type of supplied default values.
  • Alternate actions (for instance --version) can be supplied directly to run.
  • Several Parameter converter annotations have been added, including parameters with a limited choice of values, repeatable parameters, parameters that always supply the same value, and more.

2.0 (2012-10-07)

This release and earlier were documented post-release.

Version 2.0 adds subcommands and support for function annotations and keyword-only parameters.

1.0 (2011-04-04)

Initial release.