ara
ara copied to clipboard
Fedora packaging: tzlocal too old for ara 1.6
What is the issue ?
There are various timezone-related fixes in ara 1.6.0 (from 1.5.8) that come with a bump of tzlocal from 2.x to 4.x: https://github.com/ansible-community/ara/commit/07e7cd153896a6ae2266f9ce47adedc7541f047b
However the version of tzlocal in Fedora is still 2.x: https://koji.fedoraproject.org/koji/packageinfo?packageID=19353
+ /usr/bin/python3 manage.py test ara
[ara] Server's LOGGING configuration has a 'root' logger which is deprecated after version 1.5.8 due to conflicts. Please update your settings.yaml or generate a new one by removing it from ara's configuration folder
Traceback (most recent call last):
File "/builddir/build/BUILD/ara-1.6.0.0rc1/manage.py", line 8, in <module>
main()
File "/builddir/build/BUILD/ara-1.6.0.0rc1/ara/server/__main__.py", line 27, in main
if not os.path.exists(settings.ARA_SETTINGS):
^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/django/conf/__init__.py", line 84, in __getattr__
self._setup(name)
File "/usr/lib/python3.11/site-packages/django/conf/__init__.py", line 71, in _setup
self._wrapped = Settings(settings_module)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/django/conf/__init__.py", line 179, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 940, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/builddir/build/BUILD/ara-1.6.0.0rc1/ara/server/settings.py", line 200, in <module>
LOCAL_TIME_ZONE = tzlocal.get_localzone_name()
^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'tzlocal' has no attribute 'get_localzone_name'. Did you mean: 'get_localzone'?
error: Bad exit status from /var/tmp/rpm-tmp.S24rGn (%check)
Bad exit status from /var/tmp/rpm-tmp.S24rGn (%check)
RPM build errors:
Finish: rpmbuild ara-1.6.0.0rc1-1.fc36.src.rpm
Finish: build phase for ara-1.6.0.0rc1-1.fc36.src.rpm
ERROR: Exception(/home/dmsimard/rpmbuild/SRPMS/ara-1.6.0.0rc1-1.fc36.src.rpm) Config(fedora-rawhide-x86_64) 0 minutes 57 seconds
INFO: Results and/or logs in: /var/lib/mock/fedora-rawhide-x86_64/result
What should be happening ?
It may take a while for the version of tzlocal to be bumped in Fedora, we could consider making our call to get the timezone temporarily support tzlocal 2.x and 4.x.
Seems that Ubuntu 22.04.1 LTS also ships with tzlocal
2.x series.
me@my-vm:~$ sudo apt search tzlocal
Sorting... Done
Full Text Search... Done
python3-tzlocal/jammy 2.1-1 all
tzinfo object for the local timezone
me@my-vm:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.1 LTS
Release: 22.04
Codename: jammy
imo best would be to only support pip installations to not get bothered with such problems. Afaik for Ansible best practice is to install from pip anyhow?
Hello there @ed7789, long time no see :)
I wasn't actually aware there was a package for ara on Ubuntu but it turns out there is one, probably inherited from the one in Debian:
- https://packages.ubuntu.com/jammy/python3-ara
- https://tracker.debian.org/pkg/python-ara
Both are unfortunately a bit out of date by now -- though this particular issue is about a tzlocal bump that occurred in ara 1.6.0 so tzlocal 2.x should still work with 1.5.7/1.5.8.
There was an issue with the debian packaging but I think that has been resolved but hasn't yet been picked up.
There's some nice stuff in ara 1.6.x, though, so you may want to try installing the latest version from PyPI if you can. There's different ways to do that, I can help point you in the right direction if you need guidance.
imo best would be to only support pip installations to not get bothered with such problems. Afaik for Ansible best practice is to install from pip anyhow?
There's nothing stopping Linux distributions and open source communities from packaging projects ¯\_ (ツ)_/¯ I do a half-poor job at maintaining a few myself and it's quite a thankless job :p
That doesn't mean we necessarily need to be on the hook for maintaining these packages but we shouldn't also make the lives of their maintainers complicated needlessly if we can help it.
We can recommend pip because we know that works and it's tested rigorously -- that's not mutually exclusive with the existence of distribution packages and doesn't mean we "officially" support them.
By the way, on the topic of the original issue, @gotmax23 is working on an update to the Fedora package (thank you!!).
Although rawhide has a recent enough version of tzlocal, this isn't the case for current/older versions of Fedora so the issue still stands.
As far as Fedora is concerned, this will be addressed with a patch included in the package: https://src.fedoraproject.org/rpms/ara/pull-request/32#_4
Hello there @ed7789, long time no see :)
I wasn't actually aware there was a package for ara on Ubuntu but it turns out there is one, probably inherited from the one in Debian [.,.]
I was not aware either. I was using the pip
installed version of ara.