juju / charm-helpers

Apache License 2.0
18 stars 127 forks source link

Use looseversion in place of distutils #888

Closed hloeung closed 2 months ago

hloeung commented 4 months ago

Fixes https://github.com/juju/charm-helpers/issues/701:

Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.12/importlib/__init__.py:90: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/unit/test_content_cache.py:25: in <module>
    from reactive import content_cache  # NOQA: E402
reactive/content_cache.py:13: in <module>
    from charms import reactive
.tox/unit/lib/python3.12/site-packages/charms/reactive/__init__.py:20: in <module>
    from .flags import *  # noqa
.tox/unit/lib/python3.12/site-packages/charms/reactive/flags.py:2: in <module>
    from charmhelpers.core import hookenv
.tox/unit/lib/python3.12/site-packages/charmhelpers/core/hookenv.py:21: in <module>
    from distutils.version import LooseVersion
E   ModuleNotFoundError: No module named 'distutils'