compose_format
compose_format copied to clipboard
ImportError: cannot import name 'RoundTripDumper' with image
I tried the image but it doesn't work. See following history (shell from host-system):
root@localhost: cat docker-compose.yml | docker run -i funkwerk/compose_format
Traceback (most recent call last):
File "/bin/compose_format", line 2, in <module>
from compose_format import ComposeFormat
File "/usr/lib/python3.5/site-packages/compose_format/__init__.py", line 1, in <module>
from ruamel.yaml import RoundTripDumper, RoundTripLoader, dump, load
ImportError: cannot import name 'RoundTripDumper'
root@localhost:/var/docker/source/main# docker --version
Docker version 19.03.2, build 6a30dfc
same.
added PR #12 to fix this.
for temp use - https://hub.docker.com/repository/docker/damasu/compose_format
I faced the same issue. Thanks @jessequinn for fixing!
it doesn't work with "include"
❯ cat compose-git-include.yml | docker run -i --platform linux/amd64 damasu/compose_format
Traceback (most recent call last):
File "/bin/compose_format", line 27, in <module>
formatted = formatter.format_string(data, strict=not args.non_strict)
File "/usr/lib/python3.8/site-packages/compose_format/__init__.py", line 83, in format_string
data = self.reorder(load(data, RoundTripLoader), strict=strict)
File "/usr/lib/python3.8/site-packages/compose_format/__init__.py", line 94, in reorder
while ComposeFormat.sorted_by_order(keys, order, strict) != keys:
File "/usr/lib/python3.8/site-packages/compose_format/__init__.py", line 144, in sorted_by_order
return sorted(keys, key=order_function)
File "/usr/lib/python3.8/site-packages/compose_format/__init__.py", line 138, in order_function
assert key in order, 'key: {0} not known'.format(key)
AssertionError: key: include not known