Skip to content

Use ruamel.yaml.clib as default#4712

Merged
happz merged 6 commits intoteemtee:mainfrom
LecrisUT:feat/yaml-clib
Apr 16, 2026
Merged

Use ruamel.yaml.clib as default#4712
happz merged 6 commits intoteemtee:mainfrom
LecrisUT:feat/yaml-clib

Conversation

@LecrisUT
Copy link
Copy Markdown
Member

@LecrisUT LecrisUT commented Mar 18, 2026

It seems the only thing we need to do to enable this is to pull in this dependency and switch to using safe type by default. This would be a better apple-to-apple comparison with #4486 since that one uses a C library for handling json.

Note that the clib does not respect .indent formatting hints

Indenting using typ="safe"

The C based emitter doesn’t have the fine control, distinguishing between block mappings and sequences. Do only use the pure Python versions of the dumper if you want to have that sort of control.

Reference:


Pull Request Checklist

  • implement the feature
  • include a release note

Related to #4406

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This PR enables ruamel.yaml.clib by default by adding it as a dependency and setting the default YAML type to 'safe'. A suggestion is provided for tmt/utils/__init__.py to improve conciseness. Add a release note for this performance improvement.

Comment thread tmt/utils/__init__.py Outdated
Comment thread pyproject.toml
@github-project-automation github-project-automation bot moved this to backlog in planning Mar 19, 2026
@LecrisUT LecrisUT moved this from backlog to review in planning Mar 19, 2026
@LecrisUT LecrisUT added ci | full test Pull request is ready for the full test execution review | trivial Very easy for review, even for beginners, so don't be afraid to have a look! :-) labels Mar 19, 2026
@LecrisUT
Copy link
Copy Markdown
Member Author

/packit test

Comment thread tmt/utils/__init__.py Outdated
fpokryvk added a commit to NetworkManager/NetworkManager-ci that referenced this pull request Mar 26, 2026
Assisted-by: Claude Opus 4.6
fpokryvk added a commit to NetworkManager/NetworkManager-ci that referenced this pull request Mar 26, 2026
Assisted-by: Claude Opus 4.6
fpokryvk added a commit to NetworkManager/NetworkManager-ci that referenced this pull request Mar 26, 2026
Assisted-by: Claude Opus 4.6
fpokryvk added a commit to NetworkManager/NetworkManager-ci that referenced this pull request Mar 26, 2026
Assisted-by: Claude Opus 4.6
@LecrisUT LecrisUT force-pushed the feat/yaml-clib branch 2 times, most recently from 91aa13c to 99b6d3f Compare March 30, 2026 08:46
@LecrisUT LecrisUT requested a review from 4N0body5 as a code owner March 30, 2026 08:46
@LecrisUT LecrisUT moved this from review to implement in planning Apr 8, 2026
@LecrisUT LecrisUT moved this from implement to review in planning Apr 9, 2026
@LecrisUT LecrisUT added the status | blocked The merging of PR is blocked on some other issue label Apr 9, 2026
@LecrisUT
Copy link
Copy Markdown
Member Author

LecrisUT commented Apr 9, 2026

Blocked by #4338

Comment thread tmt/base/core.py
@thrix thrix self-requested a review April 15, 2026 10:39
Signed-off-by: Cristian Le <git@lecris.dev>
Signed-off-by: Cristian Le <git@lecris.dev>
Signed-off-by: Cristian Le <git@lecris.dev>
Signed-off-by: Cristian Le <git@lecris.dev>
Signed-off-by: Cristian Le <git@lecris.dev>
Signed-off-by: Cristian Le <git@lecris.dev>
Comment thread tests/plan/export/test.sh
Comment thread pylock.toml
Comment thread pyproject.toml
Copy link
Copy Markdown
Member

@psss psss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just one question and one thought: There are a couple more places where tmt is storing modified fmf files to disk:

  • tmt link
  • tmt test id
  • tmt test export --nitrate
  • tmt test export --polarion

But seems all those cases are actually using the fmf context manager approach:

with tmt_object.node as data: 
    data["link"] = [link_data]

Would be good to fix on the fmf side as well. Filed here:

Comment thread tmt/utils/__init__.py
@psss psss requested a review from thrix April 15, 2026 12:13
Copy link
Copy Markdown
Contributor

@thrix thrix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thrix thrix moved this from review to merge in planning Apr 16, 2026
@happz happz merged commit 2defa5b into teemtee:main Apr 16, 2026
32 checks passed
@github-project-automation github-project-automation bot moved this from merge to done in planning Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci | full test Pull request is ready for the full test execution review | trivial Very easy for review, even for beginners, so don't be afraid to have a look! :-)

Projects

Status: done

Development

Successfully merging this pull request may close these issues.

5 participants