-
Notifications
You must be signed in to change notification settings - Fork 64
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
ruamel.yaml 0.18 hard deprecated old PyYAML functions including load, safe_load, etc (scan, parse, compose, load, emit, serialize, dump and their variants _all, safe_, round_trip_, etc) #668
Comments
Looks like master is already pinned to ruamel.yaml < 0.18 "so that dependencies can be consumed from versions from the Ubuntu distribution wherever possible.". So, for now, we just need to make the same change in the 2.8 branch. |
ruamel.yaml 0.18 hard deprecated the old PyYAML functions removing yaml.safe_load among many others. This causes charm-build to exit sometimes without a visible error. Fixes: juju#668 Reference: https://pypi.org/project/ruamel.yaml/0.18.0/
For some reason I can't figure out, the warnings.warn() that the ruamel library calls before running sys.exit(1) is not logged by charm-build. So this error is entirely not obvious, I could only figure it out by adding "python -m trace --trace" to the charm-build invocation. That will make it hard for impacted charms to debug this issue (which is a lot of openstack stable charms). They all pin charm-tools to specific 2.8.x versions so even once we commit a fix people are likely to be confused by the lack of error in th elog. logging.captureWarnings(True) is run before the config code runs and if I add a call to warnings.warn from inside build/config.py right before the yaml call, it's logged, but once it calls into the ruamel library it is not. I must be missing something to do with scoping or when/the order the code is loaded here. However I think sys.exit(1) is not really ideal behaviour for a library, so I filed an upstream bug to ask them to consider something that may be more obvious if warnings are disabled such as raising an exception or simply removing the function definition (which would then raise an exception): |
Fixed by #669 and the subsequent release of 2.8.8 |
Switch to using the latest charm-tools <3.0.0 to fix two build errors: - An error related to 'pytz' fixed in charm-tools 2.8.6: juju/charm-tools#654 - An error related to ruamel.yaml fixed in charm-tools 2.8.8: here: juju/charm-tools#668 Additionally merge bindep.txt to install libpq-dev required for psycopg2-binary as wheels no longer exist for py36. Change-Id: Idc16b84dc3dcdf001c73c7d2fdd57b1d08ebfb23
Switch to using the latest charm-tools <3.0.0 to fix three build errors: - An error related to 'pytz' fixed in charm-tools 2.8.6: juju/charm-tools#654 - An error related to ruamel.yaml fixed in charm-tools 2.8.8: here: juju/charm-tools#668 - An error related to macaroonbakery fixed in charm-tools 2.8.9: juju/charm-tools#671 Additionally merge bindep.txt to install libpq-dev required for psycopg2-binary as wheels no longer exist for py36. Additional fix for ussuri only: - Switch bionic test bundles from vault 1.7/edge to 1.6/edge as the 1.7 channel no longer supports bionic. Change-Id: Idc16b84dc3dcdf001c73c7d2fdd57b1d08ebfb23
unpin charm-tools version as later version has fix for below discussion https: //github.com/juju/charm-tools/issues/668 Change-Id: Ibfd2718d94f2270a32f97d9c7d19cec8ee988b52
* Update charm-mysql-router from branch 'master' to 13b3d7a9bcdc3b51f6e28a3d4d1a81d5cfb572ce - Fixing charm-tools version unpin charm-tools version as later version has fix for below discussion https: //github.com/juju/charm-tools/issues/668 Change-Id: Ibfd2718d94f2270a32f97d9c7d19cec8ee988b52
My older stable charm builds using charm-tools 2.8.x broke today due to the release of ruamel.yaml 0.18
As noted here https://pypi.org/project/ruamel.yaml/
In the OpenStack charm builds particularly, the error doesn't actually surface for some reason. The charm-build process just exits with an error code but no message. I had to use python -m trace to find the code throwing the error.
We use safe_load in many places but the place it errors out for me in particular is from charmtools/build/config.py:57 BuildConfig.configure()
We'll likely need to pin to ruamel.yaml<0.18.0 in the short term, for both 2.8.x and master and work on supporting the newer version.
The text was updated successfully, but these errors were encountered: