diff --git a/hyperglass/api/__init__.py b/hyperglass/api/__init__.py index 83acfb5..28d2d56 100644 --- a/hyperglass/api/__init__.py +++ b/hyperglass/api/__init__.py @@ -214,4 +214,6 @@ def start(): """Start the web server with Uvicorn ASGI.""" import uvicorn + # TODO: figure out workers issue + # uvicorn.run("hyperglass.api:app", **ASGI_PARAMS) # noqa: E800 uvicorn.run(app, **ASGI_PARAMS) diff --git a/hyperglass/api/events.py b/hyperglass/api/events.py index 21544ac..2ba3d82 100644 --- a/hyperglass/api/events.py +++ b/hyperglass/api/events.py @@ -10,6 +10,7 @@ from hyperglass.util import ( build_frontend, clear_redis_cache, ) +from hyperglass.constants import MIN_PYTHON_VERSION from hyperglass.exceptions import HyperglassError from hyperglass.configuration import ( URL_DEV, @@ -29,9 +30,10 @@ async def check_python_version(): """ try: python_version = check_python() - log.info(f"Python {python_version} detected") - except RuntimeError as r: - raise HyperglassError(str(r), level="danger") from None + required = ".".join(tuple(str(v) for v in MIN_PYTHON_VERSION)) + log.info(f"Python {python_version} detected ({required} required)") + except RuntimeError as e: + raise HyperglassError(str(e), level="danger") from None async def check_redis_instance(): diff --git a/hyperglass/util.py b/hyperglass/util.py index cc17f77..cdd01e2 100644 --- a/hyperglass/util.py +++ b/hyperglass/util.py @@ -69,12 +69,13 @@ def check_python(): {str} -- Python version """ import sys + import platform from hyperglass.constants import MIN_PYTHON_VERSION pretty_version = ".".join(tuple(str(v) for v in MIN_PYTHON_VERSION)) if sys.version_info < MIN_PYTHON_VERSION: raise RuntimeError(f"Python {pretty_version}+ is required.") - return pretty_version + return platform.python_version() async def build_ui(app_path): @@ -460,7 +461,7 @@ async def build_frontend( # noqa: C901 elif dev_mode and not force: log.debug("Running in developer mode, did not build new UI files") - migrate_static_assets() + migrate_static_assets(app_path) except Exception as e: raise RuntimeError(str(e))