fosslight-dependency 4.1.28__tar.gz → 4.1.29__tar.gz
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-4.1.28 → fosslight_dependency-4.1.29}/PKG-INFO +2 -2
- {fosslight_dependency-4.1.28 → fosslight_dependency-4.1.29}/requirements.txt +1 -1
- {fosslight_dependency-4.1.28 → fosslight_dependency-4.1.29}/setup.py +2 -2
- fosslight_dependency-4.1.29/src/fosslight_dependency/cli.py +127 -0
- {fosslight_dependency-4.1.28 → fosslight_dependency-4.1.29}/src/fosslight_dependency/run_dependency_scanner.py +31 -138
- {fosslight_dependency-4.1.28 → fosslight_dependency-4.1.29}/src/fosslight_dependency.egg-info/PKG-INFO +2 -2
- {fosslight_dependency-4.1.28 → fosslight_dependency-4.1.29}/src/fosslight_dependency.egg-info/SOURCES.txt +1 -0
- fosslight_dependency-4.1.29/src/fosslight_dependency.egg-info/entry_points.txt +2 -0
- {fosslight_dependency-4.1.28 → fosslight_dependency-4.1.29}/src/fosslight_dependency.egg-info/requires.txt +1 -1
- fosslight_dependency-4.1.28/src/fosslight_dependency.egg-info/entry_points.txt +0 -2
- {fosslight_dependency-4.1.28 → fosslight_dependency-4.1.29}/LICENSE +0 -0
- {fosslight_dependency-4.1.28 → fosslight_dependency-4.1.29}/LICENSES/Apache-2.0.txt +0 -0
- {fosslight_dependency-4.1.28 → fosslight_dependency-4.1.29}/LICENSES/LicenseRef-3rd_party_licenses.txt +0 -0
- {fosslight_dependency-4.1.28 → fosslight_dependency-4.1.29}/LICENSES/MIT.txt +0 -0
- {fosslight_dependency-4.1.28 → fosslight_dependency-4.1.29}/MANIFEST.in +0 -0
- {fosslight_dependency-4.1.28 → fosslight_dependency-4.1.29}/README.md +0 -0
- {fosslight_dependency-4.1.28 → fosslight_dependency-4.1.29}/setup.cfg +0 -0
- {fosslight_dependency-4.1.28 → fosslight_dependency-4.1.29}/src/fosslight_dependency/LICENSES/LICENSE +0 -0
- {fosslight_dependency-4.1.28 → fosslight_dependency-4.1.29}/src/fosslight_dependency/LICENSES/LicenseRef-3rd_party_licenses.txt +0 -0
- {fosslight_dependency-4.1.28 → fosslight_dependency-4.1.29}/src/fosslight_dependency/__init__.py +0 -0
- {fosslight_dependency-4.1.28 → fosslight_dependency-4.1.29}/src/fosslight_dependency/_analyze_dependency.py +0 -0
- {fosslight_dependency-4.1.28 → fosslight_dependency-4.1.29}/src/fosslight_dependency/_graph_convertor.py +0 -0
- {fosslight_dependency-4.1.28 → fosslight_dependency-4.1.29}/src/fosslight_dependency/_help.py +0 -0
- {fosslight_dependency-4.1.28 → fosslight_dependency-4.1.29}/src/fosslight_dependency/_package_manager.py +0 -0
- {fosslight_dependency-4.1.28 → fosslight_dependency-4.1.29}/src/fosslight_dependency/constant.py +0 -0
- {fosslight_dependency-4.1.28 → fosslight_dependency-4.1.29}/src/fosslight_dependency/dependency_item.py +0 -0
- {fosslight_dependency-4.1.28 → fosslight_dependency-4.1.29}/src/fosslight_dependency/package_manager/Android.py +0 -0
- {fosslight_dependency-4.1.28 → fosslight_dependency-4.1.29}/src/fosslight_dependency/package_manager/Cargo.py +0 -0
- {fosslight_dependency-4.1.28 → fosslight_dependency-4.1.29}/src/fosslight_dependency/package_manager/Carthage.py +0 -0
- {fosslight_dependency-4.1.28 → fosslight_dependency-4.1.29}/src/fosslight_dependency/package_manager/Cocoapods.py +0 -0
- {fosslight_dependency-4.1.28 → fosslight_dependency-4.1.29}/src/fosslight_dependency/package_manager/Go.py +0 -0
- {fosslight_dependency-4.1.28 → fosslight_dependency-4.1.29}/src/fosslight_dependency/package_manager/Gradle.py +0 -0
- {fosslight_dependency-4.1.28 → fosslight_dependency-4.1.29}/src/fosslight_dependency/package_manager/Helm.py +0 -0
- {fosslight_dependency-4.1.28 → fosslight_dependency-4.1.29}/src/fosslight_dependency/package_manager/Maven.py +0 -0
- {fosslight_dependency-4.1.28 → fosslight_dependency-4.1.29}/src/fosslight_dependency/package_manager/Npm.py +0 -0
- {fosslight_dependency-4.1.28 → fosslight_dependency-4.1.29}/src/fosslight_dependency/package_manager/Nuget.py +0 -0
- {fosslight_dependency-4.1.28 → fosslight_dependency-4.1.29}/src/fosslight_dependency/package_manager/Pnpm.py +0 -0
- {fosslight_dependency-4.1.28 → fosslight_dependency-4.1.29}/src/fosslight_dependency/package_manager/Pub.py +0 -0
- {fosslight_dependency-4.1.28 → fosslight_dependency-4.1.29}/src/fosslight_dependency/package_manager/Pypi.py +0 -0
- {fosslight_dependency-4.1.28 → fosslight_dependency-4.1.29}/src/fosslight_dependency/package_manager/Swift.py +0 -0
- {fosslight_dependency-4.1.28 → fosslight_dependency-4.1.29}/src/fosslight_dependency/package_manager/Unity.py +0 -0
- {fosslight_dependency-4.1.28 → fosslight_dependency-4.1.29}/src/fosslight_dependency/package_manager/Yarn.py +0 -0
- {fosslight_dependency-4.1.28 → fosslight_dependency-4.1.29}/src/fosslight_dependency/package_manager/__init__.py +0 -0
- {fosslight_dependency-4.1.28 → fosslight_dependency-4.1.29}/src/fosslight_dependency.egg-info/dependency_links.txt +0 -0
- {fosslight_dependency-4.1.28 → fosslight_dependency-4.1.29}/src/fosslight_dependency.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fosslight_dependency
|
|
3
|
-
Version: 4.1.
|
|
3
|
+
Version: 4.1.29
|
|
4
4
|
Summary: FOSSLight Dependency Scanner
|
|
5
5
|
Home-page: https://github.com/fosslight/fosslight_dependency_scanner
|
|
6
6
|
Download-URL: https://github.com/fosslight/fosslight_dependency_scanner
|
|
@@ -23,7 +23,7 @@ Requires-Dist: lxml
|
|
|
23
23
|
Requires-Dist: virtualenv
|
|
24
24
|
Requires-Dist: pyyaml
|
|
25
25
|
Requires-Dist: lastversion
|
|
26
|
-
Requires-Dist: fosslight_util>=2.1.
|
|
26
|
+
Requires-Dist: fosslight_util>=2.1.37
|
|
27
27
|
Requires-Dist: PyGithub
|
|
28
28
|
Requires-Dist: requirements-parser
|
|
29
29
|
Requires-Dist: defusedxml
|
|
@@ -35,7 +35,7 @@ if __name__ == "__main__":
|
|
|
35
35
|
|
|
36
36
|
setup(
|
|
37
37
|
name=_PACKAEG_NAME,
|
|
38
|
-
version='4.1.
|
|
38
|
+
version='4.1.29',
|
|
39
39
|
package_dir={"": "src"},
|
|
40
40
|
packages=find_namespace_packages(where='src'),
|
|
41
41
|
description='FOSSLight Dependency Scanner',
|
|
@@ -56,7 +56,7 @@ if __name__ == "__main__":
|
|
|
56
56
|
include_package_data=True,
|
|
57
57
|
entry_points={
|
|
58
58
|
"console_scripts": [
|
|
59
|
-
"fosslight_dependency = fosslight_dependency.
|
|
59
|
+
"fosslight_dependency = fosslight_dependency.cli:main"
|
|
60
60
|
]
|
|
61
61
|
}
|
|
62
62
|
)
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
# Copyright (c) 2020 LG Electronics Inc.
|
|
4
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
|
|
6
|
+
import os
|
|
7
|
+
import sys
|
|
8
|
+
import argparse
|
|
9
|
+
import shutil
|
|
10
|
+
import fosslight_dependency.constant as const
|
|
11
|
+
from fosslight_dependency._help import print_version, print_help_msg
|
|
12
|
+
from fosslight_dependency.run_dependency_scanner import run_dependency_scanner, _PKG_NAME
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def get_terminal_size():
|
|
16
|
+
size = shutil.get_terminal_size()
|
|
17
|
+
return size.lines
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def paginate_file(file_path):
|
|
21
|
+
lines_per_page = get_terminal_size() - 1
|
|
22
|
+
with open(file_path, 'r', encoding='utf8') as file:
|
|
23
|
+
lines = file.readlines()
|
|
24
|
+
|
|
25
|
+
for i in range(0, len(lines), lines_per_page):
|
|
26
|
+
os.system('clear' if os.name == 'posix' else 'cls')
|
|
27
|
+
print(''.join(lines[i: i + lines_per_page]))
|
|
28
|
+
if i + lines_per_page < len(lines):
|
|
29
|
+
input("Press Enter to see the next page...")
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def main():
|
|
33
|
+
package_manager = ''
|
|
34
|
+
input_dir = ''
|
|
35
|
+
output_dir = ''
|
|
36
|
+
path_to_exclude = []
|
|
37
|
+
pip_activate_cmd = ''
|
|
38
|
+
pip_deactivate_cmd = ''
|
|
39
|
+
output_custom_dir = ''
|
|
40
|
+
app_name = const.default_app_name
|
|
41
|
+
github_token = ''
|
|
42
|
+
format = []
|
|
43
|
+
graph_path = ''
|
|
44
|
+
graph_size = (600, 600)
|
|
45
|
+
direct = True
|
|
46
|
+
recursive = False
|
|
47
|
+
|
|
48
|
+
parser = argparse.ArgumentParser(add_help=False)
|
|
49
|
+
parser.add_argument('-h', '--help', action='store_true', required=False)
|
|
50
|
+
parser.add_argument('-v', '--version', action='store_true', required=False)
|
|
51
|
+
parser.add_argument('-m', '--manager', nargs=1, type=str, default='', required=False)
|
|
52
|
+
parser.add_argument('-p', '--path', nargs=1, type=str, required=False)
|
|
53
|
+
parser.add_argument('-e', '--exclude', nargs='*', required=False, default=[])
|
|
54
|
+
parser.add_argument('-o', '--output', nargs=1, type=str, required=False)
|
|
55
|
+
parser.add_argument('-a', '--activate', nargs=1, type=str, default='', required=False)
|
|
56
|
+
parser.add_argument('-d', '--deactivate', nargs=1, type=str, default='', required=False)
|
|
57
|
+
parser.add_argument('-c', '--customized', nargs=1, type=str, required=False)
|
|
58
|
+
parser.add_argument('-n', '--appname', nargs=1, type=str, required=False)
|
|
59
|
+
parser.add_argument('-t', '--token', nargs=1, type=str, required=False)
|
|
60
|
+
parser.add_argument('-f', '--format', nargs="*", type=str, required=False)
|
|
61
|
+
parser.add_argument('--graph-path', nargs=1, type=str, required=False)
|
|
62
|
+
parser.add_argument('--graph-size', nargs=2, type=int, metavar=("WIDTH", "HEIGHT"), required=False)
|
|
63
|
+
parser.add_argument('--direct', choices=('true', 'false'), default='True', required=False)
|
|
64
|
+
parser.add_argument('--notice', action='store_true', required=False)
|
|
65
|
+
parser.add_argument('-r', '--recursive', action='store_true', required=False)
|
|
66
|
+
|
|
67
|
+
args = parser.parse_args()
|
|
68
|
+
|
|
69
|
+
if args.help: # -h option
|
|
70
|
+
print_help_msg()
|
|
71
|
+
|
|
72
|
+
if args.version: # -v option
|
|
73
|
+
print_version(_PKG_NAME)
|
|
74
|
+
|
|
75
|
+
if args.manager: # -m option
|
|
76
|
+
package_manager = ''.join(args.manager)
|
|
77
|
+
if args.path: # -p option
|
|
78
|
+
input_dir = ''.join(args.path)
|
|
79
|
+
if args.exclude: # -e option
|
|
80
|
+
path_to_exclude = args.exclude
|
|
81
|
+
if args.output: # -o option
|
|
82
|
+
output_dir = ''.join(args.output)
|
|
83
|
+
if args.activate: # -a option
|
|
84
|
+
pip_activate_cmd = ''.join(args.activate)
|
|
85
|
+
if args.deactivate: # -d option
|
|
86
|
+
pip_deactivate_cmd = ''.join(args.deactivate)
|
|
87
|
+
if args.customized: # -c option
|
|
88
|
+
output_custom_dir = ''.join(args.customized)
|
|
89
|
+
if args.appname: # -n option
|
|
90
|
+
app_name = ''.join(args.appname)
|
|
91
|
+
if args.token: # -t option
|
|
92
|
+
github_token = ''.join(args.token)
|
|
93
|
+
if args.format: # -f option
|
|
94
|
+
format = list(args.format)
|
|
95
|
+
if args.graph_path:
|
|
96
|
+
graph_path = ''.join(args.graph_path)
|
|
97
|
+
if args.graph_size:
|
|
98
|
+
graph_size = args.graph_size
|
|
99
|
+
if args.direct: # --direct option
|
|
100
|
+
if args.direct == 'true' or args.direct == 'True':
|
|
101
|
+
direct = True
|
|
102
|
+
elif args.direct == 'false' or args.direct == 'False':
|
|
103
|
+
direct = False
|
|
104
|
+
if args.notice: # --notice option
|
|
105
|
+
try:
|
|
106
|
+
base_path = sys._MEIPASS
|
|
107
|
+
except Exception:
|
|
108
|
+
base_path = os.path.dirname(__file__)
|
|
109
|
+
|
|
110
|
+
data_path = os.path.join(base_path, 'LICENSES')
|
|
111
|
+
print(f"*** {_PKG_NAME} open source license notice ***")
|
|
112
|
+
for ff in os.listdir(data_path):
|
|
113
|
+
source_file = os.path.join(data_path, ff)
|
|
114
|
+
destination_file = os.path.join(base_path, ff)
|
|
115
|
+
paginate_file(source_file)
|
|
116
|
+
shutil.copyfile(source_file, destination_file)
|
|
117
|
+
sys.exit(0)
|
|
118
|
+
if args.recursive: # -r option
|
|
119
|
+
recursive = True
|
|
120
|
+
|
|
121
|
+
run_dependency_scanner(package_manager, input_dir, output_dir, pip_activate_cmd, pip_deactivate_cmd,
|
|
122
|
+
output_custom_dir, app_name, github_token, format, direct, path_to_exclude,
|
|
123
|
+
graph_path, graph_size, recursive)
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
if __name__ == '__main__':
|
|
127
|
+
main()
|
|
@@ -6,16 +6,13 @@
|
|
|
6
6
|
import os
|
|
7
7
|
import platform
|
|
8
8
|
import sys
|
|
9
|
-
import argparse
|
|
10
9
|
import warnings
|
|
11
10
|
from datetime import datetime
|
|
12
11
|
import logging
|
|
13
|
-
import shutil
|
|
14
12
|
import fosslight_dependency.constant as const
|
|
15
13
|
from collections import defaultdict
|
|
16
14
|
from fosslight_util.set_log import init_log
|
|
17
15
|
import fosslight_util.constant as constant
|
|
18
|
-
from fosslight_dependency._help import print_version, print_help_msg
|
|
19
16
|
from fosslight_dependency._analyze_dependency import analyze_dependency
|
|
20
17
|
from fosslight_util.output_format import check_output_formats_v2, write_output_file
|
|
21
18
|
from fosslight_util.oss_item import ScannerItem
|
|
@@ -31,27 +28,9 @@ EXTENDED_HEADER = {_sheet_name: ['ID', 'Package URL', 'OSS Name',
|
|
|
31
28
|
'OSS Version', 'License', 'Download Location',
|
|
32
29
|
'Homepage', 'Copyright Text', 'Exclude',
|
|
33
30
|
'Comment', 'Depends On']}
|
|
34
|
-
_exclude_dir = ['node_modules', 'venv', 'Pods', 'Carthage']
|
|
35
31
|
|
|
36
32
|
|
|
37
|
-
def
|
|
38
|
-
size = shutil.get_terminal_size()
|
|
39
|
-
return size.lines
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
def paginate_file(file_path):
|
|
43
|
-
lines_per_page = get_terminal_size() - 1
|
|
44
|
-
with open(file_path, 'r', encoding='utf8') as file:
|
|
45
|
-
lines = file.readlines()
|
|
46
|
-
|
|
47
|
-
for i in range(0, len(lines), lines_per_page):
|
|
48
|
-
os.system('clear' if os.name == 'posix' else 'cls')
|
|
49
|
-
print(''.join(lines[i: i + lines_per_page]))
|
|
50
|
-
if i + lines_per_page < len(lines):
|
|
51
|
-
input("Press Enter to see the next page...")
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
def find_package_manager(input_dir, abs_path_to_exclude=[], manifest_file_name=[], recursive=False):
|
|
33
|
+
def find_package_manager(input_dir, path_to_exclude=[], manifest_file_name=[], recursive=False, excluded_files=[]):
|
|
55
34
|
ret = True
|
|
56
35
|
if not manifest_file_name:
|
|
57
36
|
for value in const.SUPPORT_PACKAE.values():
|
|
@@ -64,16 +43,14 @@ def find_package_manager(input_dir, abs_path_to_exclude=[], manifest_file_name=[
|
|
|
64
43
|
found_manifest_set = set()
|
|
65
44
|
suggested_files = []
|
|
66
45
|
for parent, dirs, files in os.walk(input_dir):
|
|
67
|
-
|
|
68
|
-
if
|
|
69
|
-
|
|
70
|
-
if os.path.abspath(parent) in abs_path_to_exclude:
|
|
46
|
+
rel_parent = os.path.relpath(parent, input_dir)
|
|
47
|
+
if rel_parent != '.' and rel_parent in path_to_exclude:
|
|
48
|
+
dirs[:] = []
|
|
71
49
|
continue
|
|
72
50
|
for file in files:
|
|
73
51
|
file_path = os.path.join(parent, file)
|
|
74
|
-
|
|
75
|
-
if
|
|
76
|
-
for exclude_path in abs_path_to_exclude):
|
|
52
|
+
rel_file_path = os.path.relpath(file_path, input_dir)
|
|
53
|
+
if rel_file_path in excluded_files:
|
|
77
54
|
continue
|
|
78
55
|
if file in manifest_file_name:
|
|
79
56
|
candidate = os.path.join(parent, file)
|
|
@@ -84,7 +61,13 @@ def find_package_manager(input_dir, abs_path_to_exclude=[], manifest_file_name=[
|
|
|
84
61
|
for manifest_f in manifest_file_name:
|
|
85
62
|
candidate = os.path.join(parent, manifest_f)
|
|
86
63
|
norm_candidate = os.path.normpath(candidate)
|
|
87
|
-
if
|
|
64
|
+
if norm_candidate in found_manifest_set:
|
|
65
|
+
continue
|
|
66
|
+
rel_candidate = os.path.relpath(candidate, input_dir)
|
|
67
|
+
if rel_candidate in excluded_files:
|
|
68
|
+
logger.debug(f'Skipping excluded manifest: {rel_candidate}')
|
|
69
|
+
continue
|
|
70
|
+
if os.path.exists(candidate):
|
|
88
71
|
found_manifest_set.add(norm_candidate)
|
|
89
72
|
found_manifest_file.append(candidate)
|
|
90
73
|
if file in const.SUGGESTED_PACKAGE.keys():
|
|
@@ -96,7 +79,13 @@ def find_package_manager(input_dir, abs_path_to_exclude=[], manifest_file_name=[
|
|
|
96
79
|
if len(manifest_l) > 1 and manifest_l[0] == dir:
|
|
97
80
|
candidate = os.path.join(parent, manifest_f)
|
|
98
81
|
norm_candidate = os.path.normpath(candidate)
|
|
99
|
-
if
|
|
82
|
+
if norm_candidate in found_manifest_set:
|
|
83
|
+
continue
|
|
84
|
+
rel_candidate = os.path.relpath(candidate, input_dir)
|
|
85
|
+
if rel_candidate in excluded_files:
|
|
86
|
+
logger.debug(f'Skipping excluded manifest in dir: {rel_candidate}')
|
|
87
|
+
continue
|
|
88
|
+
if os.path.exists(candidate):
|
|
100
89
|
found_manifest_set.add(norm_candidate)
|
|
101
90
|
found_manifest_file.append(candidate)
|
|
102
91
|
|
|
@@ -173,7 +162,7 @@ def print_package_info(pm, log_lines, status=''):
|
|
|
173
162
|
def run_dependency_scanner(package_manager='', input_dir='', output_dir_file='', pip_activate_cmd='',
|
|
174
163
|
pip_deactivate_cmd='', output_custom_dir='', app_name=const.default_app_name,
|
|
175
164
|
github_token='', formats=[], direct=True, path_to_exclude=[], graph_path='',
|
|
176
|
-
graph_size=(600, 600), recursive=False):
|
|
165
|
+
graph_size=(600, 600), recursive=False, all_exclude_mode=()):
|
|
177
166
|
global logger
|
|
178
167
|
|
|
179
168
|
ret = True
|
|
@@ -226,7 +215,6 @@ def run_dependency_scanner(package_manager='', input_dir='', output_dir_file='',
|
|
|
226
215
|
|
|
227
216
|
logger, _result_log = init_log(os.path.join(output_path, "fosslight_log_dep_" + _start_time + ".txt"),
|
|
228
217
|
True, logging.INFO, logging.DEBUG, _PKG_NAME, "", path_to_exclude)
|
|
229
|
-
abs_path_to_exclude = [os.path.abspath(os.path.join(input_dir, path)) for path in path_to_exclude]
|
|
230
218
|
|
|
231
219
|
logger.info(f"Tool Info : {_result_log['Tool Info']}")
|
|
232
220
|
|
|
@@ -268,16 +256,19 @@ def run_dependency_scanner(package_manager='', input_dir='', output_dir_file='',
|
|
|
268
256
|
manifest_file_name = []
|
|
269
257
|
|
|
270
258
|
try:
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
259
|
+
if all_exclude_mode and len(all_exclude_mode) == 4:
|
|
260
|
+
excluded_path_with_default_exclusion, excluded_path_without_dot, excluded_files, _ = all_exclude_mode
|
|
261
|
+
logger.debug(f"Skipped paths: {excluded_path_with_default_exclusion}")
|
|
262
|
+
else:
|
|
263
|
+
excluded_path_with_default_exclusion, excluded_path_without_dot, excluded_files, _ = (
|
|
264
|
+
get_excluded_paths(input_dir, path_to_exclude))
|
|
265
|
+
|
|
274
266
|
scan_item.set_cover_pathinfo(input_dir, excluded_path_without_dot)
|
|
275
|
-
abs_path_to_exclude = [os.path.abspath(os.path.join(input_dir, path))
|
|
276
|
-
for path in excluded_path_with_default_exclusion]
|
|
277
267
|
ret, found_package_manager, input_dir, suggested_files = find_package_manager(input_dir,
|
|
278
|
-
|
|
268
|
+
excluded_path_with_default_exclusion,
|
|
279
269
|
manifest_file_name,
|
|
280
|
-
recursive
|
|
270
|
+
recursive,
|
|
271
|
+
excluded_files)
|
|
281
272
|
except Exception as e:
|
|
282
273
|
if autodetect:
|
|
283
274
|
logger.error(f'Fail to find package manager: {e}')
|
|
@@ -400,101 +391,3 @@ def run_dependency_scanner(package_manager='', input_dir='', output_dir_file='',
|
|
|
400
391
|
logger.error(f"Fail to generate result file. msg:({err_msg})")
|
|
401
392
|
|
|
402
393
|
return ret, scan_item
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
def main():
|
|
406
|
-
package_manager = ''
|
|
407
|
-
input_dir = ''
|
|
408
|
-
output_dir = ''
|
|
409
|
-
path_to_exclude = []
|
|
410
|
-
pip_activate_cmd = ''
|
|
411
|
-
pip_deactivate_cmd = ''
|
|
412
|
-
output_custom_dir = ''
|
|
413
|
-
app_name = const.default_app_name
|
|
414
|
-
github_token = ''
|
|
415
|
-
format = []
|
|
416
|
-
graph_path = ''
|
|
417
|
-
graph_size = (600, 600)
|
|
418
|
-
direct = True
|
|
419
|
-
recursive = False
|
|
420
|
-
|
|
421
|
-
parser = argparse.ArgumentParser(add_help=False)
|
|
422
|
-
parser.add_argument('-h', '--help', action='store_true', required=False)
|
|
423
|
-
parser.add_argument('-v', '--version', action='store_true', required=False)
|
|
424
|
-
parser.add_argument('-m', '--manager', nargs=1, type=str, default='', required=False)
|
|
425
|
-
parser.add_argument('-p', '--path', nargs=1, type=str, required=False)
|
|
426
|
-
parser.add_argument('-e', '--exclude', nargs='*', required=False, default=[])
|
|
427
|
-
parser.add_argument('-o', '--output', nargs=1, type=str, required=False)
|
|
428
|
-
parser.add_argument('-a', '--activate', nargs=1, type=str, default='', required=False)
|
|
429
|
-
parser.add_argument('-d', '--deactivate', nargs=1, type=str, default='', required=False)
|
|
430
|
-
parser.add_argument('-c', '--customized', nargs=1, type=str, required=False)
|
|
431
|
-
parser.add_argument('-n', '--appname', nargs=1, type=str, required=False)
|
|
432
|
-
parser.add_argument('-t', '--token', nargs=1, type=str, required=False)
|
|
433
|
-
parser.add_argument('-f', '--format', nargs="*", type=str, required=False)
|
|
434
|
-
parser.add_argument('--graph-path', nargs=1, type=str, required=False)
|
|
435
|
-
parser.add_argument('--graph-size', nargs=2, type=int, metavar=("WIDTH", "HEIGHT"), required=False)
|
|
436
|
-
parser.add_argument('--direct', choices=('true', 'false'), default='True', required=False)
|
|
437
|
-
parser.add_argument('--notice', action='store_true', required=False)
|
|
438
|
-
parser.add_argument('-r', '--recursive', action='store_true', required=False)
|
|
439
|
-
|
|
440
|
-
args = parser.parse_args()
|
|
441
|
-
|
|
442
|
-
if args.help: # -h option
|
|
443
|
-
print_help_msg()
|
|
444
|
-
|
|
445
|
-
if args.version: # -v option
|
|
446
|
-
print_version(_PKG_NAME)
|
|
447
|
-
|
|
448
|
-
if args.manager: # -m option
|
|
449
|
-
package_manager = ''.join(args.manager)
|
|
450
|
-
if args.path: # -p option
|
|
451
|
-
input_dir = ''.join(args.path)
|
|
452
|
-
if args.exclude: # -e option
|
|
453
|
-
path_to_exclude = args.exclude
|
|
454
|
-
if args.output: # -o option
|
|
455
|
-
output_dir = ''.join(args.output)
|
|
456
|
-
if args.activate: # -a option
|
|
457
|
-
pip_activate_cmd = ''.join(args.activate)
|
|
458
|
-
if args.deactivate: # -d option
|
|
459
|
-
pip_deactivate_cmd = ''.join(args.deactivate)
|
|
460
|
-
if args.customized: # -c option
|
|
461
|
-
output_custom_dir = ''.join(args.customized)
|
|
462
|
-
if args.appname: # -n option
|
|
463
|
-
app_name = ''.join(args.appname)
|
|
464
|
-
if args.token: # -t option
|
|
465
|
-
github_token = ''.join(args.token)
|
|
466
|
-
if args.format: # -f option
|
|
467
|
-
format = list(args.format)
|
|
468
|
-
if args.graph_path:
|
|
469
|
-
graph_path = ''.join(args.graph_path)
|
|
470
|
-
if args.graph_size:
|
|
471
|
-
graph_size = args.graph_size
|
|
472
|
-
if args.direct: # --direct option
|
|
473
|
-
if args.direct == 'true' or args.direct == 'True':
|
|
474
|
-
direct = True
|
|
475
|
-
elif args.direct == 'false' or args.direct == 'False':
|
|
476
|
-
direct = False
|
|
477
|
-
if args.notice: # --notice option
|
|
478
|
-
try:
|
|
479
|
-
base_path = sys._MEIPASS
|
|
480
|
-
except Exception:
|
|
481
|
-
base_path = os.path.dirname(__file__)
|
|
482
|
-
|
|
483
|
-
data_path = os.path.join(base_path, 'LICENSES')
|
|
484
|
-
print(f"*** {_PKG_NAME} open source license notice ***")
|
|
485
|
-
for ff in os.listdir(data_path):
|
|
486
|
-
source_file = os.path.join(data_path, ff)
|
|
487
|
-
destination_file = os.path.join(base_path, ff)
|
|
488
|
-
paginate_file(source_file)
|
|
489
|
-
shutil.copyfile(source_file, destination_file)
|
|
490
|
-
sys.exit(0)
|
|
491
|
-
if args.recursive: # -r option
|
|
492
|
-
recursive = True
|
|
493
|
-
|
|
494
|
-
run_dependency_scanner(package_manager, input_dir, output_dir, pip_activate_cmd, pip_deactivate_cmd,
|
|
495
|
-
output_custom_dir, app_name, github_token, format, direct, path_to_exclude,
|
|
496
|
-
graph_path, graph_size, recursive)
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
if __name__ == '__main__':
|
|
500
|
-
main()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fosslight_dependency
|
|
3
|
-
Version: 4.1.
|
|
3
|
+
Version: 4.1.29
|
|
4
4
|
Summary: FOSSLight Dependency Scanner
|
|
5
5
|
Home-page: https://github.com/fosslight/fosslight_dependency_scanner
|
|
6
6
|
Download-URL: https://github.com/fosslight/fosslight_dependency_scanner
|
|
@@ -23,7 +23,7 @@ Requires-Dist: lxml
|
|
|
23
23
|
Requires-Dist: virtualenv
|
|
24
24
|
Requires-Dist: pyyaml
|
|
25
25
|
Requires-Dist: lastversion
|
|
26
|
-
Requires-Dist: fosslight_util>=2.1.
|
|
26
|
+
Requires-Dist: fosslight_util>=2.1.37
|
|
27
27
|
Requires-Dist: PyGithub
|
|
28
28
|
Requires-Dist: requirements-parser
|
|
29
29
|
Requires-Dist: defusedxml
|
|
@@ -12,6 +12,7 @@ src/fosslight_dependency/_analyze_dependency.py
|
|
|
12
12
|
src/fosslight_dependency/_graph_convertor.py
|
|
13
13
|
src/fosslight_dependency/_help.py
|
|
14
14
|
src/fosslight_dependency/_package_manager.py
|
|
15
|
+
src/fosslight_dependency/cli.py
|
|
15
16
|
src/fosslight_dependency/constant.py
|
|
16
17
|
src/fosslight_dependency/dependency_item.py
|
|
17
18
|
src/fosslight_dependency/run_dependency_scanner.py
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fosslight_dependency-4.1.28 → fosslight_dependency-4.1.29}/src/fosslight_dependency/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fosslight_dependency-4.1.28 → fosslight_dependency-4.1.29}/src/fosslight_dependency/_help.py
RENAMED
|
File without changes
|
|
File without changes
|
{fosslight_dependency-4.1.28 → fosslight_dependency-4.1.29}/src/fosslight_dependency/constant.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|