Skip to content

Replace PyYAML with ruamel.yaml and use local koreo-core#31

Closed
ericlarssen wants to merge 1 commit intomainfrom
replace-pyyaml-with-ruamel
Closed

Replace PyYAML with ruamel.yaml and use local koreo-core#31
ericlarssen wants to merge 1 commit intomainfrom
replace-pyyaml-with-ruamel

Conversation

@ericlarssen
Copy link
Contributor

  • Replace PyYAML with ruamel.yaml for better YAML preservation
  • Update IndexingLoader to work with ruamel.yaml architecture
  • Switch to local koreo-core package instead of broken 0.1.11-13
  • Update cel-python to 0.3.0 to match koreo-core requirements
  • Fix imports and exports in indexing module
  • Remove local CRD_ROOT to use koreo-core's CRD files

- Replace PyYAML with ruamel.yaml for better YAML preservation
- Update IndexingLoader to work with ruamel.yaml architecture
- Switch to local koreo-core package instead of broken 0.1.11-13
- Update cel-python to 0.3.0 to match koreo-core requirements
- Fix imports and exports in indexing module
- Remove local CRD_ROOT to use koreo-core's CRD files
@ericlarssen ericlarssen force-pushed the replace-pyyaml-with-ruamel branch from bef15cd to 6d2d7f3 Compare June 11, 2025 15:41
"pyyaml==6.0.2",
"koreo-core==0.1.11",
"ruamel.yaml>=0.18.6",
"koreo-core @ file:///${PROJECT_ROOT}/../core",
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this line an accidental commit?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it requires the crds to be packaged, in core, so we will need to merge that first

Comment on lines 399 to 408
indent = (offset + 2) * " "
yaml = YAML()
yaml.preserve_quotes = True
yaml.width = 4096
stream = io.StringIO()
yaml.dump(spec_inputs, stream)
formated_inputs = f"\n{"\n".join(
f"{indent}{line}"
for line in yaml.dump(spec_inputs).splitlines()
for line in stream.getvalue().splitlines()
)}\n\n"
Copy link
Contributor

Choose a reason for hiding this comment

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

I think one of the benefits of ruamel is that it can handle this type of manipulation for you. Might be worth seeing if this can be better written to add the inputs to the inputs key.

Comment on lines 532 to 541
indent = (offset + 2) * " "
yaml = YAML()
yaml.preserve_quotes = True
yaml.width = 10000
stream = io.StringIO()
yaml.dump(new_value, stream)
formated = f"\n{"\n".join(
f"{indent}{line}"
for line in yaml.dump(new_value, width=10000).splitlines()
for line in stream.getvalue().splitlines()
)}\n\n"
Copy link
Contributor

Choose a reason for hiding this comment

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

This is doing the same stuff.

Comment on lines +18 to +19
# Use CRD_ROOT from koreo.schema instead of local path
# CRD_ROOT = pathlib.Path(__file__).parent.joinpath("crd")
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this no longer needed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants