Changelog#

This document catalogs the changes to decree-tree. Some versions have been released, others not.

Unreleased#

In progress…

v0.4.0#

This release includes several enhancements, bug fixes, and documentation improvements, including but not limited to:

  • Fixed the attribute check for a populated parser in run(). This avoids rebuilding the parser on every call even when it had already been configured.

  • Ensured that an empty namespace can be passed to the options parameter in preprocess_options().

  • Changed repr_kwargs() to raise RuntimeError rather than KeyError when unexpected keyword argument keys are detected.

  • Added a raise_exception parameter to remove_child(). By default the method silently does nothing when the named child does not exist. Passing raise_exception=True causes InvalidName to be raised instead.

  • Updated ModifiedArgumentParser to use Iterable instead of Sequence in the type signature of parse_known_args(), matching an update to the upstream argparse type annotations.

  • Documented MRO ordering requirements for mixin classes. Placing a mixin after DecreeTree in the MRO (e.g. class MyCommand(DecreeTree, MyMixin)) is not supported, as DecreeTree relies on cooperative inheritance in ways that prevent mixins in that position from contributing behaviour reliably. Mixins should be placed before DecreeTree (e.g. class MyCommand(MyMixin, DecreeTree)), which is also the conventional Python ordering for mixins.

  • Split the CI test job into a matrix of per-interpreter jobs, using separate images for each supported Python version rather than using a single multi-python container for invoking tox.

  • Simplified the tox configuration by using wildcard environment patterns, reducing the number of explicit environment listings in pyproject.toml.

  • Added dependency locking to development and CI environments. poetry.lock and pylock.toml are now committed to the repository, ensuring reproducible dependency resolution across local development and CI runs.

  • Configured trusted publishing of the package to PyPI and TestPyPI using OIDC. Separate CI jobs handle tag-triggered releases to PyPI and branch-triggered releases to TestPyPI, each authenticating with a GitLab-issued OIDC token rather than a stored credential.

  • Added automated documentation publishing via CI. Documentation is built and pushed to the documentation site on every commit to the default branch and on every version tag. After each push, a downstream pipeline in the documentation repository is triggered automatically to deploy the updated content.

  • Added automated release creation for version tags. A dedicated CI job creates a GitLab release for each tag, including a changelog excerpt drawn from the main docs and links to the documentation site and the PyPI package page.

  • Added Cobertura XML coverage reports and JUnit test result files as CI artifacts, enabling per-line coverage display in merge request diffs and test-result visualization within GitLab.

  • Disabled publish jobs in pipelines running in forked repositories. Jobs that push packages or documentation are guarded by a namespace check and do not run outside the originating project, preventing accidental publication attempts from forks.

  • Synchronized with v0.3.0 of the elasmocalc-copier-template. This included restructuring pyproject.toml to align with updated template conventions, adding a conftest.py for shared test configuration, updating .gitignore patterns, and refreshing other project scaffolding files.

  • Updated development package dependency versions.

  • Several other minor code, test, CI, and documentation improvements.

v0.3.0#

This release includes several enhancements, bug fixes, and documentation improvements, including but not limited to:

  • Changed the interplay of subcommands and other command line options and arguments. Now a particular subcommand will only allow either its subcommands (and help option) or its own and inherited arguments and options. This avoids situations where arguments or options are specified and ignored, and improves help output.

  • Defined a custom argument parser class: ModifiedArgumentParser. At present, its only difference from its parent in argparse is that it parse_known_args() now errors on unrecognized arguments. This ensures that help usage statements for unexpected arguments are as specific as possible for the chosen subcommand. A different parser class can be substituted by specifying argument_parser_class directly or via an argument to run().

  • Implemented the debug_print() method for optionally printing debug information. Printing is controlled by debug_tracing, and can be specified as an argument to run(). Internally, debug_tracing is propagated to children via set_debug_tracing().

  • Defined exec_obj_opt, which facilitates renaming of the hidden option indicating the selected subcommand. This can help avoid name clashes. This attribute is propagated via the new set_options() method.

  • Added a flag to parser_options() to indicate whether its the options are applied to a subparser or a top-level parser.

  • Defined repr_kwargs() to control the arguments displayed in the output from __repr__().

  • Split configure_parser() from configure_parser() to improve separation of concerns.

  • Transitioned pyproject.toml to use a PEP-621 style. Poetry is still used for defining developmental dependencies.

  • Included coverage summary in local developmental test output.

  • Fixed some linting and test failures, including in docstrings.

  • Updated, expanded, and clarified documentation, particularly for configuration, development, and command nesting.

  • Added support for documentation source code links based on the sphinx.ext.linkcode extension.

This version was manually pushed to PyPI and the documentation site, as the CI pipeline was still under development.

v0.2.0#

This release includes several substantial refactorings and enhancements, including but not limited to:

  • Renamed TreeContainer class to Tree, changed it to use a generic type var, and moved its definition to a separate module.

  • Renamed DecreeTree methods to consistently refer to the parent or child, retaining helper methods add() and get() in DecreeTree.

  • Clarified that add_arguments() modifies its parser argument, not directly a class or instance variable.

  • Ensured that run() can be executed from non-root commands in the assembled tree.

  • Improved arguments to __init__(), along with creating __str__() and __repr__() methods. This removes the prog_or_name argument to __init__(), replacing it with name and prog_is_name.

  • Changed the summary() method into the structure property and improved its output.

  • Created the AbstractDT class to facilitate abstract DecreeTree inheritance.

  • Removed decreeDecree class from the top level of package import.

  • Changed the inheritance behavior of commands, including from abstract parent classes and manual tree association, and the inherit class initialization argument.

  • Enhanced customization of parsers with parser_options() and subparsers_options().

  • Improved typing throughout the package, with a goal of clear documentation and IDE hinting.

  • Greatly expanded the test suite, reaching greater than 90% coverage.

  • Created extensive documentation, including embedded tests.

  • Started use of GitLab CI for testing and package building.

  • Lowered the minimum version required for the typing-extensions package.

This version was manually pushed to PyPI and the documentation site, as the CI pipeline was still under development.

v0.1.0#

The first working version of the tool. Still in a developmental state, this version was not released as a package.

v0.0.0#

The initial commit, tagged for posterity.