From 50139035195d5d4abf36f66570884c3f04c546a4 Mon Sep 17 00:00:00 2001 From: jalew188 Date: Tue, 26 Dec 2023 20:02:42 +0100 Subject: [PATCH] FIX installer --- release/pyinstaller/alphaviz.spec | 9 +++++++++ setup.py | 5 +---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/release/pyinstaller/alphaviz.spec b/release/pyinstaller/alphaviz.spec index 2a46b6a..f3b19f7 100644 --- a/release/pyinstaller/alphaviz.spec +++ b/release/pyinstaller/alphaviz.spec @@ -9,6 +9,9 @@ import pkg_resources import importlib.metadata import alphaviz +from PyInstaller.utils.hooks import copy_metadata +from transformers.dependency_versions_check import pkgs_to_check_at_runtime + ##################### User definitions exe_name = 'alphaviz_gui' @@ -88,6 +91,12 @@ datas = [d for d in datas if ("__pycache__" not in d[0]) and (d[1] not in [".", # if not os.path.exists(libssl_dll_path): # datas.append((libssl_lib_path, ".")) +for _pkg in ["python","accelerate"]: + if _pkg in pkgs_to_check_at_runtime: + pkgs_to_check_at_runtime.remove(_pkg) +for _pkg in pkgs_to_check_at_runtime: + datas += copy_metadata(_pkg) + a = Analysis( [script_name], pathex=[location], diff --git a/setup.py b/setup.py index b247616..f43c4b4 100644 --- a/setup.py +++ b/setup.py @@ -62,10 +62,7 @@ def create_pip_wheel(): entry_points={ "console_scripts": package2install.__console_scripts__, }, - install_requires=requirements + [ - # TODO Remove hardcoded requirement? - "pywin32==225; sys_platform=='win32'" - ], + install_requires=requirements, extras_require=extra_requirements, python_requires=package2install.__python_version__, )