fix: make RPM runtime portable on Tumbleweed
This commit is contained in:
@@ -15,12 +15,17 @@ import sys
|
||||
from datetime import datetime, timezone
|
||||
from pathlib import Path
|
||||
|
||||
# Add the venv to path if running from the installed location
|
||||
# Package dependencies are vendored independently of the host Python minor
|
||||
# version. Keep the venv fallback for the legacy development install.
|
||||
VENV_DIR = Path("/opt/fenris")
|
||||
if VENV_DIR.exists():
|
||||
site_packages = next((VENV_DIR / "lib").glob("python*/site-packages"), None)
|
||||
if site_packages:
|
||||
sys.path.insert(0, str(site_packages))
|
||||
vendor_dir = VENV_DIR / "vendor"
|
||||
if vendor_dir.is_dir():
|
||||
sys.path.insert(0, str(vendor_dir))
|
||||
else:
|
||||
site_packages = next((VENV_DIR / "lib").glob("python*/site-packages"), None)
|
||||
if site_packages:
|
||||
sys.path.insert(0, str(site_packages))
|
||||
|
||||
from fenris.store import init_store, get_store_path
|
||||
from fenris.collector import run_collection
|
||||
|
||||
Reference in New Issue
Block a user