I'm working on cloud-init with a view to adding support for the devuan distro (debian without systemd). I'm working on a local machine rather than a cloud provider, and I'm doing the development on devuan v4 (chimaera) based on debian 11 (bullseye) - so I can't run the commands ubuntu-bug or journalctl. The version of python 3 on devuan chimaera is 3.9.
When I run the tests, using tox, I get 140 failures from the lowest-supported-dev environment. I've identified that they're caused by two problems:
1) jinja2 tries to import soft_unicode() from the package markupsafe. This has been removed from recent versions of markupsafe, and this causes jinja2 to fail to initialise properly, resulting in errors like:
WARNING cloudinit.templater:templater.py:128 Jinja not available as the selected renderer for desired template, reverting to the basic renderer.
- but is apparently still unresolved. The recommended workaround is to use markupsafe 2.0.1, which was the last version to include soft_unicode(). This can be done by adding
markupsafe==2.0.1
to the deps in the [lowest-supported-deps] section of tox.ini, directly below jinja=2.10
2) In python 3.9, threading.Thread.isAlive has been removed:
I'm working on cloud-init with a view to adding support for the devuan distro (debian without systemd). I'm working on a local machine rather than a cloud provider, and I'm doing the development on devuan v4 (chimaera) based on debian 11 (bullseye) - so I can't run the commands ubuntu-bug or journalctl. The version of python 3 on devuan chimaera is 3.9.
When I run the tests, using tox, I get 140 failures from the lowest- supported- dev environment. I've identified that they're caused by two problems:
1) jinja2 tries to import soft_unicode() from the package markupsafe. This has been removed from recent versions of markupsafe, and this causes jinja2 to fail to initialise properly, resulting in errors like:
WARNING cloudinit. templater: templater. py:128 Jinja not available as the selected renderer for desired template, reverting to the basic renderer.
The problem has been flagged up in markupsafe:
https:/ /github. com/pallets/ markupsafe/ issues/ 304
- but is apparently still unresolved. The recommended workaround is to use markupsafe 2.0.1, which was the last version to include soft_unicode(). This can be done by adding
markupsafe==2.0.1
to the deps in the [lowest- supported- deps] section of tox.ini, directly below jinja=2.10
2) In python 3.9, threading. Thread. isAlive has been removed:
https:/ /github. com/spotify/ luigi/issues/ 2939
The recommendation is to use threading. Thread. is_alive instead.
This breaks httpretty 0.9.5. The earliest version of httpretty in which this is fixed is 0.9.7
Changing "httpretty==0.9.5" to "httpretty==0.9.7" in tox.ini works around this.
With these two changes to tox.ini in place, tox on cloud-init under devuan 4 runs without failures.