tis-waptpython-wheel
0.41.1-10
A built-package format for Python
898 téléchargements
Voir le résultat de la construction Voir l'analyse de VirusTotal
![tis-waptpython-wheel icon](/wapt/icons/3307da49dca7842503f3369c908cd625f2b16276a8690e4dd37c08a057580c44.png)
Description
- package : tis-waptpython-wheel
- name : waptpython wheel
- version : 0.41.1-10
- categories : Development
- maintainer : WAPT Team,Tranquil IT,Jimmy PELÉ
- installed_size : 194265
- editor :
- licence :
- signature_date : 2023-08-12T14:03:17.389687
- size : 72.28 Ko
- locale : all
- target_os : all
- impacted_process :
- architecture : all
control
package : tis-waptpython-wheel
version : 0.41.1-10
architecture : all
section : base
priority : optional
name : waptpython wheel
categories : Development
maintainer : WAPT Team,Tranquil IT,Jimmy PELÉ
description : A built-package format for Python
depends :
conflicts :
maturity : PROD
locale : all
target_os : all
min_wapt_version : 2.3
sources : https://pypi.org/project/wheel/#files
installed_size : 194265
impacted_process :
description_fr :
description_pl :
description_de :
description_es :
description_pt :
description_it :
description_nl :
description_ru :
audit_schedule :
editor :
keywords : python,wheel,pypi,package,packaging
licence :
homepage :
package_uuid : 009505d2-4ec7-433d-8be3-fa9f7a2ba253
valid_from :
valid_until :
forced_install_on :
changelog : https://wheel.readthedocs.io/en/stable/news.html
min_os_version :
max_os_version :
icon_sha256sum : 3307da49dca7842503f3369c908cd625f2b16276a8690e4dd37c08a057580c44
signer : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature : sbWxGTzQeXmPAxExrDurQKIM0LM/Jq+0IyL5lqTUl63GfHOBETv1SR4Zw+7aOpokKBhS204Mj+ERjwwT80HDxP1oMbBsirJpIUDXKlm+RHFaX2TqXUGGKrwftBpVj/rWL2iGnqODBbf3ObDWbFut/RVKKZiDdMAtUa/lu+lBUBZgP7HbCjv3hLWu+fRn2u38rs9eNtvLbBJshFghfkBF6hCGC0afVA6x0dF7Rr6JZMwSpYzljTNstpymUroZLO1052zb2Hdizq5HEaBdxuSRMbpTUI3ieRAuwMi3PTYjdVxld1NRcPESfpUzyHjtIQ3qbP87YAHBK8SxbPVWA9MqXg==
signature_date : 2023-08-12T14:03:17.389687
signed_attributes : package,version,architecture,section,priority,name,categories,maintainer,description,depends,conflicts,maturity,locale,target_os,min_wapt_version,sources,installed_size,impacted_process,description_fr,description_pl,description_de,description_es,description_pt,description_it,description_nl,description_ru,audit_schedule,editor,keywords,licence,homepage,package_uuid,valid_from,valid_until,forced_install_on,changelog,min_os_version,max_os_version,icon_sha256sum,signer,signer_fingerprint,signature_date,signed_attributes
Setup.py
# -*- coding: utf-8 -*-
from setuphelpers import *
import os
import sys
libdev_dir = os.sep.join([sys.executable.rsplit(os.path.sep, 1)[0].replace("/bin", ""), "libdev"])
libdev_sp_dir = os.sep.join([sys.executable.rsplit(os.path.sep, 1)[0].replace("/bin", ""), "libdev", "site-packages"])
sys.path.insert(0, libdev_dir)
sys.path.insert(0, libdev_sp_dir)
package_name = "wheel"
install_in_libdev = False # False with lib generating bins and if any dependencies are present in "lib", then remove them from requirements.txt
def install():
bin_name = glob.glob(f"{package_name}/{package_name}-*.whl")[0]
for lib_dir in glob.glob(f"{libdev_sp_dir}/{package_name}*/"):
remove_tree(lib_dir)
if install_in_libdev:
mkdirs(libdev_sp_dir)
unzip(bin_name, libdev_sp_dir)
else:
if get_os_name() == "Windows":
lib_sp_dir = os.sep.join([sys.executable.rsplit(os.path.sep, 1)[0], "lib", "site-packages"])
else:
lib_sp_dir = os.sep.join([sys.executable.rsplit(os.path.sep, 1)[0].replace("/bin", "/lib/python3.8/"), "site-packages"])
for lib_dir in glob.glob(f"{lib_sp_dir}/{package_name}*/"):
remove_tree(lib_dir)
unzip(bin_name, lib_sp_dir)
def audit():
audit_status = "OK"
audit_pip_package = str(run(f'"{get_waptpython_path()}" -m pip show {package_name}', accept_returncodes=[0, 1, 3010]))
print(audit_pip_package)
if "not found" in audit_pip_package and WAPT.is_installed(control.package.split("-", 1)[0] + "-waptpython-pip"):
print(f"Reinstalling: {control.package}")
WAPT.install(control.package, force=True)
audit_status = "WARNING"
return audit_status
def uninstall():
for lib_dir in glob.glob(f"{libdev_sp_dir}/{package_name}*/"):
remove_tree(lib_dir)
def get_waptpython_path():
if get_os_name() == "Windows":
return makepath(WAPT.wapt_base_dir, "waptpython.exe")
else:
return makepath(WAPT.wapt_base_dir, "waptpython.sh")
update_package.py
# -*- coding: utf-8 -*-
from setuphelpers import *
import os
import sys
libdev_dir = os.sep.join([sys.executable.rsplit(os.path.sep, 1)[0].replace("/bin", ""), "libdev"])
libdev_sp_dir = os.sep.join([sys.executable.rsplit(os.path.sep, 1)[0].replace("/bin", ""), "libdev", "site-packages"])
sys.path.insert(0, libdev_dir)
sys.path.insert(0, libdev_sp_dir)
package_name = "wheel"
python_version = "".join(str(x) for x in sys.version_info[:2])
def update_package():
# Declaring local variables
package_updated = False
proxies = get_proxies()
if not proxies:
proxies = get_proxies_from_wapt_console()
api_url = f"https://pypi.org/pypi/{package_name}/json"
index_url = None
# index_url = "https://pip.ad.tranquil.it/"
# fixed_version = "9.5.0"
fixed_version = None
# Downloading whl files in package_name folder
if isfile("requirements.txt"):
pip_download_cmd = f'"{get_waptpython_path()}" -m pip download {package_name} --only-binary=:all: --dest "{package_name}"'
else:
pip_download_cmd = f'"{get_waptpython_path()}" -m pip download -r requirements.txt --only-binary=:all: --dest "{package_name}"'
if index_url:
pip_download_cmd += f' --index-url="{index_url}"'
elif proxies:
pip_download_cmd += f' --proxy="{proxies["http"]}"'
print(run(pip_download_cmd))
# Getting latest version information from official sources
print("API used is: %s" % api_url)
json_load = wgets(api_url, proxies=proxies, as_json=True)
if fixed_version:
json_search = json_load["releases"][fixed_version]
version = fixed_version
else:
json_search = json_load["urls"]
version = json_load["info"]["version"]
for to_download in json_search:
filename = to_download["filename"]
if ".whl" in filename and ("-py3-" in filename or f"cp{python_version}" in filename):
download_url = to_download["url"]
latest_bin = package_name + os.sep + filename
if not isfile(latest_bin):
print("Downloading: %s" % latest_bin)
wget(download_url, latest_bin, proxies=proxies)
else:
print("Binary is present: %s" % latest_bin)
# Deleting outdated binaries
for f in glob.glob("*.whl"):
print("Removing: %s" % f)
remove_file(f)
# Deleting other binaries
for f in glob.glob(f'{package_name}/{json_load["info"]["name"]}*.whl'): # filename.split("-")[0]
if not version in f:
print("Removing: %s" % f)
remove_file(f)
# Deleting other dirs
for dir_name in glob.glob("*/"):
dir_name = dir_name.split(os.sep)[0]
if not dir_name in ["WAPT", "__pycache__"] and not package_name in dir_name:
remove_tree(dir_name)
# generate_requirements_txt
if not isfile("requirements.txt"):
generate_requirements_txt(package_name, glob.glob(f"{package_name}/*.whl"))
else:
with open("requirements.txt") as f:
requirements_list = f.read().split("\n")
requirements_list = [a.split("==")[0] for a in requirements_list]
for package in glob.glob(f"{package_name}/*.whl"):
package_info = package.split(os.sep)[-1].split("-")
name = package_info[0].replace("_", "-").lower()
if not name in requirements_list:
remove_file(package)
# control autocompletion
api_url = f"https://pypi.org/pypi/{package_name}/json"
json_load = wgets(api_url, proxies=proxies, as_json=True)
control.package = control.package.split("-", 1)[0] + "-waptpython-" + json_load["info"]["name"].lower()
control.name = "waptpython " + json_load["info"]["name"]
control.installed_size = get_size(package_name) * 3
if json_load["info"].get("keywords") is not None and json_load["info"]["keywords"]:
print(f'You may wanna add: "{json_load["info"]["keywords"].lower()}" in: "control.keywords"')
control.description = json_load["info"]["summary"]
if json_load["info"]["project_urls"].get("Changelog") is not None and json_load["info"]["project_urls"]["Changelog"]:
control.changelog = json_load["info"]["project_urls"]["Changelog"]
control.sources = json_load["info"]["package_url"] + "#files"
if json_load["info"]["project_urls"].get("Homepage") is not None and json_load["info"]["project_urls"]["Homepage"]:
control.homepage = json_load["info"]["project_urls"]["Homepage"]
# Changing version of the package
if Version(version, 4) > Version(control.get_software_version(), 4):
print("Software version updated (from: %s to: %s)" % (control.get_software_version(), Version(version)))
package_updated = True
else:
print("Software version up-to-date (%s)" % Version(version))
control.set_software_version(version)
control.save_control_to_wapt()
# Validating update-package-sources
return package_updated
# # Changing version of the package and validating update-package-sources
# return complete_control_version(control, version)
def generate_requirements_txt(package_name, packages_list):
latest_versions = {}
for package in packages_list:
package_info = package.split(os.sep)[-1].split("-")
name = package_info[0].replace("_", "-").lower()
version = package_info[1]
if name not in latest_versions:
latest_versions[name] = version
else:
if version > latest_versions[name]:
latest_versions[name] = version
# if name == package_name:
# requirements_content = [f"{name}=={version}" for name, version in latest_versions.items()]
# else:
# requirements_content = [f"{name}" for name, version in latest_versions.items()]
requirements_content = [f"{name}" for name, version in latest_versions.items()]
with open("requirements.txt", "w", newline="\n") as requirements_file:
requirements_file.write("\n".join(requirements_content))
def get_waptpython_path():
if get_os_name() == "Windows":
return makepath(WAPT.wapt_base_dir, "waptpython.exe")
else:
return makepath(WAPT.wapt_base_dir, "waptpython.sh")
def get_size(start_path="."):
total_size = 0
for dirpath, dirnames, filenames in os.walk(start_path):
for f in filenames:
fp = os.path.join(dirpath, f)
# skip if it is symbolic link
if not os.path.islink(fp):
total_size += os.path.getsize(fp)
return total_size
0a0619ef92ebd79e5e414ceb17e86811dc259827f38aeb3c461a1798f52b3132 : setup.py
: __pycache__
473219bd4cbedc62cea0cb309089b593e47c15c4a2531015f94e4e3b9a0f6981 : wheel/wheel-0.41.1-py3-none-any.whl
b798b04958e7c1e7f57235aeeda1b913fe0719f4fdb28762536eb276c5cfbbea : update_package.py
ba59926159d2aa256eb8739b8da7e2b574b960e1202c6d624cbe981cef996c91 : requirements.txt
3307da49dca7842503f3369c908cd625f2b16276a8690e4dd37c08a057580c44 : WAPT/icon.png
a5a97261381e1d0ad46ee15916abec9c2631d0201f5cc50ceb0197a165a0bbbf : WAPT/certificate.crt
f17961d336d957e68b601e6e02af1cfae60999212c983dda6e699cbd0274a324 : luti.json
2d067a1221ce09ed5b5dc67e98749661db21287c9fc9aa3996e539db7e53ab25 : WAPT/control