diff --git a/pyproject.toml b/pyproject.toml index 5b48a1f..1257f95 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,7 @@ voxvera = ["templates/**", "src/**", "resources/**", "locales/**", "resources/bi [project] name = "voxvera" -version = "0.2.14" +version = "0.2.15" description = "VoxVera CLI utilities" readme = "README.md" authors = [{name = "VoxVera"}] diff --git a/voxvera/__init__.py b/voxvera/__init__.py index 3199214..fc38696 100644 --- a/voxvera/__init__.py +++ b/voxvera/__init__.py @@ -1,16 +1,12 @@ import sys from pathlib import Path -__version__ = "0.2.13" +__version__ = "0.2.15" -# Add the vendor directory to sys.path. We prepend it to ensure our bundled -# dependencies take priority over potentially incompatible system packages -# (e.g. Flask/Werkzeug version mismatches on Debian). +# Add the vendor directory to sys.path ONLY for PyInstaller (frozen) builds. +# For pip/pipx installs the system/venv packages are correct and the vendored +# copies are incomplete (missing data files), so we must not shadow them. if getattr(sys, 'frozen', False): vendor_dir = Path(sys._MEIPASS).joinpath("voxvera", "vendor") -else: - vendor_dir = Path(__file__).parent / "vendor" - -if vendor_dir.exists(): - if str(vendor_dir) not in sys.path: + if vendor_dir.exists() and str(vendor_dir) not in sys.path: sys.path.insert(0, str(vendor_dir)) diff --git a/voxvera/cli.py b/voxvera/cli.py index 657dc73..538e7e3 100644 --- a/voxvera/cli.py +++ b/voxvera/cli.py @@ -11,15 +11,18 @@ from pathlib import Path from importlib import resources from importlib.resources.abc import Traversable -# Force PyInstaller to bundle these critical dependencies for onionshare-cli -try: - import pkg_resources - import setuptools - import jaraco - import platformdirs - import packaging -except ImportError: - pass +# Force PyInstaller to bundle these critical dependencies for onionshare-cli. +# Only needed at freeze-time analysis; skip for normal pip/pipx installs to +# avoid pulling in vendored copies that may be incomplete. +if getattr(sys, 'frozen', False): + try: + import pkg_resources + import setuptools + import jaraco + import platformdirs + import packaging + except Exception: + pass from InquirerPy import prompt, inquirer from rich.console import Console