fosslight-util 2.1.9__tar.gz → 2.1.11__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.
Files changed (39) hide show
  1. {fosslight_util-2.1.9 → fosslight_util-2.1.11}/PKG-INFO +1 -1
  2. {fosslight_util-2.1.9 → fosslight_util-2.1.11}/setup.py +1 -1
  3. {fosslight_util-2.1.9 → fosslight_util-2.1.11}/src/fosslight_util/_get_downloadable_url.py +1 -1
  4. {fosslight_util-2.1.9 → fosslight_util-2.1.11}/src/fosslight_util/download.py +7 -11
  5. {fosslight_util-2.1.9 → fosslight_util-2.1.11}/src/fosslight_util/exclude.py +3 -1
  6. {fosslight_util-2.1.9 → fosslight_util-2.1.11}/src/fosslight_util/output_format.py +6 -3
  7. {fosslight_util-2.1.9 → fosslight_util-2.1.11}/src/fosslight_util/write_cyclonedx.py +5 -13
  8. {fosslight_util-2.1.9 → fosslight_util-2.1.11}/src/fosslight_util.egg-info/PKG-INFO +1 -1
  9. {fosslight_util-2.1.9 → fosslight_util-2.1.11}/LICENSE +0 -0
  10. {fosslight_util-2.1.9 → fosslight_util-2.1.11}/MANIFEST.in +0 -0
  11. {fosslight_util-2.1.9 → fosslight_util-2.1.11}/README.md +0 -0
  12. {fosslight_util-2.1.9 → fosslight_util-2.1.11}/requirements.txt +0 -0
  13. {fosslight_util-2.1.9 → fosslight_util-2.1.11}/setup.cfg +0 -0
  14. {fosslight_util-2.1.9 → fosslight_util-2.1.11}/src/fosslight_util/__init__.py +0 -0
  15. {fosslight_util-2.1.9 → fosslight_util-2.1.11}/src/fosslight_util/compare_yaml.py +0 -0
  16. {fosslight_util-2.1.9 → fosslight_util-2.1.11}/src/fosslight_util/constant.py +0 -0
  17. {fosslight_util-2.1.9 → fosslight_util-2.1.11}/src/fosslight_util/correct.py +0 -0
  18. {fosslight_util-2.1.9 → fosslight_util-2.1.11}/src/fosslight_util/cover.py +0 -0
  19. {fosslight_util-2.1.9 → fosslight_util-2.1.11}/src/fosslight_util/help.py +0 -0
  20. {fosslight_util-2.1.9 → fosslight_util-2.1.11}/src/fosslight_util/oss_item.py +0 -0
  21. {fosslight_util-2.1.9 → fosslight_util-2.1.11}/src/fosslight_util/parsing_yaml.py +0 -0
  22. {fosslight_util-2.1.9 → fosslight_util-2.1.11}/src/fosslight_util/read_excel.py +0 -0
  23. {fosslight_util-2.1.9 → fosslight_util-2.1.11}/src/fosslight_util/resources/frequentLicenselist.json +0 -0
  24. {fosslight_util-2.1.9 → fosslight_util-2.1.11}/src/fosslight_util/resources/frequent_license_nick_list.json +0 -0
  25. {fosslight_util-2.1.9 → fosslight_util-2.1.11}/src/fosslight_util/resources/licenses.json +0 -0
  26. {fosslight_util-2.1.9 → fosslight_util-2.1.11}/src/fosslight_util/set_log.py +0 -0
  27. {fosslight_util-2.1.9 → fosslight_util-2.1.11}/src/fosslight_util/spdx_licenses.py +0 -0
  28. {fosslight_util-2.1.9 → fosslight_util-2.1.11}/src/fosslight_util/timer_thread.py +0 -0
  29. {fosslight_util-2.1.9 → fosslight_util-2.1.11}/src/fosslight_util/write_excel.py +0 -0
  30. {fosslight_util-2.1.9 → fosslight_util-2.1.11}/src/fosslight_util/write_opossum.py +0 -0
  31. {fosslight_util-2.1.9 → fosslight_util-2.1.11}/src/fosslight_util/write_scancodejson.py +0 -0
  32. {fosslight_util-2.1.9 → fosslight_util-2.1.11}/src/fosslight_util/write_spdx.py +0 -0
  33. {fosslight_util-2.1.9 → fosslight_util-2.1.11}/src/fosslight_util/write_txt.py +0 -0
  34. {fosslight_util-2.1.9 → fosslight_util-2.1.11}/src/fosslight_util/write_yaml.py +0 -0
  35. {fosslight_util-2.1.9 → fosslight_util-2.1.11}/src/fosslight_util.egg-info/SOURCES.txt +0 -0
  36. {fosslight_util-2.1.9 → fosslight_util-2.1.11}/src/fosslight_util.egg-info/dependency_links.txt +0 -0
  37. {fosslight_util-2.1.9 → fosslight_util-2.1.11}/src/fosslight_util.egg-info/entry_points.txt +0 -0
  38. {fosslight_util-2.1.9 → fosslight_util-2.1.11}/src/fosslight_util.egg-info/requires.txt +0 -0
  39. {fosslight_util-2.1.9 → fosslight_util-2.1.11}/src/fosslight_util.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fosslight_util
