Skip to content
This repository has been archived by the owner on Sep 3, 2024. It is now read-only.

Latest commit

 

History

History
410 lines (346 loc) · 15.5 KB

CHANGELOG.md

File metadata and controls

410 lines (346 loc) · 15.5 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.

Nomenclature

  • CPE : Short for ConfigParserEnhanced.

Updates and Changes

[0.8.1.5] - 2023-10-24

Changed

  • Add deprecation notice to the docs

[0.8.1.4] - 2023-10-24

Changed

  • Remove maintainer contact info

[0.8.1.3] - 2023-10-24

Changed

  • Redirect users to ActiveConfigParser and its dependencies

[0.8.1.2] - 2022-01-07

Changed

  • Documentation cleanup.

[0.8.1.1] - 2021-12-23

Changed

  • Minor documentation cleanup for distribution.

[0.8.1] - 2021-12-20

Changed

  • Updating documentation to a standard that's good for distribution on PyPi, Github, and Read The Docs.

[0.8.0] - 2021-11-01

Added

  • OSS License approval
    • Using 3-Clause BSD license.
    • Added LICENSE.md
    • Added License headers to source files.
  • Github Actions Script (initial testing)

Changed

  • Added some docstring updates.
  • Changed the require set before use restriction on parse_section_last_result that uses TypedProperty since this seemed to trigger an error in the insection part of get_known_operations(). I'm not sure why inspection would do that at this time and it'll need a bit of investigation. Probably we need to implement a proper getter in TypedProperty and apply those checks there.

Deprecated

Removed

Fixed

  • Added the list of file(s) that are loaded to the error message in the validator functions: assert_file_all_sections_handled, assert_section_all_options_handled
  • Fixed a bug in the list comprehension in get_known_operations() and added a test to make sure it's doing the right thing.

Internal

Security

[0.7.0] - 2021-08-16

Added

  • get_known_operations()
    • Generate a list of known operations based on defined handlers.
  • get_known_operations_message()
    • Generate a message listing known operations generated by get_known_operations().
  • assert_section_all_options_handled()
    • Enable a check that there are no unhandled options within a specific section of a .ini file.
  • assert_file_all_sections_handled()
    • Enable a check that there are no unhandled options in any section of a .ini file
  • _tokenize_option_key()
    • A parser helper used for processng options into possible operations
  • _get_op_components_from_tokenized_option_key()
    • A parser helper used for processng options into possible operations

Changed

Deprecated

Removed

Fixed

Internal

  • Updated .style.yapf and exec-reformat.sh and ran a pass through the code to do a formatting pass.
  • Added Python 3.6.x check to ConfigParserEnhanced.py
  • Changed many strings to use f-strings instead of .format() (requires Python 3.6)

Security

[0.6.0] - 2021-06-18

Added

  • property: default_section_name - parameterizes the CPE's version of the "DEFAULT" section. This defaults to "DEFAULT" and will get loaded in once at the start a new parse of a section.

Changed

  • Relocated the configparserenhanced directory into src/configparserenhanced and adjusted documentation, testing, etc. files to work with this new structure.
  • The logic for TypedProperty validator functions is reversed. Falsy results mean failure now and truthy results indicate a successful validation of a value.

Deprecated

Removed

Fixed

Internal

  • Performed a style refactoring pass.
    • Added a .style.yapf file with a reasonable looking set of specifications.
  • removed testing requirements from the requirements.txt file and put them in a new file, requirements-test.txt.
  • cleaned up output from the exec-tests.sh file to now put log info in files named _test-XXX.log
  • property: _internal_default_section_name - parameterizes the internal ConfigParser object's DEFAULT section to a nonstandard value (CONFIGPARSERENHANCED_COMMON). This section name should generally be avoided in .ini files as it can cause undefined behavior in CPE's recursive search when there are use operations present. This is because ConfigParser's DEFAULT section will be prepended to each section processed. This will invalidate any changes made in a CPE section to a value set in the default.

Security

[0.5.2] - 2021-05-19

Added

Changed

Deprecated

Removed

Fixed

Internal

  • Added a default_factory to the TypedProperty utility for when the default value is too complex to use deepcopy and we need to use some kind of generator.

Security

[0.5.0] - 2021-05-18

