diff --git a/locust/main.py b/locust/main.py index fc97d9d84c..b04df04b07 100644 --- a/locust/main.py +++ b/locust/main.py @@ -5,6 +5,7 @@ import atexit import errno import gc +import importlib.metadata import inspect import json import logging @@ -44,7 +45,10 @@ raise try: import locust_cloud # pyright: ignore[reportMissingImports] + + locust_cloud_version = f" (locust-cloud {importlib.metadata.version('locust-cloud')})" except ModuleNotFoundError as e: + locust_cloud_version = "" if e.msg != "No module named 'locust_cloud'": raise @@ -200,7 +204,8 @@ def is_valid_percentile(parameter): children = [] logger = logging.getLogger(__name__) - logger.info(f"Starting Locust {version}") + + logger.info(f"Starting Locust {version}{locust_cloud_version}") if options.processes: if os.name == "nt":