3
- Version: 2.1.9
3
+ Version: 2.1.11
4
4
  Summary: FOSSLight Util
5
5
  Home-page: https://github.com/fosslight/fosslight_util
6
6
  Author: LG Electronics
@@ -14,7 +14,7 @@ with open('requirements.txt', 'r', 'utf-8') as f:
14
14
  if __name__ == "__main__":
15
15
  setup(
16
16
  name='fosslight_util',
17
- version='2.1.9',
17
+ version='2.1.11',
18
18
  package_dir={"": "src"},
19
19
  packages=find_packages(where='src'),
20
20
  description='FOSSLight Util',
@@ -121,7 +121,7 @@ def get_download_location_for_pypi(link):
121
121
  ret = True
122
122
  else:
123
123
  logger.warning(f'Cannot find the valid link for pypi (url:{new_link}')
124
- except Exception as e:
124
+ except Exception:
125
125
  oss_name = re.sub(r"[-]+", "_", oss_name).lower()
126
126
  new_link = f'{host}/packages/source/{oss_name[0]}/{oss_name}/{oss_name}-{oss_version}.tar.gz'
127
127
  res = urlopen(new_link)
@@ -123,8 +123,10 @@ def cli_download_and_extract(link: str, target_dir: str, log_dir: str, checkout_
123
123
  is_rubygems = src_info.get("rubygems", False)
124
124
 
125
125
  # General download (git clone, wget)
126
- success_git, msg, oss_name, oss_version = download_git_clone(link, target_dir, checkout_to,
127
- tag, branch, ssh_key, id, git_token)
126
+ success_git, msg, oss_name, oss_version = download_git_clone(link, target_dir,
127
+ checkout_to,
128
+ tag, branch,
129
+ ssh_key, id, git_token)
128
130
  link = change_ssh_link_to_https(link)
129
131
  if (not is_rubygems) and (not success_git):
130
132
  if os.path.isfile(target_dir):
@@ -205,27 +207,21 @@ def get_github_token(git_url):
205
207
  def download_git_repository(refs_to_checkout, git_url, target_dir, tag):
206
208
  success = False
207
209
  oss_version = ""
208
- clone_default_branch_flag = False
209
210
 
210
211
  logger.info(f"Download git url :{git_url}")
211
212
  if refs_to_checkout:
212
213
  try:
213
214
  # gitPython uses the branch argument the same whether you check out to a branch or a tag.
214
- repo = Repo.clone_from(git_url, target_dir, branch=refs_to_checkout)
215
+ Repo.clone_from(git_url, target_dir, branch=refs_to_checkout)
215
216
  success = True
217
+ oss_version = refs_to_checkout
216
218
  except GitCommandError as error:
217
219
  logger.debug(f"Git checkout error:{error}")
218
220
  success = False
219
221
 
220
222
  if not success:
221
- repo = Repo.clone_from(git_url, target_dir)
222
- clone_default_branch_flag = True
223
+ Repo.clone_from(git_url, target_dir)
223
224
  success = True
224
-
225
- if refs_to_checkout != tag or clone_default_branch_flag:
226
- oss_version = repo.active_branch.name
227
- else:
228
- oss_version = repo.git.describe('--tags')
229
225
  return success, oss_version
230
226
 
231
227
 
@@ -5,8 +5,10 @@
5
5
 
6
6
  import os
7
7
  import fnmatch
8
+ from typing import List
8
9
 
9
- def excluding_files(patterns: list[str], path_to_scan: str) -> list[str]:
10
+
11
+ def excluding_files(patterns: List[str], path_to_scan: str) -> List[str]:
10
12
  excluded_paths = set()
11
13
 
12
14
  # Normalize patterns: e.g., 'sample/', 'sample/*' -> 'sample'
@@ -48,7 +48,8 @@ def check_output_format(output='', format='', customized_format={}):
48
48
  if format:
49
49
  if output_extension != basename_extension:
50
50
  success = False
51
- msg = f"(-o & -f option) Enter the same extension of output file(-o:'{output}') with format(-f:'{format}')."
51
+ msg = f"(-o & -f option) Enter the same extension of output file(-o:'{output}') \
52
+ with format(-f:'{format}')."
52
53
  else:
53
54
  if basename_extension not in support_format.values():
54
55
  success = False
@@ -96,7 +97,8 @@ def check_output_formats(output='', formats=[], customized_format={}):
96
97
  if formats:
97
98
  if basename_extension not in output_extensions:
98
99
  success = False
99
- msg = f"(-o & -f option) The format of output file(-o:'{output}') should be in the format list(-f:'{formats}')."
100
+ msg = f"(-o & -f option) The format of output file(-o:'{output}') \
101
+ should be in the format list(-f:'{formats}')."
100
102
  else:
101
103
  if basename_extension not in support_format.values():
102
104
  success = False
@@ -145,7 +147,8 @@ def check_output_formats_v2(output='', formats=[], customized_format={}):
145
147
  if formats:
146
148
  if basename_extension not in output_extensions:
147
149
  success = False
148
- msg = f"(-o & -f option) The format of output file(-o:'{output}') should be in the format list(-f:'{formats}')."
150
+ msg = f"(-o & -f option) The format of output file(-o:'{output}') \
151
+ should be in the format list(-f:'{formats}')."
149
152
  else:
150
153
  if basename_extension not in support_format.values():
151
154
  success = False
@@ -5,16 +5,11 @@
5
5
  # SPDX-License-Identifier: Apache-2.0
6
6
 
7
7
  import os
8
- import sys
9
8
  import logging
10
9
  import re
11
- import json
12
10
  from pathlib import Path
13
- from datetime import datetime
14
- from fosslight_util.spdx_licenses import get_spdx_licenses_json, get_license_from_nick
15
11
  from fosslight_util.constant import (LOGGER_NAME, FOSSLIGHT_DEPENDENCY, FOSSLIGHT_SCANNER,
16
- FOSSLIGHT_BINARY, FOSSLIGHT_SOURCE)
17
- from fosslight_util.oss_item import CHECKSUM_NULL, get_checksum_sha1
12
+ FOSSLIGHT_SOURCE)
18
13
  import traceback
19
14
 
20
15
  logger = logging.getLogger(LOGGER_NAME)
@@ -27,14 +22,11 @@ try:
27
22
  from cyclonedx.model import XsUri, ExternalReferenceType
28
23
  from cyclonedx.model.bom import Bom
29
24
  from cyclonedx.model.component import Component, ComponentType, HashAlgorithm, HashType, ExternalReference
30
- from cyclonedx.model.contact import OrganizationalEntity
31
25
  from cyclonedx.output import make_outputter, BaseOutput
32
26
  from cyclonedx.output.json import JsonV1Dot6
33
27
  from cyclonedx.schema import OutputFormat, SchemaVersion
34
- from cyclonedx.validation import make_schemabased_validator
35
28
  from cyclonedx.validation.json import JsonStrictValidator
36
29
  from cyclonedx.output.json import Json as JsonOutputter
37
- from cyclonedx.output.xml import Xml as XmlOutputter
38
30
  from cyclonedx.validation.xml import XmlValidator
39
31
  except Exception:
40
32
  logger.info('No import cyclonedx-python-lib')
@@ -66,7 +58,6 @@ def write_cyclonedx(output_file_without_ext, output_extension, scan_item):
66
58
  type=ComponentType.APPLICATION,
67
59
  bom_ref=str(comp_id))