Added

  • operation_handler decorator
    • Enables the creation of handlers using decorators. For example:
      @operation_handler
      def handler_myop(self, section_name, handler_parameters):
          # do stuff
          return 0
  • __repr__() added to ConfigParserEnhanced.ConfigParserEnhancedData
  • TypedProperty : implements a dataclass pattern that allows the generation of "typed" properties generally following and extending the pattern outlined in "9.21 Avoiding Repetitive Property Methods" from the O'Reilly "Python Cookbook, 3rd Edition" (https://learning.oreilly.com/library/view/python-cookbook-3rd/9781449357337/)

Changed

  • HandlerParameters is modified to use TypedProperty.typed_property pattern to define properties.

Deprecated

Removed

Fixed

Internal

Security

-->

[0.4.1] - 2021-05-03

Added

  • Method: Add new method, write(). This is a wrapper to unroll_to_str() which writes the output to a file pointer. We included this function to provide a familiar interface to ConfigParserEnhanced as the ConfigParser.write() method.
  • Method: Add new method, unroll_to_str(). This generates a str containing a parsed copy of the .ini file in which all handled options are stripped out leaving the regular key:value pairs remaining. The effect of this is to generate a string containing the transitive-closure of each section's options after all the use operations have been processed.
  • ExceptionControl: Added new event type SILENT, which will throw its exception at the same level of a WARNING but will never print a warning message to stdout.
  • ConfigParserEnhanced property: configparser_delimiters which exposes the ability to modify the delimiters in the underlying ConfigParser parser for .ini files. Default value is ('=',':') and it allows assignment as a list, tuple, or str but gets converted to a tuple internally.
  • Internal helper method _locate_class_method(method_name) which finds a class method if it is defined.

Changed

Deprecated

Removed

Fixed

Internal

Security

[0.4.0] - 2021-03-30

Removed the regular expression based splitting method for keys into tokens for the use of shlex.split, which looks to do a better job of extracting tokens in the manner we would like without requiring a complex REGEX.

HandlerParameters was also changed to remove op_params in favor of two new properties: op and params, where op is a string and params is a list of strings.

Added

  • HandlerParams property: HandlerParams.op
  • HandlerParams property: HandlerParams.params

Changed

Deprecated

Removed

  • ConfigParserEnhanced method: ConfigParserEnhanced._regex_splitter()
  • ConfigParserEnhanced method: ConfigParserEnhanced._regex_op_matcher()
  • ConfigParserEnhanced method: ConfigParserEnhanced._get_op1_from_regex_match()
  • ConfigParserEnhanced method: ConfigParserEnhanced._get_op2_from_regex_match()
  • HandlerParameters property : HandlerParams.op_params

Fixed

Internal

Security

[0.3.1] - 2021-03-24

Added

Changed

Deprecated

Removed

Fixed

  • Issue #10: Bugfix: dots . in section names confused the use command.

Internal

  • Add _validate_parameter internal function to wrap the parameter check operation that we do around the code. This simplifies some of the coverage issues and also makes it easier to put more type checks around parameters.

Security

[0.3.0] - 2021-03-22

Added

  • ConfigParserEnhanced.parse_all_sections() added as a shortcut to kick off a full parse of ALL sections in the .ini file.

Changed

  • Changed ConfigParserEnhancedData.data property to include an empty "DEFAULT" section if none is provided by the .ini file. This is to maintain compatibility with ConfigParser.
  • Changed ConfigParserEnhancedData.get(section, option) to ConfigParserEnhancedData::get(section, option=None). Now option can be an optional parameter and will return a dict containing the section's keys if only a section is provided.

Deprecated

Removed

Fixed

Security

[0.2.1] - 2021-03-15

Added

  • New private method: _loginfo_reset. This removes the _loginfo attribute.
  • New internal method _apply_transformation_to_operation(). Applies any needed transformations to the raw <operation> strings. Currently this just replaces occurrences of - with _ to operations.
  • New internal method _apply_transformation_to_parameter(). Applies any needed transformations to the raw <parameter> strings. Currently this is just a pass-through, added now to pair with _apply_transformation_to_operation().

Changed

  • Add parameter parse to ConfigParserEnhancedData.sections which can be either True, False, or "force".
    • If False then requesting configparserenhanceddata.sections() will give the list of sections in the .ini file without parseing them.
    • If True then requesting configparserenhanceddata.sections() will give the list of sections in the .ini file but it will also kick off the parser to parse (and cache) them.
    • If "force" then requesting configparserenhanceddata.sections() will FORCE a (re)parse of the sections in the .ini file.
  • Add parameter force_parse to ConfigParserEnhancedData._parse_owner_sections() in support of new parse parameter to ConfigParserEnhancedData.sections.
  • operations have added processing to do some normalization. Currently this is just a replacement of any - with _. For example, an operation such as foo-bar-baz will be converted to foo_bar_baz internally.

