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
- 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.
- 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
- Improved full reference path detection for both field and configuration objects.
- New internal
ConfigTypeField
that allows a schema field to reference aConfigType
class, as returned by thecincoconfig.make_type
function. - New method,
asdict
, to get a Config values as adict
. - New method,
get_fields
, to get all fields within a Schema or Config.
- Work was done to reduce methods exposed by the
Schema
andConfig
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
: usecincoconfig.instance_method
instead.Schema.generate_argparse_parser
: usecincoconfig.generate_argparse_parser
instead.Schema.make_type
: usecincoconfig.make_type
instead.Schema.validator
: usecincoconfig.validator
instead.Schema.get_all_fields
: usecincoconfig.get_all_fields
instead.Schema.full_path
andConfig.full_path
: usecincoconfig.item_ref_path
instead.Config.cmdline_args_override
: usecincoconfig.cmdline_args_override
instead.
BaseSchema
andBaseConfig
were removed and their functionality merged into their concrete classes,Schema
andConfig
, respectively. cincoconfig will continues to provideBaseConfig
andBaseSchema
aliases but these will be removed in v1.0.0.FormatRegistry
functionality integrated intoConfigFormat
.
Field
subclasses were broken out into separate modules.Field.key
was renamed toField._key
to be consistent withSchema
andConfig
.Field.schema
was renamed toField._schema
to be consistent withSchema
andConfig
.cincoconfig.abc
andcincoconfig.config
modules were integrated into a newcincoconfig.core
module.
v0.7.0 - 2021-02-09
- Support for the
~
home directory symbol. All filenames are passed through theos.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. Thehelp
and autogeneratedshort_help
attribute, can be used in UI to display information and documentation about the field.BaseSchema.generate_argparse_parser
method to autogenerate anargparse.ArgumentParser
object to parse command line arguments.Field.env
andSchema.env
to control automatically loading configuration values from environment variables.
- Improved error reporting with the
ValidationError
exception that contains the offending field's full name and path.
v0.6.0 - 2020-11-05
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).
StringField
now only accepts string values. Prior to this release, all input values were coerced to a string, viastr(value)
. This was causing inconsistencies and non-intuitive behavior for fields that inherited fromStringField
.- Refactor
ListProxy
to inherit fromlist
.
ListField
now handles empty orNone
values.
v0.5.0 - 2020-10-31
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 theField.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.
- 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.
- 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 defaultListField
value in aListProxy
object.SecureField
: Properly loadbest
encrypted values.SecureField
: Resolvebest
encryption method to a concrete method (aes or xor) during encryption.
0.4.0 - 2020-07-25
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.
- 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, viaiter()
or the newget_all_fields()
.