Regression due to ruamel.yaml
See original GitHub issuePotentially dangerous regression in config box, due to the new ruamel.yaml
dependency.
>>> from box import ConfigBox
>>> b = ConfigBox.from_yaml("kill_all_humans_mode: no")
>>> if b.kill_all_humans_mode:
... print("ok, killing all humans...")
...
ok, killing all humans...
Same problem with box.Box
. Our test suite caught this, but others might not be so lucky. ruamel isn’t exactly a drop-in replacement for yaml, despite claims to the contrary (ruamel defaults to spec 1.2 and yaml is spec 1.1).
I would advise to make the toml
and ruamel.yaml
dependencies optional (or “soft” dependencies, like it was in 3.x) since users might prefer other providers such as pytoml
and PyYAML
and you don’t want to tie their hands here.
Personally, I can not use box>=4
at all because the ruamel.yaml
has an insane installer which, for various reasons, does not work in the prod environment at $EMPLOYER.
Issue Analytics
- State:
- Created 4 years ago
- Comments:15 (10 by maintainers)
Top Results From Across the Web
ruamel.yaml / Tickets / #390 Roundtripping regression
I have a test case which has been passing for quite some time but has broken with ruamel.yaml 0.17.10. This test case basically...
Read more >How can I dump changes corresponding to list using ruamel ...
If I make chnages on a list , ruamel.yaml is able to make changes on the local variable, but it does not dump/write...
Read more >Departure from previous API - ruamel.yaml - Read the Docs
With version 0.15.0 ruamel.yaml starts to depart from the previous (PyYAML) way of loading and dumping. During a transition period the original load()...
Read more >ruamel.yaml 0.15.71 - PyPI
ruamel.yaml is a YAML parser/emitter that supports roundtrip preservation of comments, seq/map flow style, and map key order.
Read more >lib_openshift ensure python-ruamel-yaml package is on target ...
Summary: [IntService_public_324] TASK [lib_openshift : lib_openshift ensure python-rua... Keywords: Regression.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
As an update to this, Box 5.0 will go back to being able to be pure python, and installing additional extras as requested. https://github.com/cdgriffith/Box/wiki/Installation
See https://setuptools.readthedocs.io/en/latest/setuptools.html#declaring-extras-optional-features-with-their-own-dependencies