Deprecated

Removed

Fixed

  • Fix a bug in the indexing in the ExceptionControl module to print out the correct stack entry showing where exception_control_event was called that triggered the event in the traceback when exception_control_compact_warnings is enabled.

Security

[0.2.0] - 2021-03-10

Added

Changed

  • ExceptionControl
    • Add property _exception_control_map_event_to_level_req to ExceptionControl which maps the exception control levels to the type names.
    • Add new class of exception_control_event: "CATASTROPHIC" which indicates errors that will always raise the exception and cannot be overridden.
  • Added property exception_control_silent_warnings to ExceptionControl to enable silencing events that would only print out a warning message.
  • Added property exception_control_compact_warnings to ExceptionControl to enable compact one-line warning messages instead of the full message and stack trace that is normally generated.
  • Renamed generic_handler to _generic_option_handler because that name could inadvertantly cause a .ini file option such as generic command: should not invoke a handler to invoke the generic_handler but it would go through the handled operation code path and not the true generic command code path.

Deprecated

Removed

Fixed

Security

[0.1.4] - 2021-03-04

Added

  • New property to ConfigParserEnhanced: parse_section_last_result. This property gives access to the results from the last call to parse_section().

Changed

  • ConfigParserEnhanced.__init__ signature changed. The filename parameter is now optional at construction time. It can be still be set via the inifilepath property.
  • Parses of sections kicked off via the inner class ConfigParserEnhancedData such as parser.configparserenhanceddata[section] will no longer tell parse_section to skip calling handler_initialize and handler_finalize. The output of this call won't change, but this will affect the state of handler_parameters.data_shared, and what is returned by parse_section_last_result.

Deprecated

Removed

Fixed

Security

[0.1.3] - 2021-03-01

  • ConfigParserEnhanced is currently alpha and has many changes occurring.

Added

  • Added enter_handler() method to ConfigParserEnhanced. This should be called immediately upon entry to a handler to provide logging information that can be useful when debugging. This is in the public api -- not that we encourage a subclass to modify it much but we encourage subclasses to use it in their custom handlers.
  • Added exit_handler() method to ConfigParserEnhanced This should be called just before a handler exits to provide logging and information that can be useful when debugging. This is in the public api -- not that we encourage a subclass to modify it much but we encourage subclasses to use it in their custom handlers.
  • Added _launch_handler_generic method to ConfigParserEnhanced which is a wrapper to launching handler_generic. This handles launching the generic handler and updating the configparserenhanceddata structure.
    • This was also useful because we launch the generic handler from two places in the parser.

Changed

  • Moved __version__ string to a new file, version.py
  • Replaced setup.py with pyproject.toml
    • Generated using the poetry package (python3 -m pip install --user poetry).
  • Updated ConfigParserEnahanced._new_handler_parameters to create a 'new' HandlerParameters object when called that copies in the data_shared and data_internal references from the caller but creates new entries for the other pieces. This fixed a bug in recursion of use <section> entries where the handler that is called would overwrite parts of handler_parameters which, as a side effect, would change the state to the caller in the recursion.
    • Modified the API to _new_handler_parameters
    • Added

Deprecated

Removed

[0.1.2] - 2021-02-24

Changed

  • Fixed issue in the formatting of the ExceptionControl method exception_control_event where events are printed to the console rather than raising an exception. The message now properly prints out the call stack to the location where exception_control_event was called from. The warning message formatting was changed slightly as well to add the characters !! as a prefix to all the lines in the message.

[0.1.1] - 2021-02-23

Changed

  • Brought handling of a key:value pair where there is no separator character (:, =) in line with how configparser handles these. If they key has a separator but no value then the value field will get an empty string, but if there is no separator then value will be set to None. Prior to this, ConfigParserEnhanced converted value to a string which would cause None to be converted to a string: "None".

[0.1.0] - 2021-02-23

Removed

  • Removed SetEnvironment into its own repository.
  • Cleaned up setup.py and added new helper scripts.

[0.0.1] - 2021-02-22

  • 0.0.1 added to help SetEnvironment have a version to pull via Pip.