fosslight-dependency 3.14.1__tar.gz → 3.14.3__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-3.14.1 → fosslight_dependency-3.14.3}/PKG-INFO +10 -2
- {fosslight_dependency-3.14.1 → fosslight_dependency-3.14.3}/README.md +9 -1
- {fosslight_dependency-3.14.1 → fosslight_dependency-3.14.3}/setup.py +1 -1
- {fosslight_dependency-3.14.1 → fosslight_dependency-3.14.3}/src/fosslight_dependency/_analyze_dependency.py +3 -0
- {fosslight_dependency-3.14.1 → fosslight_dependency-3.14.3}/src/fosslight_dependency/_help.py +1 -0
- {fosslight_dependency-3.14.1 → fosslight_dependency-3.14.3}/src/fosslight_dependency/_package_manager.py +1 -1
- {fosslight_dependency-3.14.1 → fosslight_dependency-3.14.3}/src/fosslight_dependency/constant.py +3 -1
- {fosslight_dependency-3.14.1 → fosslight_dependency-3.14.3}/src/fosslight_dependency/package_manager/Go.py +10 -0
- fosslight_dependency-3.14.3/src/fosslight_dependency/package_manager/Unity.py +103 -0
- {fosslight_dependency-3.14.1 → fosslight_dependency-3.14.3}/src/fosslight_dependency/run_dependency_scanner.py +8 -1
- {fosslight_dependency-3.14.1 → fosslight_dependency-3.14.3}/src/fosslight_dependency.egg-info/PKG-INFO +10 -2
- {fosslight_dependency-3.14.1 → fosslight_dependency-3.14.3}/src/fosslight_dependency.egg-info/SOURCES.txt +1 -0
- {fosslight_dependency-3.14.1 → fosslight_dependency-3.14.3}/LICENSE +0 -0
- {fosslight_dependency-3.14.1 → fosslight_dependency-3.14.3}/LICENSES/Apache-2.0.txt +0 -0
- {fosslight_dependency-3.14.1 → fosslight_dependency-3.14.3}/LICENSES/LicenseRef-3rd_party_licenses.txt +0 -0
- {fosslight_dependency-3.14.1 → fosslight_dependency-3.14.3}/LICENSES/MIT.txt +0 -0
- {fosslight_dependency-3.14.1 → fosslight_dependency-3.14.3}/MANIFEST.in +0 -0
- {fosslight_dependency-3.14.1 → fosslight_dependency-3.14.3}/requirements.txt +0 -0
- {fosslight_dependency-3.14.1 → fosslight_dependency-3.14.3}/setup.cfg +0 -0
- {fosslight_dependency-3.14.1 → fosslight_dependency-3.14.3}/src/fosslight_dependency/__init__.py +0 -0
- {fosslight_dependency-3.14.1 → fosslight_dependency-3.14.3}/src/fosslight_dependency/package_manager/Android.py +0 -0
- {fosslight_dependency-3.14.1 → fosslight_dependency-3.14.3}/src/fosslight_dependency/package_manager/Carthage.py +0 -0
- {fosslight_dependency-3.14.1 → fosslight_dependency-3.14.3}/src/fosslight_dependency/package_manager/Cocoapods.py +0 -0
- {fosslight_dependency-3.14.1 → fosslight_dependency-3.14.3}/src/fosslight_dependency/package_manager/Gradle.py +0 -0
- {fosslight_dependency-3.14.1 → fosslight_dependency-3.14.3}/src/fosslight_dependency/package_manager/Helm.py +0 -0
- {fosslight_dependency-3.14.1 → fosslight_dependency-3.14.3}/src/fosslight_dependency/package_manager/Maven.py +0 -0
- {fosslight_dependency-3.14.1 → fosslight_dependency-3.14.3}/src/fosslight_dependency/package_manager/Npm.py +0 -0
- {fosslight_dependency-3.14.1 → fosslight_dependency-3.14.3}/src/fosslight_dependency/package_manager/Nuget.py +0 -0
- {fosslight_dependency-3.14.1 → fosslight_dependency-3.14.3}/src/fosslight_dependency/package_manager/Pub.py +0 -0
- {fosslight_dependency-3.14.1 → fosslight_dependency-3.14.3}/src/fosslight_dependency/package_manager/Pypi.py +0 -0
- {fosslight_dependency-3.14.1 → fosslight_dependency-3.14.3}/src/fosslight_dependency/package_manager/Swift.py +0 -0
- {fosslight_dependency-3.14.1 → fosslight_dependency-3.14.3}/src/fosslight_dependency/package_manager/__init__.py +0 -0
- {fosslight_dependency-3.14.1 → fosslight_dependency-3.14.3}/src/fosslight_dependency.egg-info/dependency_links.txt +0 -0
- {fosslight_dependency-3.14.1 → fosslight_dependency-3.14.3}/src/fosslight_dependency.egg-info/entry_points.txt +0 -0
- {fosslight_dependency-3.14.1 → fosslight_dependency-3.14.3}/src/fosslight_dependency.egg-info/requires.txt +0 -0
- {fosslight_dependency-3.14.1 → fosslight_dependency-3.14.3}/src/fosslight_dependency.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: fosslight_dependency
|
3
|
-
Version: 3.14.
|
3
|
+
Version: 3.14.3
|
4
4
|
Summary: FOSSLight Dependency Scanner
|
5
5
|
Home-page: https://github.com/fosslight/fosslight_dependency_scanner
|
6
6
|
Author: LG Electronics
|
@@ -112,7 +112,7 @@ Description: <!--
|
|
112
112
|
<tr>
|
113
113
|
<td>Python</td>
|
114
114
|
<td>Pypi</td>
|
115
|
-
<td>requirements.txt, setup.py</td>
|
115
|
+
<td>requirements.txt, setup.py, pyproject.toml</td>
|
116
116
|
<td>O</td>
|
117
117
|
<td>O</td>
|
118
118
|
<td>O</td>
|
@@ -133,6 +133,14 @@ Description: <!--
|
|
133
133
|
<td>X</td>
|
134
134
|
<td>X</td>
|
135
135
|
</tr>
|
136
|
+
<tr>
|
137
|
+
<td>Unity</td>
|
138
|
+
<td>Unity</td>
|
139
|
+
<td>Library/PackageManager/ProjectCache</td>
|
140
|
+
<td>O</td>
|
141
|
+
<td>O</td>
|
142
|
+
<td>X</td>
|
143
|
+
</tr>
|
136
144
|
</tbody>
|
137
145
|
</table>
|
138
146
|
|
@@ -104,7 +104,7 @@ In this user guide, you can see how to install the FOSSLight Dependency Scanner
|
|
104
104
|
<tr>
|
105
105
|
<td>Python</td>
|
106
106
|
<td>Pypi</td>
|
107
|
-
<td>requirements.txt, setup.py</td>
|
107
|
+
<td>requirements.txt, setup.py, pyproject.toml</td>
|
108
108
|
<td>O</td>
|
109
109
|
<td>O</td>
|
110
110
|
<td>O</td>
|
@@ -125,6 +125,14 @@ In this user guide, you can see how to install the FOSSLight Dependency Scanner
|
|
125
125
|
<td>X</td>
|
126
126
|
<td>X</td>
|
127
127
|
</tr>
|
128
|
+
<tr>
|
129
|
+
<td>Unity</td>
|
130
|
+
<td>Unity</td>
|
131
|
+
<td>Library/PackageManager/ProjectCache</td>
|
132
|
+
<td>O</td>
|
133
|
+
<td>O</td>
|
134
|
+
<td>X</td>
|
135
|
+
</tr>
|
128
136
|
</tbody>
|
129
137
|
</table>
|
130
138
|
|
@@ -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
|
@@ -132,7 +132,7 @@ class PackageManager:
|
|
132
132
|
}}'''
|
133
133
|
try:
|
134
134
|
with open(const.SUPPORT_PACKAE.get(self.package_manager_name), 'a', encoding='utf8') as f:
|
135
|
-
f.write(allDeps)
|
135
|
+
f.write(f'\n{allDeps}\n')
|
136
136
|
ret = True
|
137
137
|
except Exception as e:
|
138
138
|
logging.warning(f"Cannot add the allDeps task in build.gradle: {e}")
|
{fosslight_dependency-3.14.1 → fosslight_dependency-3.14.3}/src/fosslight_dependency/constant.py
RENAMED
@@ -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
|
@@ -10,6 +10,7 @@ import json
|
|
10
10
|
from bs4 import BeautifulSoup
|
11
11
|
import urllib.request
|
12
12
|
import re
|
13
|
+
import shutil
|
13
14
|
import fosslight_util.constant as constant
|
14
15
|
import fosslight_dependency.constant as const
|
15
16
|
from fosslight_dependency._package_manager import PackageManager, get_url_to_purl
|
@@ -24,6 +25,8 @@ class Go(PackageManager):
|
|
24
25
|
is_run_plugin = False
|
25
26
|
dn_url = 'https://pkg.go.dev/'
|
26
27
|
tmp_file_name = 'tmp_go_list.json'
|
28
|
+
go_work = 'go.work'
|
29
|
+
tmp_go_work = 'go.work.tmp'
|
27
30
|
|
28
31
|
def __init__(self, input_dir, output_dir):
|
29
32
|
super().__init__(self.package_manager_name, self.dn_url, input_dir, output_dir)
|
@@ -33,6 +36,8 @@ class Go(PackageManager):
|
|
33
36
|
def __del__(self):
|
34
37
|
if os.path.isfile(self.tmp_file_name):
|
35
38
|
os.remove(self.tmp_file_name)
|
39
|
+
if os.path.isfile(self.tmp_go_work):
|
40
|
+
shutil.move(self.tmp_go_work, self.go_work)
|
36
41
|
|
37
42
|
def parse_dependency_tree(self, go_deptree_txt):
|
38
43
|
for line in go_deptree_txt.split('\n'):
|
@@ -49,6 +54,9 @@ class Go(PackageManager):
|
|
49
54
|
def run_plugin(self):
|
50
55
|
ret = True
|
51
56
|
|
57
|
+
if os.path.isfile(self.go_work):
|
58
|
+
shutil.move(self.go_work, self.tmp_go_work)
|
59
|
+
|
52
60
|
logger.info("Execute 'go list -m -mod=mod -json all' to obtain package info.")
|
53
61
|
cmd = f"go list -m -mod=mod -json all > {self.tmp_file_name}"
|
54
62
|
|
@@ -64,6 +72,8 @@ class Go(PackageManager):
|
|
64
72
|
if ret_cmd_tree != 0:
|
65
73
|
self.parse_dependency_tree(ret_cmd_tree)
|
66
74
|
|
75
|
+
if os.path.isfile(self.tmp_go_work):
|
76
|
+
shutil.move(self.tmp_go_work, self.go_work)
|
67
77
|
return ret
|
68
78
|
|
69
79
|
def parse_oss_information(self, f_name):
|
@@ -0,0 +1,103 @@
|
|
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
|
+
if purl != '':
|
88
|
+
purl = f'{purl}@{oss_version}'
|
89
|
+
|
90
|
+
comment_list = []
|
91
|
+
if self.direct_dep:
|
92
|
+
if pkg_data['isDirectDependency']:
|
93
|
+
comment_list.append('direct')
|
94
|
+
else:
|
95
|
+
comment_list.append('transitive')
|
96
|
+
|
97
|
+
comment = ','.join(comment_list)
|
98
|
+
sheet_list.append([purl, oss_name, oss_version, license_name, dn_loc, homepage,
|
99
|
+
'', '', comment, ''])
|
100
|
+
except Exception as e:
|
101
|
+
logger.error(f"Fail to parse unity oss information: {e}")
|
102
|
+
|
103
|
+
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.3
|
4
4
|
Summary: FOSSLight Dependency Scanner
|
5
5
|
Home-page: https://github.com/fosslight/fosslight_dependency_scanner
|
6
6
|
Author: LG Electronics
|
@@ -112,7 +112,7 @@ Description: <!--
|
|
112
112
|
<tr>
|
113
113
|
<td>Python</td>
|
114
114
|
<td>Pypi</td>
|
115
|
-
<td>requirements.txt, setup.py</td>
|
115
|
+
<td>requirements.txt, setup.py, pyproject.toml</td>
|
116
116
|
<td>O</td>
|
117
117
|
<td>O</td>
|
118
118
|
<td>O</td>
|
@@ -133,6 +133,14 @@ Description: <!--
|
|
133
133
|
<td>X</td>
|
134
134
|
<td>X</td>
|
135
135
|
</tr>
|
136
|
+
<tr>
|
137
|
+
<td>Unity</td>
|
138
|
+
<td>Unity</td>
|
139
|
+
<td>Library/PackageManager/ProjectCache</td>
|
140
|
+
<td>O</td>
|
141
|
+
<td>O</td>
|
142
|
+
<td>X</td>
|
143
|
+
</tr>
|
136
144
|
</tbody>
|
137
145
|
</table>
|
138
146
|
|
@@ -31,4 +31,5 @@ src/fosslight_dependency/package_manager/Nuget.py
|
|
31
31
|
src/fosslight_dependency/package_manager/Pub.py
|
32
32
|
src/fosslight_dependency/package_manager/Pypi.py
|
33
33
|
src/fosslight_dependency/package_manager/Swift.py
|
34
|
+
src/fosslight_dependency/package_manager/Unity.py
|
34
35
|
src/fosslight_dependency/package_manager/__init__.py
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{fosslight_dependency-3.14.1 → fosslight_dependency-3.14.3}/src/fosslight_dependency/__init__.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
|