lucc / khard

Console vcard client
https://khard.readthedocs.io/en/latest/
GNU General Public License v3.0
595 stars 66 forks source link

Avoid circular imports #334

Open cjwatson opened 2 months ago

cjwatson commented 2 months ago

https://bugs.debian.org/1069838 reported a test failure due to circular imports. While I couldn't reproduce this locally, I could reproduce it in a VM provided by the bug reporter, and it seems straightforward enough to avoid the problem.

lucc commented 2 months ago

I am happy with the conditional typing import but the local import bothers me. I was under the impression that it is good python coding style to put all imports at the top. This breaks it.

I understand that we need to do a real import of the carddav_object module at some point because we really use it. But the motivation is not obvious if I read the code in isolation and any future developer who does not have your specific VM will not notice any problem if they change it again.

So the main question is: Is there really no way to reproduce this problem outside of your VM? Is there some environment that we can specify declarative to reproduce this?