lucc / khard

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

Khard fails with newest python-configobj (without shim) #284

Closed protist closed 3 years ago

protist commented 3 years ago

When installing the latest version of python-configobj based on master, khard fails.

$ khard
Traceback (most recent call last):
  File "/usr/bin/khard", line 33, in <module>
    sys.exit(load_entry_point('khard==0.17.0', 'console_scripts', 'khard')())
  File "/usr/bin/khard", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/lib/python3.9/importlib/metadata.py", line 77, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/usr/lib/python3.9/site-packages/khard/khard.py", line 21, in <module>
    from . import cli
  File "/usr/lib/python3.9/site-packages/khard/cli.py", line 10, in <module>
    from .config import Config, ConfigError
  File "/usr/lib/python3.9/site-packages/khard/config.py", line 12, in <module>
    import validate
ModuleNotFoundError: No module named 'validate'

Apparently, this is because the python-configobj compatibility shim was not packaged in Arch Linux. However, it looks like this shim will not be shipped soon anyway, so khard should update for the newer version of configobj, for example as per terminator.

polyzen commented 3 years ago

A fix has been applied to the Arch package: https://github.com/archlinux/svntogit-community/commit/6b5a0ce3652d48422f1902c7a9a855e2409228a2

lucc commented 3 years ago

@protist what do you mean by "it looks like this shim will not be shipped soon anyway"? To me this line looks like it will be shipped.

I will merge a fix next, but sorry first I have to rant ;)

\

I am confused why the responsibility to support an unreleased version of configbj is pushed onto this project where the upstream configobj devs provided a clean migration solution (just package the shim). I consider it the responsibility of the Arch packager to ensure compatibility when they provide -git packages (as a last resort you could push the responsibility on the user by declaring version incompatibility in your PKGBUILD).

The thing @polyzen linked is what I consider to be the "right way", but it might be more scale-able for Arch to package the shim than patching every package that depends on configobj.

\

That said I will still merge the proposed fix into develop as it is very small and will be necessary in the future anyway.

lucc commented 3 years ago

Should be fixed by #283.

polyzen commented 3 years ago

They bumped to a later version to fix something and inadvertently caused this ^^. Someone's already provided a patch, so the shim will probably be included, but may take some time with the holidays.

protist commented 3 years ago

@lucc Thank you for the quick fix! Yes, I agree that the Arch packager made a mistake, which seems inadvertent.

what do you mean by "it looks like this shim will not be shipped soon anyway"? To me this line looks like it will be shipped.

I was referring to the comment to the commit I linked above, but maybe I misunderstood:

the shim should probably released one final time as 'validate' to PyPI

I thought this was the last time the shim would be shipped. (But yes, the Arch packager obviously didn't include it in this version.) Like you said, khard would need to be modified at some point in the future.