Skip to content

Latest commit

 

History

History
122 lines (97 loc) · 5.94 KB

CHANGELOG.md

File metadata and controls

122 lines (97 loc) · 5.94 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.

v0.9.0 - 2023-04-23

Added

  • New support method, is_value_defined to check if a config field value is defined by the user, through either a loaded config file or the API.
  • New support method, reset_value to reset a configuration value back to the default.
  • New Config method, Config._set_default_value, to set a field default value. This was added so that __setdefault__ methods wouldn't need to access the _data dictionary directly.
  • New options to the DictField that control key and value validation.

Internal API Changes

  • Switched to GitHub Actions.
  • Switched to ruff, pyright, and black for linting and formatting.
  • Switched to poetry for dependency management.

v0.8.0 - 2021-07-17

Added

  • Improved full reference path detection for both field and configuration objects.
  • New internal ConfigTypeField that allows a schema field to reference a ConfigType class, as returned by the cincoconfig.make_type function.
  • New method, asdict, to get a Config values as a dict.
  • New method, get_fields, to get all fields within a Schema or Config.

Deprecated

  • Work was done to reduce methods exposed by the Schema and Config classes by moving the functions out of the class. This methods are still available in the class but will be removed in v1.0.0.
    • Schema.instance_method: use cincoconfig.instance_method instead.
    • Schema.generate_argparse_parser: use cincoconfig.generate_argparse_parser instead.
    • Schema.make_type: use cincoconfig.make_type instead.
    • Schema.validator: use cincoconfig.validator instead.
    • Schema.get_all_fields: use cincoconfig.get_all_fields instead.
    • Schema.full_path and Config.full_path: use cincoconfig.item_ref_path instead.
    • Config.cmdline_args_override: use cincoconfig.cmdline_args_override instead.
  • BaseSchema and BaseConfig were removed and their functionality merged into their concrete classes, Schema and Config, respectively. cincoconfig will continues to provide BaseConfig and BaseSchema aliases but these will be removed in v1.0.0.
  • FormatRegistry functionality integrated into ConfigFormat.

Internal API Changes

  • Field subclasses were broken out into separate modules.
  • Field.key was renamed to Field._key to be consistent with Schema and Config.
  • Field.schema was renamed to Field._schema to be consistent with Schema and Config.
  • cincoconfig.abc and cincoconfig.config modules were integrated into a new cincoconfig.core module.

v0.7.0 - 2021-02-09

Added

  • Support for the ~ home directory symbol. All filenames are passed through the os.path.expanduser function.
  • IPv4NetworkField now support setting a minimum and maximum prefix length, in bits.
  • Field.help attribute to document the field, similar to a docstring. The help and autogenerated short_help attribute, can be used in UI to display information and documentation about the field.
  • BaseSchema.generate_argparse_parser method to autogenerate an argparse.ArgumentParser object to parse command line arguments.
  • Field.env and Schema.env to control automatically loading configuration values from environment variables.

Changed

  • Improved error reporting with the ValidationError exception that contains the offending field's full name and path.

v0.6.0 - 2020-11-05

Added

  • Field.sensitive property to mark a value as sensitive.
  • Config.to_tree() now supports masking sensitive values (sensitive_mask parameter) and including virtual fields in the tree (virtual parameter).

Changed

  • StringField now only accepts string values. Prior to this release, all input values were coerced to a string, via str(value). This was causing inconsistencies and non-intuitive behavior for fields that inherited from StringField.
  • Refactor ListProxy to inherit from list.

Fixed

  • ListField now handles empty or None values.

v0.5.0 - 2020-10-31

Added

  • StringField: Provide available choices in the raised exception when value is not valid.
  • Field.friendly_name() to retrieve the friendly name of the field, either the Field.name or the full path to the field in the configuration, Field.full_path()
  • Config.__contains__() to check if a configuration has a field value set.

Changed

  • All exceptions raised during validation are now wrapped in a ValidationError exception that contains the friendly name or full path to the field.
  • SecureField: Do not encrypt empty string or null values.

Fixed

  • Properly evaluate nested IncludeField.
  • FilenameField: Properly validate and handle required filename values.
  • ListField: Properly handle a list of complex or Schema objects.
  • ListField: Wrap the default ListField value in a ListProxy object.
  • SecureField: Properly load best encrypted values.
  • SecureField: Resolve best encryption method to a concrete method (aes or xor) during encryption.

0.4.0 - 2020-07-25

Added

  • Schema.__getitem__() implementation to get a schema field programmatically.
  • Schema.get_all_fields() to recursively get all the fields and nested fields from a schema.

Changed

  • The Schema fields are now stored in an OrderedDict so that the original order that the fields were added to the Schema is preserved when iterating over the Schema's fields, via iter() or the new get_all_fields().