tis-waptpython-black icon

waptpython black

Silent install package for waptpython black

26.3.0-23
Development
Development

Preprod packages are packages built on LUTI. They remain in PREPROD usually for 5 days, after which a second VirusTotal scan is performed to verify that the status has not changed.
If the package passes this last check, it is promoted to PROD and published on the store.

  • package: tis-waptpython-black
  • name: waptpython black
  • version: 26.3.0-23
  • categories: Development
  • maintainer: WAPT Team,Tranquil IT,Flavien SCHELFAUT
  • locale: all
  • target_os: all
  • architecture: all
  • signature_date:
  • size: 214.83 Ko
  • installed_size: 25.75 Mo
  • homepage : https://github.com/psf/black

package           : tis-waptpython-black
version           : 26.3.0-23
architecture      : all
section           : base
priority          : optional
name              : waptpython black
categories        : Development
maintainer        : WAPT Team,Tranquil IT,Flavien SCHELFAUT
description       : The uncompromising code formatter.
depends           : 
conflicts         : 
maturity          : PREPROD
locale            : all
target_os         : all
min_wapt_version  : 2.3
sources           : https://pypi.org/project/black/#files
installed_size    : 25752681
impacted_process  : 
description_fr    : 
description_pl    : 
description_de    : 
description_es    : 
description_pt    : 
description_it    : 
description_nl    : 
description_ru    : 
audit_schedule    : 2h
editor            : 
keywords          : waptpython,python,pip,pypi,package,black,automation,autopep8,formatter,gofmt,pyfmt,rustfmt,yapf
licence           : 
homepage          : https://github.com/psf/black
package_uuid      : 6dbacf2f-0c8f-4761-b260-925c0f3ce277
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : https://github.com/psf/black/blob/main/CHANGES.md
min_os_version    : 
max_os_version    : 
icon_sha256sum    : 3307da49dca7842503f3369c908cd625f2b16276a8690e4dd37c08a057580c44
signer            : test
signer_fingerprint: b82fc8ef4a4475c0f69ac168176c2bfc58f572eb716c4eadd65e4785c155dd8e
signature_date    : 2026-03-06T18:35:25.000000
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
signature         : nrgFOYUhYEY5G5/igKmNhqng7Mef55KkDB7fc42KPJIT/1Wy5pAj/UhOrKhyfT08sUEbZSDNrlGLsbgTWTT3T1Z0jASINv6ezm9KFlxVbLEThBt78RbxAmRrWVGTOrs+2/QaqEGajyoXHWPkX9XdK6wT6TxE54jHKVZqspA2eIxMsZTsIQpTQAiyy1rnlNqN1zzUUzd9WeIOdtI9/lsvKfX2etSOTUSDaJZsxuKKE9BljczygN2dYaRosed++qrFM7Ty52bVmM6iJOr2YYqRrOw+G+GpbvtBBYIEttNcsDCWrA9w1AVkoyzXfTNbxukpk0jeaBIF57ciessJAe71NQ==

# -*- coding: utf-8 -*-
from setuphelpers import *
from setupdevhelpers import *
import sysconfig
import zipfile


waptpython_lib_sp_dir = sysconfig.get_paths()["purelib"]

def install():
    bin_name = glob.glob('black*.whl')[0]

    #unzip(bin_name, waptpython_lib_sp_dir)

    # This code below is temporary, while waiting for the unzip function to be rewritten
    with zipfile.ZipFile(bin_name, "r") as zf:
        zf.extractall(waptpython_lib_sp_dir)


def audit():
    
    black_python_version = makepath(waptpython_lib_sp_dir, '_black_version.py')
    black_lib_folder = makepath(waptpython_lib_sp_dir, 'black')
    
    with open(black_python_version) as f:
        lines = f.readlines()
    
    version = next((line.split('=')[-1].strip(' "\n') for line in lines if 'version =' in line), None)
        
    is_latest_version = Version(version) == Version(control.get_software_version())
    
    if not (isdir(black_lib_folder) and is_latest_version):
        return "ERROR"
    
    return "OK"

def uninstall():
    
    pip_unzip_content = [
        'black', 'blackd', 'blib2to3',
        f'black-{control.get_software_version()}.dist-info',
        '_black_version.py'
    ]
    
    for file in pip_unzip_content:
        path_file = makepath(waptpython_lib_sp_dir, file)
        if isfile(path_file):
            remove_file(path_file)
        elif isdir(path_file):
            remove_tree(path_file)

# -*- coding: utf-8 -*-
from setuphelpers import *
from setupdevhelpers import *


def update_package():
    # Declaring local variables
    package_updated = False
    proxies = get_proxies()
    if not proxies:
        proxies = get_proxies_from_wapt_console()

    name_pypi = "black"
    wanted_file = "py3-none-any.whl"

    api_url = f"https://pypi.org/pypi/{name_pypi}/json"

    data = wgets(api_url, proxies=proxies, as_json=True)
    version = data['info']['version']
    latest_release_binaries = data['releases'][version]

    for f in latest_release_binaries:
        if not f['yanked'] and f['url'].endswith(wanted_file):
            download_url = f['url']
            sumsha256 = f['digests']['sha256']
            break

    whl = download_url.split('/')[-1]

    wget(download_url, whl, sha256=sumsha256, proxies=proxies)

    for f in glob.glob('*.whl'):
        if f != whl:
            remove_file(f)

    # Changing version of the package
    if Version(version) > Version(control.get_software_version()):
        print(f"Software version updated (from: {control.get_software_version()} to: {Version(version)})")
        package_updated = True
    else:
        print(f"Software version up-to-date ({Version(version)})")

    control.set_software_version(version)
    control.save_control_to_wapt()

    # Validating update-package-sources
    return package_updated

01ca7fe94636e5a08fcb73849d3b5df25d51e2c82f4dd1a08f01798b25899819 : WAPT/certificate.crt
e1a1f17f998ab2c11d3f5d243359f070c8d5958cc95c04df641942fcecde863b : WAPT/control
3307da49dca7842503f3369c908cd625f2b16276a8690e4dd37c08a057580c44 : WAPT/icon.png
e825d6b121910dff6f04d7691f826d2449327e8e71c26254c030c4f3d2311985 : black-26.3.0-py3-none-any.whl
5d71ccf9382d45550cfa36d2dbd06bd5bf0344e013d2b4ea55457b9e8c90fcbe : luti.json
1bb59e1285552694bf2fe780e7fb5ad82bf47719793410861ca9588385a435ef : setup.py
673e2ff7effd2b81c38418d14d64518c76e6fdd95758660640320bca24d7660b : update_package.py