From efb16266707ab38ab95a3b45f2054be9c29f3009 Mon Sep 17 00:00:00 2001 From: Jaekwon Bang Date: Mon, 9 Mar 2026 13:58:09 +0900 Subject: [PATCH] Fix tox error --- cli.spec | 19 +++---------------- hooks/hook-fosslight_binary.py | 12 ++++++++++++ tox.ini | 1 + 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/cli.spec b/cli.spec index f1bdf83..dfc1886 100644 --- a/cli.spec +++ b/cli.spec @@ -3,23 +3,10 @@ a = Analysis( ['cli.py'], - pathex=['src'], # source package path for fosslight_binary + pathex=[], binaries=[], - datas=[ - # Use original repository location (no pre-install): third_party/dependency-check - ('third_party/dependency-check/bin', 'third_party/dependency-check/bin'), - ('third_party/dependency-check/lib', 'third_party/dependency-check/lib'), - ('third_party/dependency-check/licenses', 'third_party/dependency-check/licenses'), - ('third_party/dependency-check', 'third_party/dependency-check'), # txt/md root files - ('LICENSES', 'LICENSES'), - ('LICENSE', 'LICENSES'), - ], - hiddenimports=[ - 'pkg_resources.extern', - 'fosslight_binary.cli', - 'fosslight_binary._jar_analysis', - 'fosslight_binary._binary', - ], + datas=[], + hiddenimports=['pkg_resources.extern'], hookspath=['hooks'], hooksconfig={}, runtime_hooks=[], diff --git a/hooks/hook-fosslight_binary.py b/hooks/hook-fosslight_binary.py index 0df3859..8902433 100644 --- a/hooks/hook-fosslight_binary.py +++ b/hooks/hook-fosslight_binary.py @@ -6,3 +6,15 @@ from PyInstaller.utils.hooks import collect_all datas, binaries, hiddenimports = collect_all('fosslight_binary') + +# Collect data files from binaryornot package +datas_binaryornot, binaries_binaryornot, hiddenimports_binaryornot = collect_all('binaryornot') +datas += datas_binaryornot +binaries += binaries_binaryornot +hiddenimports += hiddenimports_binaryornot + +# Collect data files from chardet package (fixes mypyc module issues) +datas_chardet, binaries_chardet, hiddenimports_chardet = collect_all('chardet') +datas += datas_chardet +binaries += binaries_chardet +hiddenimports += hiddenimports_chardet diff --git a/tox.ini b/tox.ini index 1c4f0ca..2b082ca 100644 --- a/tox.ini +++ b/tox.ini @@ -22,6 +22,7 @@ ignore = E722, W503 [pytest] filterwarnings = ignore::DeprecationWarning +norecursedirs = third_party build dist .tox .git __pycache__ [testenv:test_run] deps =