Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dvc.yaml: ruamel.yaml 0.17.22 oddly splits long strings #9397

Closed
efiop opened this issue May 3, 2023 · 3 comments · Fixed by #9406
Closed

dvc.yaml: ruamel.yaml 0.17.22 oddly splits long strings #9397

efiop opened this issue May 3, 2023 · 3 comments · Fixed by #9406
Labels
testing Related to the tests and the testing infrastructure

Comments

@efiop
Copy link
Contributor

efiop commented May 3, 2023

ruamel.yaml 0.17.22:

stages:
  copy-first-line:
    cmd: python
      /private/var/folders/fn/lxr30v5j0jldz5zbsb0jx_pr0000gn/T/pytest-of-efiop/pytest-10/test_cmd_changes_other_orders_0/head.py  foo  bar  foobar
    deps:
    - bar
    - foo
    - foobar
    outs:
    - bar-1
    - foo-1
    - foobar-1

vs old:

stages:
  copy-first-line:
    cmd: python  /private/var/folders/fn/lxr30v5j0jldz5zbsb0jx_pr0000gn/T/pytest-of-efiop/pytest-12/test_cmd_changes_other_orders_0/head.py  foo  bar  foobar
    deps:
    - bar
    - foo
    - foobar
    outs:
    - bar-1
    - foo-1
    - foobar-1

Which is causing our CI to fail on tests/func/test_lockfile.py::test_cmd_changes_other_orders_are_preserved

efiop added a commit that referenced this issue May 3, 2023
Temporary workaround for #9397
@efiop efiop added the testing Related to the tests and the testing infrastructure label May 3, 2023
efiop added a commit that referenced this issue May 4, 2023
Temporary workaround for #9397
@pmrowla
Copy link
Contributor

pmrowla commented May 4, 2023

probably related to the change for https://sourceforge.net/p/ruamel-yaml/tickets/427/

ruamel has a hidden default width of 80, so it looks like it will force wrapping if the line has a string token > length 80 now. At least in our tests we probably need to explicitly set yaml.width = sys.maxsize to prevent any wrapping since we use string compares in the test asserts

@efiop
Copy link
Contributor Author

efiop commented May 5, 2023

@pmrowla Thanks for the research! 🙏 Very good suggestion!

Surprised by this lossy folding and the linked issue suggests that this might not be solved any time soon. I'll just adjust the test for now.

@efiop
Copy link
Contributor Author

efiop commented May 5, 2023

Just modified the test for now as it was pretty fragile anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing Related to the tests and the testing infrastructure
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants