fosslight-util 2.1.22__tar.gz → 2.1.24__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_util-2.1.22 → fosslight_util-2.1.24}/PKG-INFO +1 -1
- {fosslight_util-2.1.22 → fosslight_util-2.1.24}/setup.py +1 -1
- {fosslight_util-2.1.22 → fosslight_util-2.1.24}/src/fosslight_util/_get_downloadable_url.py +62 -8
- {fosslight_util-2.1.22 → fosslight_util-2.1.24}/src/fosslight_util/download.py +3 -1
- {fosslight_util-2.1.22 → fosslight_util-2.1.24}/src/fosslight_util.egg-info/PKG-INFO +1 -1
- {fosslight_util-2.1.22 → fosslight_util-2.1.24}/LICENSE +0 -0
- {fosslight_util-2.1.22 → fosslight_util-2.1.24}/MANIFEST.in +0 -0
- {fosslight_util-2.1.22 → fosslight_util-2.1.24}/README.md +0 -0
- {fosslight_util-2.1.22 → fosslight_util-2.1.24}/requirements.txt +0 -0
- {fosslight_util-2.1.22 → fosslight_util-2.1.24}/setup.cfg +0 -0
- {fosslight_util-2.1.22 → fosslight_util-2.1.24}/src/fosslight_util/__init__.py +0 -0
- {fosslight_util-2.1.22 → fosslight_util-2.1.24}/src/fosslight_util/compare_yaml.py +0 -0
- {fosslight_util-2.1.22 → fosslight_util-2.1.24}/src/fosslight_util/constant.py +0 -0
- {fosslight_util-2.1.22 → fosslight_util-2.1.24}/src/fosslight_util/correct.py +0 -0
- {fosslight_util-2.1.22 → fosslight_util-2.1.24}/src/fosslight_util/cover.py +0 -0
- {fosslight_util-2.1.22 → fosslight_util-2.1.24}/src/fosslight_util/exclude.py +0 -0
- {fosslight_util-2.1.22 → fosslight_util-2.1.24}/src/fosslight_util/help.py +0 -0
- {fosslight_util-2.1.22 → fosslight_util-2.1.24}/src/fosslight_util/oss_item.py +0 -0
- {fosslight_util-2.1.22 → fosslight_util-2.1.24}/src/fosslight_util/output_format.py +0 -0
- {fosslight_util-2.1.22 → fosslight_util-2.1.24}/src/fosslight_util/parsing_yaml.py +0 -0
- {fosslight_util-2.1.22 → fosslight_util-2.1.24}/src/fosslight_util/read_excel.py +0 -0
- {fosslight_util-2.1.22 → fosslight_util-2.1.24}/src/fosslight_util/resources/frequentLicenselist.json +0 -0
- {fosslight_util-2.1.22 → fosslight_util-2.1.24}/src/fosslight_util/resources/frequent_license_nick_list.json +0 -0
- {fosslight_util-2.1.22 → fosslight_util-2.1.24}/src/fosslight_util/resources/licenses.json +0 -0
- {fosslight_util-2.1.22 → fosslight_util-2.1.24}/src/fosslight_util/set_log.py +0 -0
- {fosslight_util-2.1.22 → fosslight_util-2.1.24}/src/fosslight_util/spdx_licenses.py +0 -0
- {fosslight_util-2.1.22 → fosslight_util-2.1.24}/src/fosslight_util/timer_thread.py +0 -0
- {fosslight_util-2.1.22 → fosslight_util-2.1.24}/src/fosslight_util/write_cyclonedx.py +0 -0
- {fosslight_util-2.1.22 → fosslight_util-2.1.24}/src/fosslight_util/write_excel.py +0 -0
- {fosslight_util-2.1.22 → fosslight_util-2.1.24}/src/fosslight_util/write_opossum.py +0 -0
- {fosslight_util-2.1.22 → fosslight_util-2.1.24}/src/fosslight_util/write_scancodejson.py +0 -0
- {fosslight_util-2.1.22 → fosslight_util-2.1.24}/src/fosslight_util/write_spdx.py +0 -0
- {fosslight_util-2.1.22 → fosslight_util-2.1.24}/src/fosslight_util/write_txt.py +0 -0
- {fosslight_util-2.1.22 → fosslight_util-2.1.24}/src/fosslight_util/write_yaml.py +0 -0
- {fosslight_util-2.1.22 → fosslight_util-2.1.24}/src/fosslight_util.egg-info/SOURCES.txt +0 -0
- {fosslight_util-2.1.22 → fosslight_util-2.1.24}/src/fosslight_util.egg-info/dependency_links.txt +0 -0
- {fosslight_util-2.1.22 → fosslight_util-2.1.24}/src/fosslight_util.egg-info/entry_points.txt +0 -0
- {fosslight_util-2.1.22 → fosslight_util-2.1.24}/src/fosslight_util.egg-info/requires.txt +0 -0
- {fosslight_util-2.1.22 → fosslight_util-2.1.24}/src/fosslight_util.egg-info/top_level.txt +0 -0
|
@@ -190,6 +190,28 @@ def get_download_location_for_go(link):
|
|
|
190
190
|
return ret, new_link
|
|
191
191
|
|
|
192
192
|
|
|
193
|
+
def get_available_wheel_urls(name, version):
|
|
194
|
+
try:
|
|
195
|
+
api_url = f'https://pypi.org/pypi/{name}/{version}/json'
|
|
196
|
+
response = requests.get(api_url)
|
|
197
|
+
if response.status_code == 200:
|
|
198
|
+
data = response.json()
|
|
199
|
+
wheel_urls = []
|
|
200
|
+
|
|
201
|
+
for file_info in data.get('urls', []):
|
|
202
|
+
if file_info.get('packagetype') == 'bdist_wheel':
|
|
203
|
+
wheel_urls.append(file_info.get('url'))
|
|
204
|
+
|
|
205
|
+
return wheel_urls
|
|
206
|
+
else:
|
|
207
|
+
logger.warning(f'Cannot get PyPI API data for {name}({version})')
|
|
208
|
+
return []
|
|
209
|
+
|
|
210
|
+
except Exception as error:
|
|
211
|
+
logger.warning(f'Failed to get wheel URLs from PyPI API: {error}')
|
|
212
|
+
return []
|
|
213
|
+
|
|
214
|
+
|
|
193
215
|
def get_download_location_for_pypi(link):
|
|
194
216
|
# get the url for downloading source file: https://docs.pypi.org/api/ Predictable URLs
|
|
195
217
|
ret = False
|
|
@@ -202,24 +224,56 @@ def get_download_location_for_pypi(link):
|
|
|
202
224
|
oss_name = re.sub(r"[-_.]+", "-", oss_name)
|
|
203
225
|
oss_version = dn_loc_re[0][1]
|
|
204
226
|
|
|
227
|
+
# 1. Source distribution 시도
|
|
205
228
|
new_link = f'{host}/packages/source/{oss_name[0]}/{oss_name}/{oss_name}-{oss_version}.tar.gz'
|
|
206
229
|
try:
|
|
207
230
|
res = urlopen(new_link)
|
|
208
231
|
if res.getcode() == 200:
|
|
209
232
|
ret = True
|
|
210
|
-
|
|
211
|
-
logger.warning(f'Cannot find the valid link for pypi (url:{new_link}')
|
|
233
|
+
return ret, new_link
|
|
212
234
|
except Exception:
|
|
213
235
|
oss_name = re.sub(r"[-]+", "_", oss_name)
|
|
214
236
|
new_link = f'{host}/packages/source/{oss_name[0]}/{oss_name}/{oss_name}-{oss_version}.tar.gz'
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
237
|
+
try:
|
|
238
|
+
res = urlopen(new_link)
|
|
239
|
+
if res.getcode() == 200:
|
|
240
|
+
ret = True
|
|
241
|
+
return ret, new_link
|
|
242
|
+
except Exception:
|
|
243
|
+
pass
|
|
244
|
+
|
|
245
|
+
# 2. Source distribution이 없으면 wheel 파일들을 시도
|
|
246
|
+
wheel_urls = get_available_wheel_urls(oss_name, oss_version)
|
|
247
|
+
|
|
248
|
+
if wheel_urls:
|
|
249
|
+
# Pure Python wheel을 우선적으로 찾기
|
|
250
|
+
for wheel_url in wheel_urls:
|
|
251
|
+
if 'py3-none-any' in wheel_url or 'py2.py3-none-any' in wheel_url:
|
|
252
|
+
try:
|
|
253
|
+
res = urlopen(wheel_url)
|
|
254
|
+
if res.getcode() == 200:
|
|
255
|
+
ret = True
|
|
256
|
+
new_link = wheel_url
|
|
257
|
+
logger.info(f'Using wheel file : {wheel_url}')
|
|
258
|
+
return ret, new_link
|
|
259
|
+
except Exception:
|
|
260
|
+
continue
|
|
261
|
+
|
|
262
|
+
# Pure Python wheel이 없으면 첫 번째 wheel 시도
|
|
263
|
+
if wheel_urls:
|
|
264
|
+
try:
|
|
265
|
+
res = urlopen(wheel_urls[0])
|
|
266
|
+
if res.getcode() == 200:
|
|
267
|
+
ret = True
|
|
268
|
+
new_link = wheel_urls[0]
|
|
269
|
+
logger.info(f'Using wheel file : {wheel_urls[0]}')
|
|
270
|
+
return ret, new_link
|
|
271
|
+
except Exception:
|
|
272
|
+
pass
|
|
273
|
+
|
|
220
274
|
except Exception as error:
|
|
221
275
|
ret = False
|
|
222
|
-
logger.warning(f'Cannot find the link for pypi (url:{link}({
|
|
276
|
+
logger.warning(f'Cannot find the link for pypi (url:{link}({new_link})) e:{str(error)}')
|
|
223
277
|
|
|
224
278
|
return ret, new_link
|
|
225
279
|
|
|
@@ -30,7 +30,7 @@ import urllib.parse
|
|
|
30
30
|
import json
|
|
31
31
|
|
|
32
32
|
logger = logging.getLogger(constant.LOGGER_NAME)
|
|
33
|
-
compression_extension = {".tar.bz2", ".tar.gz", ".tar.xz", ".tgz", ".tar", ".zip", ".jar", ".bz2"}
|
|
33
|
+
compression_extension = {".tar.bz2", ".tar.gz", ".tar.xz", ".tgz", ".tar", ".zip", ".jar", ".bz2", ".whl"}
|
|
34
34
|
prefix_refs = ["refs/remotes/origin/", "refs/tags/"]
|
|
35
35
|
SIGNAL_TIMEOUT = 600
|
|
36
36
|
|
|
@@ -400,6 +400,8 @@ def extract_compressed_file(fname, extract_path, remove_after_extract=True, comp
|
|
|
400
400
|
unzip(fname, extract_path)
|
|
401
401
|
elif fname.endswith(".bz2"):
|
|
402
402
|
decompress_bz2(fname, extract_path)
|
|
403
|
+
elif fname.endswith(".whl"):
|
|
404
|
+
unzip(fname, extract_path)
|
|
403
405
|
else:
|
|
404
406
|
is_compressed_file = False
|
|
405
407
|
if compressed_only:
|
|
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
|
|
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_util-2.1.22 → fosslight_util-2.1.24}/src/fosslight_util.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{fosslight_util-2.1.22 → fosslight_util-2.1.24}/src/fosslight_util.egg-info/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|