fosslight-dependency 3.15.0__py3-none-any.whl → 3.15.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- fosslight_dependency/_help.py +1 -0
- fosslight_dependency/run_dependency_scanner.py +22 -8
- {fosslight_dependency-3.15.0.dist-info → fosslight_dependency-3.15.1.dist-info}/METADATA +2 -2
- {fosslight_dependency-3.15.0.dist-info → fosslight_dependency-3.15.1.dist-info}/RECORD +11 -11
- {fosslight_dependency-3.15.0.dist-info → fosslight_dependency-3.15.1.dist-info}/Apache-2.0.txt +0 -0
- {fosslight_dependency-3.15.0.dist-info → fosslight_dependency-3.15.1.dist-info}/LICENSE +0 -0
- {fosslight_dependency-3.15.0.dist-info → fosslight_dependency-3.15.1.dist-info}/LicenseRef-3rd_party_licenses.txt +0 -0
- {fosslight_dependency-3.15.0.dist-info → fosslight_dependency-3.15.1.dist-info}/MIT.txt +0 -0
- {fosslight_dependency-3.15.0.dist-info → fosslight_dependency-3.15.1.dist-info}/WHEEL +0 -0
- {fosslight_dependency-3.15.0.dist-info → fosslight_dependency-3.15.1.dist-info}/entry_points.txt +0 -0
- {fosslight_dependency-3.15.0.dist-info → fosslight_dependency-3.15.1.dist-info}/top_level.txt +0 -0
fosslight_dependency/_help.py
CHANGED
@@ -32,6 +32,7 @@ _HELP_MESSAGE_DEPENDENCY = """
|
|
32
32
|
-m <package_manager>\t Enter the package manager.
|
33
33
|
\t(npm, maven, gradle, pip, pub, cocoapods, android, swift, carthage, go, nuget, helm)
|
34
34
|
-p <input_path>\t\t Enter the path where the script will be run.
|
35
|
+
-e <exclude_path>\t\t Enter the path where the analysis will not be performed.
|
35
36
|
-o <output_path>\t\t Output path
|
36
37
|
\t\t\t\t\t(If you want to generate the specific file name, add the output path with file name.)
|
37
38
|
-f <format>\t\t\t Output file format (excel, csv, opossum, yaml, spdx-tag, spdx-yaml, spdx-json, spdx-xml)
|
@@ -27,7 +27,7 @@ _PKG_NAME = "fosslight_dependency"
|
|
27
27
|
logger = logging.getLogger(constant.LOGGER_NAME)
|
28
28
|
warnings.filterwarnings("ignore", category=FutureWarning)
|
29
29
|
_sheet_name = "DEP_FL_Dependency"
|
30
|
-
EXTENDED_HEADER = {_sheet_name: ['ID', '
|
30
|
+
EXTENDED_HEADER = {_sheet_name: ['ID', 'Package URL', 'OSS Name',
|
31
31
|
'OSS Version', 'License', 'Download Location',
|
32
32
|
'Homepage', 'Copyright Text', 'Exclude',
|
33
33
|
'Comment', 'Depends On']}
|
@@ -37,7 +37,7 @@ CUSTOMIZED_FORMAT = {'excel': '.xlsx', 'csv': '.csv', 'opossum': '.json', 'yaml'
|
|
37
37
|
_exclude_dir = ['node_moduels', 'venv']
|
38
38
|
|
39
39
|
|
40
|
-
def find_package_manager(input_dir):
|
40
|
+
def find_package_manager(input_dir, abs_path_to_exclude=[]):
|
41
41
|
ret = True
|
42
42
|
manifest_file_name = []
|
43
43
|
for value in const.SUPPORT_PACKAE.values():
|
@@ -52,7 +52,14 @@ def find_package_manager(input_dir):
|
|
52
52
|
continue
|
53
53
|
if os.path.basename(parent) in _exclude_dir:
|
54
54
|
continue
|
55
|
+
if os.path.abspath(parent) in abs_path_to_exclude:
|
56
|
+
continue
|
55
57
|
for file in files:
|
58
|
+
file_path = os.path.join(parent, file)
|
59
|
+
file_abs_path = os.path.abspath(file_path)
|
60
|
+
if any(os.path.commonpath([file_abs_path, exclude_path]) == exclude_path
|
61
|
+
for exclude_path in abs_path_to_exclude):
|
62
|
+
continue
|
56
63
|
if file in manifest_file_name:
|
57
64
|
found_manifest_file.append(file)
|
58
65
|
if len(found_manifest_file) > 0:
|
@@ -83,8 +90,9 @@ def find_package_manager(input_dir):
|
|
83
90
|
return ret, found_package_manager, input_dir
|
84
91
|
|
85
92
|
|
86
|
-
def run_dependency_scanner(package_manager='', input_dir='', output_dir_file='', pip_activate_cmd='',
|
87
|
-
output_custom_dir='', app_name=const.default_app_name,
|
93
|
+
def run_dependency_scanner(package_manager='', input_dir='', output_dir_file='', pip_activate_cmd='',
|
94
|
+
pip_deactivate_cmd='', output_custom_dir='', app_name=const.default_app_name,
|
95
|
+
github_token='', format='', direct=True, path_to_exclude=[]):
|
88
96
|
global logger
|
89
97
|
|
90
98
|
ret = True
|
@@ -117,7 +125,8 @@ def run_dependency_scanner(package_manager='', input_dir='', output_dir_file='',
|
|
117
125
|
sys.exit(1)
|
118
126
|
|
119
127
|
logger, _result_log = init_log(os.path.join(output_path, "fosslight_log_dep_" + _start_time + ".txt"),
|
120
|
-
True, logging.INFO, logging.DEBUG, _PKG_NAME)
|
128
|
+
True, logging.INFO, logging.DEBUG, _PKG_NAME, "", path_to_exclude)
|
129
|
+
abs_path_to_exclude = [os.path.abspath(os.path.join(input_dir, path)) for path in path_to_exclude]
|
121
130
|
|
122
131
|
logger.info(f"Tool Info : {_result_log['Tool Info']}")
|
123
132
|
|
@@ -151,7 +160,7 @@ def run_dependency_scanner(package_manager='', input_dir='', output_dir_file='',
|
|
151
160
|
found_package_manager = {}
|
152
161
|
if autodetect:
|
153
162
|
try:
|
154
|
-
ret, found_package_manager, input_dir = find_package_manager(input_dir)
|
163
|
+
ret, found_package_manager, input_dir = find_package_manager(input_dir, abs_path_to_exclude)
|
155
164
|
os.chdir(input_dir)
|
156
165
|
except Exception as e:
|
157
166
|
logger.error(f'Fail to find package manager: {e}')
|
@@ -188,7 +197,8 @@ def run_dependency_scanner(package_manager='', input_dir='', output_dir_file='',
|
|
188
197
|
fail_pm.append(f"{pm} ({', '.join(manifest_file_name)})")
|
189
198
|
cover = CoverItem(tool_name=_PKG_NAME,
|
190
199
|
start_time=_start_time,
|
191
|
-
input_path=input_dir
|
200
|
+
input_path=input_dir,
|
201
|
+
exclude_path=path_to_exclude)
|
192
202
|
cover_comment_arr = []
|
193
203
|
if len(found_package_manager.keys()) > 0:
|
194
204
|
if len(success_pm) > 0:
|
@@ -231,6 +241,7 @@ def main():
|
|
231
241
|
package_manager = ''
|
232
242
|
input_dir = ''
|
233
243
|
output_dir = ''
|
244
|
+
path_to_exclude = []
|
234
245
|
pip_activate_cmd = ''
|
235
246
|
pip_deactivate_cmd = ''
|
236
247
|
output_custom_dir = ''
|
@@ -244,6 +255,7 @@ def main():
|
|
244
255
|
parser.add_argument('-v', '--version', action='store_true', required=False)
|
245
256
|
parser.add_argument('-m', '--manager', nargs=1, type=str, default='', required=False)
|
246
257
|
parser.add_argument('-p', '--path', nargs=1, type=str, required=False)
|
258
|
+
parser.add_argument('-e', '--exclude', nargs='*', required=False, default=[])
|
247
259
|
parser.add_argument('-o', '--output', nargs=1, type=str, required=False)
|
248
260
|
parser.add_argument('-a', '--activate', nargs=1, type=str, default='', required=False)
|
249
261
|
parser.add_argument('-d', '--deactivate', nargs=1, type=str, default='', required=False)
|
@@ -268,6 +280,8 @@ def main():
|
|
268
280
|
package_manager = ''.join(args.manager)
|
269
281
|
if args.path: # -p option
|
270
282
|
input_dir = ''.join(args.path)
|
283
|
+
if args.exclude: # -e option
|
284
|
+
path_to_exclude = args.exclude
|
271
285
|
if args.output: # -o option
|
272
286
|
output_dir = ''.join(args.output)
|
273
287
|
if args.activate: # -a option
|
@@ -301,7 +315,7 @@ def main():
|
|
301
315
|
sys.exit(0)
|
302
316
|
|
303
317
|
run_dependency_scanner(package_manager, input_dir, output_dir, pip_activate_cmd, pip_deactivate_cmd,
|
304
|
-
output_custom_dir, app_name, github_token, format, direct)
|
318
|
+
output_custom_dir, app_name, github_token, format, direct, path_to_exclude)
|
305
319
|
|
306
320
|
|
307
321
|
if __name__ == '__main__':
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: fosslight-dependency
|
3
|
-
Version: 3.15.
|
3
|
+
Version: 3.15.1
|
4
4
|
Summary: FOSSLight Dependency Scanner
|
5
5
|
Home-page: https://github.com/fosslight/fosslight_dependency_scanner
|
6
6
|
Author: LG Electronics
|
@@ -20,7 +20,7 @@ Requires-Dist: lxml
|
|
20
20
|
Requires-Dist: virtualenv
|
21
21
|
Requires-Dist: pyyaml
|
22
22
|
Requires-Dist: lastversion
|
23
|
-
Requires-Dist: fosslight-util >=1.4.
|
23
|
+
Requires-Dist: fosslight-util >=1.4.43
|
24
24
|
Requires-Dist: PyGithub
|
25
25
|
Requires-Dist: requirements-parser
|
26
26
|
Requires-Dist: defusedxml
|
@@ -1,9 +1,9 @@
|
|
1
1
|
fosslight_dependency/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
2
|
fosslight_dependency/_analyze_dependency.py,sha256=f66gNPSluuDqx0e_7iyIuoSC_HNjpSitL_e1lak6kEA,3872
|
3
|
-
fosslight_dependency/_help.py,sha256=
|
3
|
+
fosslight_dependency/_help.py,sha256=1hZd0C8vpePA9J9gHTYt2jS9Mi4gRaknmY7HJDzU0IM,2824
|
4
4
|
fosslight_dependency/_package_manager.py,sha256=pVwD9KVYgJygPMDUqh2SckOEjFOZ4T0wAx5_hhHHQYY,17094
|
5
5
|
fosslight_dependency/constant.py,sha256=1mJGu1SYyxVKo0W_pCIt-ANp52E_I5ovXFvpl2OMmjU,1039
|
6
|
-
fosslight_dependency/run_dependency_scanner.py,sha256=
|
6
|
+
fosslight_dependency/run_dependency_scanner.py,sha256=QqF6nFZg_pyEJAM_nq--Y6OjXHxdfuaY__Xs886Ldug,13624
|
7
7
|
fosslight_dependency/LICENSES/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
8
8
|
fosslight_dependency/LICENSES/LicenseRef-3rd_party_licenses.txt,sha256=EcsFt7aE1rp3OXAdJgmXayfOZdpRdBMcmRnyoqWMCsw,95687
|
9
9
|
fosslight_dependency/package_manager/Android.py,sha256=JJZUYjefb3BZBk6ai-A3TMN8NZ4ydMfYAKq6k1BElsQ,3155
|
@@ -23,12 +23,12 @@ fosslight_dependency/package_manager/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeu
|
|
23
23
|
fosslight_dependency/third_party/askalono/askalono.exe,sha256=NyngElHbrg3zLFRVwn6fPDZE_EDAEb1N8tiwWoCm4pQ,4743680
|
24
24
|
fosslight_dependency/third_party/askalono/askalono_macos,sha256=cYSNXhAQpkdd8lkgnY5skNeDmU_8DIuP84eFi0OXKkE,5589868
|
25
25
|
fosslight_dependency/third_party/nomos/nomossa,sha256=oFF9I-fhug6AVNyFnWeVXwDRin6NWSvk1g7mHBotB3Q,866408
|
26
|
-
fosslight_dependency-3.15.
|
27
|
-
fosslight_dependency-3.15.
|
28
|
-
fosslight_dependency-3.15.
|
29
|
-
fosslight_dependency-3.15.
|
30
|
-
fosslight_dependency-3.15.
|
31
|
-
fosslight_dependency-3.15.
|
32
|
-
fosslight_dependency-3.15.
|
33
|
-
fosslight_dependency-3.15.
|
34
|
-
fosslight_dependency-3.15.
|
26
|
+
fosslight_dependency-3.15.1.dist-info/Apache-2.0.txt,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
27
|
+
fosslight_dependency-3.15.1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
28
|
+
fosslight_dependency-3.15.1.dist-info/LicenseRef-3rd_party_licenses.txt,sha256=EcsFt7aE1rp3OXAdJgmXayfOZdpRdBMcmRnyoqWMCsw,95687
|
29
|
+
fosslight_dependency-3.15.1.dist-info/METADATA,sha256=TR5EyhsgzjbcFRu6ACWFdrJiE1vVYXRr25_KE_yTc6Y,4799
|
30
|
+
fosslight_dependency-3.15.1.dist-info/MIT.txt,sha256=9cx4CbArgByWvkoEZNqpzbpJgA9TUe2D62rMocQpgfs,1082
|
31
|
+
fosslight_dependency-3.15.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
32
|
+
fosslight_dependency-3.15.1.dist-info/entry_points.txt,sha256=e1QZbnCrQvfbwe9L6PxXnkRZMhl-PSo0QyUes0dGjU8,91
|
33
|
+
fosslight_dependency-3.15.1.dist-info/top_level.txt,sha256=Jc0V7VcVCH0TEM8ksb8dwroTYz4AmRaQnlr3FB71Hcs,21
|
34
|
+
fosslight_dependency-3.15.1.dist-info/RECORD,,
|
{fosslight_dependency-3.15.0.dist-info → fosslight_dependency-3.15.1.dist-info}/Apache-2.0.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{fosslight_dependency-3.15.0.dist-info → fosslight_dependency-3.15.1.dist-info}/entry_points.txt
RENAMED
File without changes
|
{fosslight_dependency-3.15.0.dist-info → fosslight_dependency-3.15.1.dist-info}/top_level.txt
RENAMED
File without changes
|