Skip to content

Commit 864e187

Browse files
committed
Modify to run all mode on Windows
1 parent 3b1be8c commit 864e187

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

.github/workflows/publish-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
- os: windows-latest
6161
TARGET: windows
6262
CMD_BUILD: >
63-
pyinstaller --onefile cli.py -n cli --additional-hooks-dir=hooks --add-binary "LICENSE;LICENSES" --add-binary "LICENSES\LicenseRef-3rd_party_licenses.txt;LICENSES" &&
63+
pyinstaller --onefile cli.py -n cli --additional-hooks-dir=hooks --collect-data reuse --add-binary "LICENSE;LICENSES" --add-binary "LICENSES\LicenseRef-3rd_party_licenses.txt;LICENSES" &&
6464
move dist/cli.exe fosslight_prechecker_windows.exe
6565
OUT_FILE_NAME: fosslight_prechecker_windows.exe
6666
ASSET_MIME: application/vnd.microsoft.portable-executable

.github/workflows/pull-request.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ jobs:
4545
ASSET_MIME: application/octet-stream
4646
- os: windows-latest
4747
TARGET: windows
48-
CMD_BUILD: >
49-
pyinstaller --onefile cli.py -n cli --additional-hooks-dir=hooks &&
48+
CMD_BUILD: |
49+
tox -e windows
50+
pyinstaller --onefile cli.py -n cli --additional-hooks-dir=hooks --collect-data reuse &&
5051
move dist/cli.exe fosslight_prechecker_windows.exe &&
5152
./fosslight_prechecker_windows.exe
52-
tox -e windows
5353
OUT_FILE_NAME: fosslight_prechecker_windows.exe
5454
ASSET_MIME: application/vnd.microsoft.portable-executable
5555
steps:

cli.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
# -*- coding: utf-8 -*-
33
# Copyright (c) 2020 LG Electronics Inc.
44
# SPDX-License-Identifier: GPL-3.0-only
5-
from fosslight_oss_pkg._convert import convert_report
5+
import multiprocessing
6+
from fosslight_prechecker.cli import main
67

78
if __name__ == '__main__':
8-
convert_report("", "", "")
9+
multiprocessing.freeze_support()
10+
main()

src/fosslight_prechecker/_precheck.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,10 @@ def find_oss_pkg_info_and_exlcude_file(path, mode='lint'):
119119
elif _turn_on_exclude_config and file.startswith('.'):
120120
DEFAULT_EXCLUDE_EXTENSION_FILES.append(file_rel_path)
121121
elif is_binary(file_abs_path):
122-
if is_windows:
123-
file_rel_path = file_rel_path.replace(os.sep, '/')
124122
DEFAULT_EXCLUDE_EXTENSION_FILES.append(file_rel_path)
125123
else:
126124
extension = file_lower_case.split(".")[-1]
127125
if extension in DEFAULT_EXCLUDE_EXTENSION:
128-
if is_windows:
129-
file_rel_path = file_rel_path.replace(os.sep, '/')
130126
DEFAULT_EXCLUDE_EXTENSION_FILES.append(file_rel_path)
131127
except Exception as ex:
132128
dump_error_msg(f"Error_FIND_OSS_PKG : {ex}")
@@ -159,6 +155,10 @@ def create_reuse_dep5_file(path):
159155

160156
DEFAULT_EXCLUDE_EXTENSION_FILES.extend(_DEFAULT_EXCLUDE_FOLDERS)
161157
exclude_file_list = list(set(DEFAULT_EXCLUDE_EXTENSION_FILES))
158+
159+
if is_windows:
160+
exclude_file_list = [file.replace(os.sep, '/') for file in exclude_file_list]
161+
162162
for file_to_exclude in exclude_file_list:
163163
str_contents += f"\nFiles: {file_to_exclude} \nCopyright: -\nLicense: -\n"
164164

0 commit comments

Comments
 (0)