fosslight-dependency 3.14.1__py3-none-any.whl → 3.14.2__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/_analyze_dependency.py +3 -0
- fosslight_dependency/_help.py +1 -0
- fosslight_dependency/constant.py +3 -1
- fosslight_dependency/package_manager/Unity.py +101 -0
- fosslight_dependency/run_dependency_scanner.py +8 -1
- {fosslight_dependency-3.14.1.dist-info → fosslight_dependency-3.14.2.dist-info}/METADATA +2 -2
- {fosslight_dependency-3.14.1.dist-info → fosslight_dependency-3.14.2.dist-info}/RECORD +14 -13
- {fosslight_dependency-3.14.1.dist-info → fosslight_dependency-3.14.2.dist-info}/Apache-2.0.txt +0 -0
- {fosslight_dependency-3.14.1.dist-info → fosslight_dependency-3.14.2.dist-info}/LICENSE +0 -0
- {fosslight_dependency-3.14.1.dist-info → fosslight_dependency-3.14.2.dist-info}/LicenseRef-3rd_party_licenses.txt +0 -0
- {fosslight_dependency-3.14.1.dist-info → fosslight_dependency-3.14.2.dist-info}/MIT.txt +0 -0
- {fosslight_dependency-3.14.1.dist-info → fosslight_dependency-3.14.2.dist-info}/WHEEL +0 -0
- {fosslight_dependency-3.14.1.dist-info → fosslight_dependency-3.14.2.dist-info}/entry_points.txt +0 -0
- {fosslight_dependency-3.14.1.dist-info → fosslight_dependency-3.14.2.dist-info}/top_level.txt +0 -0
@@ -18,6 +18,7 @@ from fosslight_dependency.package_manager.Carthage import Carthage
|
|
18
18
|
from fosslight_dependency.package_manager.Go import Go
|
19
19
|
from fosslight_dependency.package_manager.Nuget import Nuget
|
20
20
|
from fosslight_dependency.package_manager.Helm import Helm
|
21
|
+
from fosslight_dependency.package_manager.Unity import Unity
|
21
22
|
import fosslight_util.constant as constant
|
22
23
|
|
23
24
|
logger = logging.getLogger(constant.LOGGER_NAME)
|
@@ -53,6 +54,8 @@ def analyze_dependency(package_manager_name, input_dir, output_dir, pip_activate
|
|
53
54
|
package_manager = Nuget(input_dir, output_dir)
|
54
55
|
elif package_manager_name == const.HELM:
|
55
56
|
package_manager = Helm(input_dir, output_dir)
|
57
|
+
elif package_manager_name == const.UNITY:
|
58
|
+
package_manager = Unity(input_dir, output_dir)
|
56
59
|
else:
|
57
60
|
logger.error(f"Not supported package manager name: {package_manager_name}")
|
58
61
|
ret = False
|
fosslight_dependency/_help.py
CHANGED
fosslight_dependency/constant.py
CHANGED
@@ -22,6 +22,7 @@ CARTHAGE = 'carthage'
|
|
22
22
|
GO = 'go'
|
23
23
|
NUGET = 'nuget'
|
24
24
|
HELM = 'helm'
|
25
|
+
UNITY = 'unity'
|
25
26
|
|
26
27
|
# Supported package name and manifest file
|
27
28
|
SUPPORT_PACKAE = {
|
@@ -36,7 +37,8 @@ SUPPORT_PACKAE = {
|
|
36
37
|
CARTHAGE: 'Cartfile.resolved',
|
37
38
|
GO: 'go.mod',
|
38
39
|
NUGET: ['packages.config', os.path.join('obj', 'project.assets.json')],
|
39
|
-
HELM: 'Chart.yaml'
|
40
|
+
HELM: 'Chart.yaml',
|
41
|
+
UNITY: os.path.join('Library', 'PackageManager', 'ProjectCache')
|
40
42
|
}
|
41
43
|
|
42
44
|
# default android app name
|
@@ -0,0 +1,101 @@
|
|
1
|
+
#!/usr/bin/env python
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
# Copyright (c) 2024 LG Electronics Inc.
|
4
|
+
# SPDX-License-Identifier: Apache-2.0
|
5
|
+
|
6
|
+
import os
|
7
|
+
import logging
|
8
|
+
import re
|
9
|
+
import yaml
|
10
|
+
import fosslight_util.constant as constant
|
11
|
+
import fosslight_dependency.constant as const
|
12
|
+
from fosslight_dependency._package_manager import PackageManager
|
13
|
+
from fosslight_dependency._package_manager import check_and_run_license_scanner, get_url_to_purl
|
14
|
+
|
15
|
+
logger = logging.getLogger(constant.LOGGER_NAME)
|
16
|
+
proprietary_license = 'Proprietary License'
|
17
|
+
unclassifed_license = 'UnclassifiedLicense'
|
18
|
+
license_md = 'LICENSE.md'
|
19
|
+
third_party_md = 'Third Party Notices.md'
|
20
|
+
|
21
|
+
|
22
|
+
class Unity(PackageManager):
|
23
|
+
package_manager_name = const.UNITY
|
24
|
+
|
25
|
+
input_file_name = const.SUPPORT_PACKAE.get(package_manager_name)
|
26
|
+
packageCache_dir = os.path.join('Library', 'PackageCache')
|
27
|
+
mirror_url = 'https://github.com/needle-mirror/'
|
28
|
+
unity_internal_url = 'https://github.cds.internal.unity3d.com'
|
29
|
+
third_notice_txt = 'third_party_notice.txt'
|
30
|
+
|
31
|
+
def __init__(self, input_dir, output_dir):
|
32
|
+
super().__init__(self.package_manager_name, '', input_dir, output_dir)
|
33
|
+
self.append_input_package_list_file(self.input_file_name)
|
34
|
+
|
35
|
+
def parse_oss_information(self, f_name):
|
36
|
+
comment = ''
|
37
|
+
|
38
|
+
with open(f_name, 'r', encoding='utf8') as f:
|
39
|
+
f_yml = yaml.safe_load(f)
|
40
|
+
resolvedPkg = f_yml['m_ResolvedPackages']
|
41
|
+
|
42
|
+
try:
|
43
|
+
sheet_list = []
|
44
|
+
|
45
|
+
for pkg_data in resolvedPkg:
|
46
|
+
oss_name = pkg_data['name']
|
47
|
+
oss_version = pkg_data['version']
|
48
|
+
|
49
|
+
oss_packagecache_dir = os.path.join(self.packageCache_dir, f'{oss_name}@{oss_version}')
|
50
|
+
license_f = os.path.join(oss_packagecache_dir, license_md)
|
51
|
+
if os.path.isfile(license_f):
|
52
|
+
license_name = check_and_run_license_scanner(self.platform,
|
53
|
+
self.license_scanner_bin,
|
54
|
+
license_f)
|
55
|
+
if license_name == unclassifed_license or license_name == '':
|
56
|
+
with open(license_f, 'r', encoding='utf-8') as f:
|
57
|
+
for line in f:
|
58
|
+
matched_l = re.search(r'Unity\s[\s\w]*\sLicense', line)
|
59
|
+
if matched_l:
|
60
|
+
license_name = matched_l[0]
|
61
|
+
break
|
62
|
+
else:
|
63
|
+
license_name = proprietary_license
|
64
|
+
|
65
|
+
third_f = os.path.join(oss_packagecache_dir, third_party_md)
|
66
|
+
if os.path.isfile(third_f):
|
67
|
+
with open(third_f, 'r', encoding='utf-8') as f:
|
68
|
+
third_notice = f.readlines()
|
69
|
+
with open(self.third_notice_txt, 'a+', encoding='utf-8') as tf:
|
70
|
+
for line in third_notice:
|
71
|
+
tf.write(line)
|
72
|
+
tf.flush()
|
73
|
+
|
74
|
+
homepage = pkg_data['repository']['url']
|
75
|
+
if homepage and homepage.startswith('git@'):
|
76
|
+
homepage = homepage.replace('git@', 'https://')
|
77
|
+
if homepage is None or homepage.startswith(self.unity_internal_url):
|
78
|
+
if license_name != proprietary_license:
|
79
|
+
homepage = f'{self.mirror_url}{oss_name}'
|
80
|
+
if homepage is None:
|
81
|
+
homepage = ''
|
82
|
+
|
83
|
+
dn_loc = homepage
|
84
|
+
purl = get_url_to_purl(dn_loc, self.package_manager_name)
|
85
|
+
if purl == 'None':
|
86
|
+
purl = ''
|
87
|
+
|
88
|
+
comment_list = []
|
89
|
+
if self.direct_dep:
|
90
|
+
if pkg_data['isDirectDependency']:
|
91
|
+
comment_list.append('direct')
|
92
|
+
else:
|
93
|
+
comment_list.append('transitive')
|
94
|
+
|
95
|
+
comment = ','.join(comment_list)
|
96
|
+
sheet_list.append([purl, oss_name, oss_version, license_name, dn_loc, homepage,
|
97
|
+
'', '', comment, ''])
|
98
|
+
except Exception as e:
|
99
|
+
logger.error(f"Fail to parse unity oss information: {e}")
|
100
|
+
|
101
|
+
return sheet_list
|
@@ -161,7 +161,7 @@ def run_dependency_scanner(package_manager='', input_dir='', output_dir_file='',
|
|
161
161
|
logger.warning("Dependency scanning terminated because the package manager was not found.")
|
162
162
|
ret = False
|
163
163
|
else:
|
164
|
-
found_package_manager[package_manager] = ''
|
164
|
+
found_package_manager[package_manager] = ["manual detect ('-m option')"]
|
165
165
|
|
166
166
|
pass_key = 'PASS'
|
167
167
|
success_pm = []
|
@@ -177,6 +177,13 @@ def run_dependency_scanner(package_manager='', input_dir='', output_dir_file='',
|
|
177
177
|
if pm == const.GRADLE:
|
178
178
|
if const.ANDROID in found_package_manager.keys():
|
179
179
|
found_package_manager[const.ANDROID] = pass_key
|
180
|
+
if f"{const.ANDROID} ({', '.join(manifest_file_name)})" in fail_pm:
|
181
|
+
fail_pm.remove(f"{const.ANDROID} ({', '.join(manifest_file_name)})")
|
182
|
+
elif pm == const.ANDROID:
|
183
|
+
if const.GRADLE in found_package_manager.keys():
|
184
|
+
found_package_manager[const.GRADLE] = pass_key
|
185
|
+
if f"{const.GRADLE} ({', '.join(manifest_file_name)})" in fail_pm:
|
186
|
+
fail_pm.remove(f"{const.GRADLE} ({', '.join(manifest_file_name)})")
|
180
187
|
else:
|
181
188
|
fail_pm.append(f"{pm} ({', '.join(manifest_file_name)})")
|
182
189
|
cover = CoverItem(tool_name=_PKG_NAME,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: fosslight-dependency
|
3
|
-
Version: 3.14.
|
3
|
+
Version: 3.14.2
|
4
4
|
Summary: FOSSLight Dependency Scanner
|
5
5
|
Home-page: https://github.com/fosslight/fosslight_dependency_scanner
|
6
6
|
Author: LG Electronics
|
@@ -132,7 +132,7 @@ In this user guide, you can see how to install the FOSSLight Dependency Scanner
|
|
132
132
|
<tr>
|
133
133
|
<td>Python</td>
|
134
134
|
<td>Pypi</td>
|
135
|
-
<td>requirements.txt, setup.py</td>
|
135
|
+
<td>requirements.txt, setup.py, pyproject.toml</td>
|
136
136
|
<td>O</td>
|
137
137
|
<td>O</td>
|
138
138
|
<td>O</td>
|
@@ -1,9 +1,9 @@
|
|
1
1
|
fosslight_dependency/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
-
fosslight_dependency/_analyze_dependency.py,sha256=
|
3
|
-
fosslight_dependency/_help.py,sha256=
|
2
|
+
fosslight_dependency/_analyze_dependency.py,sha256=f66gNPSluuDqx0e_7iyIuoSC_HNjpSitL_e1lak6kEA,3872
|
3
|
+
fosslight_dependency/_help.py,sha256=7B-B-j8IXuZhhoeuRvcbj5AiyGQmqg6qMbv8zbDl95c,2730
|
4
4
|
fosslight_dependency/_package_manager.py,sha256=6U6V413HSZAChX64v3CfXBd6jyIkuaIW60pBfbCLSfQ,13700
|
5
|
-
fosslight_dependency/constant.py,sha256=
|
6
|
-
fosslight_dependency/run_dependency_scanner.py,sha256=
|
5
|
+
fosslight_dependency/constant.py,sha256=1mJGu1SYyxVKo0W_pCIt-ANp52E_I5ovXFvpl2OMmjU,1039
|
6
|
+
fosslight_dependency/run_dependency_scanner.py,sha256=9fktktCcY5Po3Hqxdh04Q8U-SbRNsu50WAPjQSrjZ3o,12795
|
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=lPL-B-qIr4Bg1Z-bT6hSwzYF0IqW3J32At8AJNg8P_w,3015
|
@@ -18,16 +18,17 @@ fosslight_dependency/package_manager/Nuget.py,sha256=1YGkGktShw6xj7NGvgL763jWsnN
|
|
18
18
|
fosslight_dependency/package_manager/Pub.py,sha256=u2Wsm8raxc8fYEchyUpSpiKi-1x8seE4f0zJHD8BrMI,8964
|
19
19
|
fosslight_dependency/package_manager/Pypi.py,sha256=QakFlbGrb3oOXwRj498x5k2GFS1SgNeMpgMwUpBcwWU,15698
|
20
20
|
fosslight_dependency/package_manager/Swift.py,sha256=9J-LDCn0_zDBuScUeCgZIq0BQcx4n_1fhshciF9byNE,6590
|
21
|
+
fosslight_dependency/package_manager/Unity.py,sha256=p8O1W3g1wdhPPJSryvgYe5PWrbYVTSwdWjZVDqbmMAg,4271
|
21
22
|
fosslight_dependency/package_manager/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
22
23
|
fosslight_dependency/third_party/askalono/askalono.exe,sha256=NyngElHbrg3zLFRVwn6fPDZE_EDAEb1N8tiwWoCm4pQ,4743680
|
23
24
|
fosslight_dependency/third_party/askalono/askalono_macos,sha256=cYSNXhAQpkdd8lkgnY5skNeDmU_8DIuP84eFi0OXKkE,5589868
|
24
25
|
fosslight_dependency/third_party/nomos/nomossa,sha256=oFF9I-fhug6AVNyFnWeVXwDRin6NWSvk1g7mHBotB3Q,866408
|
25
|
-
fosslight_dependency-3.14.
|
26
|
-
fosslight_dependency-3.14.
|
27
|
-
fosslight_dependency-3.14.
|
28
|
-
fosslight_dependency-3.14.
|
29
|
-
fosslight_dependency-3.14.
|
30
|
-
fosslight_dependency-3.14.
|
31
|
-
fosslight_dependency-3.14.
|
32
|
-
fosslight_dependency-3.14.
|
33
|
-
fosslight_dependency-3.14.
|
26
|
+
fosslight_dependency-3.14.2.dist-info/Apache-2.0.txt,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
27
|
+
fosslight_dependency-3.14.2.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
28
|
+
fosslight_dependency-3.14.2.dist-info/LicenseRef-3rd_party_licenses.txt,sha256=EcsFt7aE1rp3OXAdJgmXayfOZdpRdBMcmRnyoqWMCsw,95687
|
29
|
+
fosslight_dependency-3.14.2.dist-info/METADATA,sha256=gaKeAXxQV8VyaVQ-2jTlLY-JqC5QbGsDajBIKMQNYaU,4652
|
30
|
+
fosslight_dependency-3.14.2.dist-info/MIT.txt,sha256=9cx4CbArgByWvkoEZNqpzbpJgA9TUe2D62rMocQpgfs,1082
|
31
|
+
fosslight_dependency-3.14.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
32
|
+
fosslight_dependency-3.14.2.dist-info/entry_points.txt,sha256=e1QZbnCrQvfbwe9L6PxXnkRZMhl-PSo0QyUes0dGjU8,91
|
33
|
+
fosslight_dependency-3.14.2.dist-info/top_level.txt,sha256=Jc0V7VcVCH0TEM8ksb8dwroTYz4AmRaQnlr3FB71Hcs,21
|
34
|
+
fosslight_dependency-3.14.2.dist-info/RECORD,,
|
{fosslight_dependency-3.14.1.dist-info → fosslight_dependency-3.14.2.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.14.1.dist-info → fosslight_dependency-3.14.2.dist-info}/entry_points.txt
RENAMED
File without changes
|
{fosslight_dependency-3.14.1.dist-info → fosslight_dependency-3.14.2.dist-info}/top_level.txt
RENAMED
File without changes
|