Migration

Read this page when you upgrade momotor-bundles to a new major version. It lists what you must change in your code and in your bundle XML before the new version can read it. Start with the section for the version you upgrade to.

Version 9

Supported Python versions

Version 9 requires Python 3.11 through 3.14. Python 3.10 is no longer supported. Upgrade your Python version before installing version 9.

Legacy parser compatibility

Compatibility with the momotor-common parser and generator has been removed. Remove the legacy argument from bundle factory, detection, and export calls, and from argument dataclasses. Both legacy=True and legacy=False now raise TypeError.

Update older XML before loading it with validation enabled:

  • Remove checklets children from results and checklet children from result. Checklet declarations belong in recipes.

  • Wrap HTML in meta-descriptions in CDATA, or escape the HTML markup.

With validate_xml=False, removed result checklet declarations are ignored with a warning, and malformed meta-descriptions are accepted with a warning. This setting does not restore the removed compatibility mode.

XML executable file attributes are parsed as strings. String values emit a warning before conversion to a boolean, including true, false, 1, and 0. An unrecognized value emits a second warning and becomes False. These values are accepted regardless of the validate_xml setting.

Exports omit a file’s src attribute when it equals the file’s name. The attachment path remains relative to the containing files element’s basesrc. Consumers must support this default instead of requiring an explicit src attribute.

Self-test declarations and reports

Version 9 replaces the self-test interface that earlier releases shipped as not yet implemented and subject to change. There is no legacy XML migration for it. Rewrite bundle XML and code before upgrading:

  • Replace expectedResult declarations in recipe and configuration XML with the tests declarations in Self-test declarations and reports.

  • Replace the grouped-results report API with case records. TestResultBundle.create(results=...) and its results collection no longer exist. Create reports with create(cases=...) and read the verdicts from cases, counts, and verdict instead. See Bundles and Self-test declarations and reports.

Ordinary product and result bundles are not affected by this replacement.

Required lxml backend

XML parsing, bundle detection, and serialization now always use lxml. Installing momotor-bundles installs lxml automatically through xsdata[lxml].

  • Replace momotor-bundles[lxml] with momotor-bundles in dependency declarations.

  • Remove imports of LxmlMissingError and momotor.bundles.utils.lxml.

The use_lxml argument remains accepted in bundle factory and export calls and in argument dataclasses. Supplying this argument emits a warning, regardless of whether its value is True, False, or None. All values are ignored, and XML processing always uses lxml. Omit the argument to avoid the warning. This compatibility argument will be removed in momotor-bundles version 10.

XML schema validation is enabled by default. Pass validate_xml=False to disable validation. XInclude and XSLT remain supported. XML output and errors now follow the lxml backend, including on installations that previously used the stdlib backend. Recalculate fingerprints derived from previously exported XML when migrating participants to the same bundle version.