68
60
  relation_tree = {}
69
- bom_ref_packages = []
70
61
 
71
62
  output_dir = os.path.dirname(output_file_without_ext)
72
63
  Path(output_dir).mkdir(parents=True, exist_ok=True)
@@ -113,7 +104,7 @@ def write_cyclonedx(output_file_without_ext, output_extension, scan_item):
113
104
  try:
114
105
  oss_licenses.append(lc_factory.make_from_string(ol))
115
106
  except Exception:
116
- logger.info(f'No spdx license name: {oi}')
107
+ logger.info(f'No spdx license name: {ol}')
117
108
  if oss_licenses:
118
109
  comp.licenses = oss_licenses
119
110
 
@@ -192,9 +183,9 @@ def write_cyclonedx_json(bom, result_file):
192
183
  except MissingOptionalDependencyException as error:
193
184
  logger.debug(f'JSON-validation was skipped due to {error}')
194
185
  except Exception as e:
186
+ logger.warning(f'Fail to write cyclonedx json: {e}')
195
187
  success = False
196
188
  return success
197
-
198
189
 
199
190
 
200
191
  def write_cyclonedx_xml(bom, result_file):
@@ -213,5 +204,6 @@ def write_cyclonedx_xml(bom, result_file):
213
204
  except MissingOptionalDependencyException as error:
214
205
  logger.debug(f'XML-validation was skipped due to {error}')
215
206
  except Exception as e:
207
+ logger.warning(f'Fail to write cyclonedx xml: {e}')
216
208
  success = False
217
- return success
209
+ return success
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fosslight-util
3
- Version: 2.1.9
3
+ Version: 2.1.11
4
4
  Summary: FOSSLight Util
5
5
  Home-page: https://github.com/fosslight/fosslight_util
6
6
  Author: LG Electronics
File without changes