From f402b66b403bad9b1e2cef97efe79a168234e237 Mon Sep 17 00:00:00 2001 From: Tobias Brox Date: Tue, 26 Dec 2023 20:27:34 +0100 Subject: [PATCH] With the recent integration of setuptools_scm, some extra build steps would be needed to get the library to work. This commit throws a warning rather than a ModuleNotFoundError --- caldav/__init__.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/caldav/__init__.py b/caldav/__init__.py index 74116ab7..c7312006 100644 --- a/caldav/__init__.py +++ b/caldav/__init__.py @@ -1,7 +1,15 @@ #!/usr/bin/env python import logging -from ._version import __version__ +try: + from ._version import __version__ +except ModuleNotFoundError: + __version__ = "(unknown)" + import warnings + + warnings.warn( + "You need to install the `build` package and do a `python -m build` to get caldav.__version__ set correctly" + ) from .davclient import DAVClient # Silence notification of no default logging handler