Is aiologger dependency optional?
If you run pip install heist
on Ubuntu 20.04 and then run heist
, you'll get this crash from the pop_config
module:
Failed to load python module usr.local.lib.python3.8.dist-packages.pop_config.log.async at path /usr/local/lib/python3.8/dist-packages/pop_config/log/async.py: NameError("name 'aiologger' is not defined")
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/pop/loader.py", line 147, in python
return sfl.load_module()
File "<frozen importlib._bootstrap_external>", line 522, in _check_name_wrapper
File "<frozen importlib._bootstrap_external>", line 1027, in load_module
File "<frozen importlib._bootstrap_external>", line 852, in load_module
File "<frozen importlib._bootstrap>", line 265, in _load_module_shim
File "<frozen importlib._bootstrap>", line 702, in _load
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 848, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/usr/local/lib/python3.8/dist-packages/pop_config/log/async.py", line 62, in <module>
def _get_logger(hub, name: str = "") -> aiologger.Logger:
NameError: name 'aiologger' is not defined
This happens because the aiologger
import is optional, but the typing is not. Reproduced on pop-config-7.0.2
The second problem is that this issue is not detected by unit-tests (they are all green).
P.S. The newlines in this module source code are windows-style, which adds annoying trailing ^M
symbols in some editors on Linux.