diff --git a/release/macos/build_backend_macos.sh b/release/macos/build_backend_macos.sh index 850cfd94..3dccbe42 100755 --- a/release/macos/build_backend_macos.sh +++ b/release/macos/build_backend_macos.sh @@ -1,9 +1,5 @@ # navigate to the root directory -# Creating the wheel -pip install git+https://github.com/huggingface/huggingface_hub.git -python -c "from huggingface_hub import get_full_repo_name; print('success')" - pip install build python -m build pip install "dist/alphadia-1.7.1-py3-none-any.whl[stable]" diff --git a/release/pyinstaller/alphadia.spec b/release/pyinstaller/alphadia.spec index b113775a..9bb248c6 100644 --- a/release/pyinstaller/alphadia.spec +++ b/release/pyinstaller/alphadia.spec @@ -24,55 +24,24 @@ remove_tests = True bundle_name = "AlphaDIA" ##################### -requirements = { - req.split()[0] for req in importlib.metadata.requires(project) -} -requirements.add(project) -requirements.add("distributed") -hidden_imports = {'transformers','huggingface_hub'} -datas = [] -binaries = [] -checked = set() -while requirements: - requirement = requirements.pop() - checked.add(requirement) - if requirement in ["pywin32"]: - continue - try: - module_version = importlib.metadata.version(requirement) - except ( - importlib.metadata.PackageNotFoundError, - ModuleNotFoundError, - ImportError - ): - continue - try: - datas_, binaries_, hidden_imports_ = PyInstaller.utils.hooks.collect_all( - requirement, - include_py_files=True - ) - except ImportError: - continue - datas += datas_ - # binaries += binaries_ - hidden_imports_ = set(hidden_imports_) - if "" in hidden_imports_: - hidden_imports_.remove("") - if None in hidden_imports_: - hidden_imports_.remove(None) - requirements |= hidden_imports_ - checked - hidden_imports |= hidden_imports_ +datas, binaries, hidden_imports = PyInstaller.utils.hooks.collect_all( + project, + include_py_files=True +) -if remove_tests: - hidden_imports = sorted( - [h for h in hidden_imports if "tests" not in h.split(".")] +alpha_x = ['alphabase', 'alpharaw','alphatims','peptdeep'] +for alpha_package in alpha_x: + _datas, _binaries, _hidden_imports = PyInstaller.utils.hooks.collect_all( + alpha_package, + include_py_files=True ) -else: - hidden_imports = sorted(hidden_imports) + datas+=_datas + binaries+=_binaries + hidden_imports+=_hidden_imports +hidden_imports = list(set(hidden_imports) & {'clr','rocket_fft','tokenizers'}) hidden_imports = [h for h in hidden_imports if "__pycache__" not in h] -hidden_imports += ['clr', 'alphabase', 'alpharaw','alphatims','rocket_fft'] datas = [d for d in datas if ("__pycache__" not in d[0]) and (d[1] not in [".", "Resources", "scripts"])] a = Analysis( diff --git a/release/windows/build_backend.ps1 b/release/windows/build_backend.ps1 index 023c19f4..41398103 100644 --- a/release/windows/build_backend.ps1 +++ b/release/windows/build_backend.ps1 @@ -1,9 +1,6 @@ Remove-Item -Recurse -Force -ErrorAction SilentlyContinue ./build Remove-Item -Recurse -Force -ErrorAction SilentlyContinue ./dist -pip install git+https://github.com/huggingface/huggingface_hub.git -python -c 'from huggingface_hub import get_full_repo_name; print("success")' - pip install build python -m build pip install "dist/alphadia-1.7.1-py3-none-any.whl[stable]"