diff --git a/.github/workflows/binaries.yml b/.github/workflows/binaries.yml index 1bedadd..0817443 100644 --- a/.github/workflows/binaries.yml +++ b/.github/workflows/binaries.yml @@ -34,6 +34,7 @@ jobs: - name: Install dependencies run: | + pip install --upgrade setuptools pkg_resources || pip install --upgrade setuptools pip install -r requirements.txt pip install . pip install pyinstaller pyinstaller-hooks-contrib @@ -49,6 +50,8 @@ jobs: run: | if [ "$RUNNER_OS" == "Windows" ]; then SEP=";"; else SEP=":"; fi pyinstaller --onefile \ + --collect-all pkg_resources \ + --collect-all setuptools \ --hidden-import pkg_resources \ --hidden-import setuptools \ --hidden-import jaraco.text \ diff --git a/pyproject.toml b/pyproject.toml index 3ecd497..5039176 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,7 @@ voxvera = ["templates/**", "src/**", "resources/**", "locales/**", "resources/bi [project] name = "voxvera" -version = "0.2.12" +version = "0.2.13" description = "VoxVera CLI utilities" readme = "README.md" authors = [{name = "VoxVera"}] diff --git a/test_cli_import.py b/test_cli_import.py new file mode 100644 index 0000000..8cdcc7e --- /dev/null +++ b/test_cli_import.py @@ -0,0 +1,12 @@ +import sys +import os + +try: + import pkg_resources + import setuptools + print("pkg_resources available") +except ImportError as e: + print(f"Failed to import: {e}") + +from voxvera import cli +cli._internal_onionshare() diff --git a/test_pkg2.py b/test_pkg2.py new file mode 100644 index 0000000..449563a --- /dev/null +++ b/test_pkg2.py @@ -0,0 +1,2 @@ +import pkg_resources +print("Success") diff --git a/voxvera/__init__.py b/voxvera/__init__.py index c3a3e69..3199214 100644 --- a/voxvera/__init__.py +++ b/voxvera/__init__.py @@ -1,7 +1,7 @@ import sys from pathlib import Path -__version__ = "0.2.12" +__version__ = "0.2.13" # Add the vendor directory to sys.path. We prepend it to ensure our bundled # dependencies take priority over potentially incompatible system packages diff --git a/voxvera/cli.py b/voxvera/cli.py index cfaffe3..657dc73 100644 --- a/voxvera/cli.py +++ b/voxvera/cli.py @@ -10,6 +10,17 @@ import time 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 + from InquirerPy import prompt, inquirer from rich.console import Console from voxvera import __version__