ucx icon indicating copy to clipboard operation
ucx copied to clipboard

[BUG] Raising a library not found when linting with try-except ImportError

Open JCZuurmond opened this issue 9 months ago • 0 comments

We raise a library-not-found when a library is imported within a try-except ImortError. We should extend the linter to cover the following scenario without raising a library-not-found

__all__ = ["__version__", "version_tuple"]

try:
    from ._version import version as __version__
    from ._version import version_tuple
except ImportError:  # pragma: no cover
    # broken installation, we don't even try
    # unknown only works because we do poor mans version compare
    __version__ = "unknown"
    version_tuple = (0, 0, "unknown")

Originally posted by @JCZuurmond in https://github.com/databrickslabs/ucx/pull/1662#discussion_r1598510691

JCZuurmond avatar May 16 '24 15:05 JCZuurmond