tis-anaconda3

2020.7-10
Anaconda is a free and open-source distribution of the Python and R programming languages for scientific computing
274 downloads
Download

  Description 

  • package : tis-anaconda3
  • version : 2020.7-10
  • architecture : x86
  • categories : Development,Education
  • maintainer : WAPT Team,Tranquil IT,Jimmy PELÉ
  • description : Anaconda is a free and open-source distribution of the Python and R programming languages for scientific computing
  • locale :
  • target_os : windows
  • min_os_version : 6.1
  • max_os_version :
  • min_wapt_version : 1.7
  • sources : https://www.anaconda.com/products/individual
  • installed_size :
  • impacted_process : _conda
  • description_fr : Anaconda est une distribution libre des langages de programmation Python et R appliqué au développement d'applications dédiées à la science des données
  • description_pl :
  • description_de :
  • description_es :
  • description_pt :
  • description_it :
  • description_nl :
  • description_ru :
  • editor : Anaconda, Inc.
  • licence : New BSD License
  • signature_date : 2020-09-21T12:39:00.701795
  • Homepage : https://www.anaconda.com/

  Setup.py 

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

#Anaconda3 2020.07 (Python 3.8.3 32-bit)    Anaconda3 2020.07 (Python 3.8.3 32-bit)     2020.07     "C:\ProgramData\Anaconda3\Uninstall-Anaconda3.exe"
# Installation procedure: https://docs.anaconda.com/anaconda/install/silent-mode/

uninstallkey = []

# Defining variables
bin_name_string = 'Anaconda3-%s-Windows-x86.exe'
app_dir = makepath(programfiles, 'Anaconda3')
conda_python = makepath(app_dir, 'python.exe')
conda_path = makepath(app_dir, 'Scripts', 'conda.exe')
silent_args = '/S /InstallationType=AllUsers /AddToPath=1 /RegisterPython=0 /D=%s' % app_dir
#silent_args = '/S /InstallationType=AllUsers /AddToPath=1 /RegisterPython=0'
app_uninstallkey_string = 'Anaconda3 %s (Python %s %s-bit)'


def install():
    # Initializing variables
    bin_name = glob.glob('%s*.exe' % bin_name_string.split('%s')[0])[0]
    package_version = bin_name.split('-')[1]
    app_name = control.name
    if control.architecture == 'x64':
        arch = '64'
    else:
        arch = '32'

    # Uninstalling versions not located to defined directory
    for uninstall in installed_softwares(name='Anaconda3'):
        if not uninstall['uninstall_string'].startswith('"%s' % app_dir):
            print('Uninstalling: %s' % uninstall['name'])
            run(uninstall_cmd(uninstall['key']))
            time.sleep(180)

    # Installing the package
    def conda_python_version():
        return get_version_from_binary(conda_python)

    # Checking manually if the application is installed
    if need_install(key=app_uninstallkey_string % (package_version, conda_python_version(), arch), min_version=package_version):
        print('Installing: %s' % bin_name)
        run('"%s" %s' % (makepath(basedir, bin_name), silent_args), timeout=1800)

        # Adding manually the uninstallkey
        uninstallkey.append(app_uninstallkey_string % (package_version, conda_python_version(), control.architecture.replace('x','')))
    else:
        print('%s is already installed' % app_uninstallkey_string % (package_version, conda_python_version(), control.architecture.replace('x','')))

    # Prevent interaction with waptpython (make sure that the following code require the defined path)
    if "PYTHONHOME" in os.environ.keys():
        del os.environ["PYTHONHOME"]
    if "PYTHONPATH" in os.environ.keys():
        del os.environ["PYTHONPATH"]
    os.environ["PYTHONPATH"] = app_dir
    os.environ["PYTHONHOME"] = app_dir

    # Preinstalling Anaconda dependencies (procedure: https://docs.conda.io/projects/conda/en/latest/commands/install.html)
    #print('"%s" install qt --quiet --offline --use-local --yes --prefix "%s"' % (conda_path, app_dir))
    run('"%s" install qt --quiet --offline --use-local --yes --prefix "%s"' % (conda_path, app_dir), shell=False)

    # Debuggin information for Anaconda
    print("If you're experencing issues with Anaconda you may need to execute in cmd the following command:")
    print('"%s"' % makepath(app_dir,'Scripts','activate.bat'))
    #run('"%s"' % makepath(app_dir,'Scripts','activate.bat'))

    # Rolling back WAPT Python Pathes
    if isdir(makepath(programfiles32, 'wapt')):
        waptpython_path = makepath(programfiles32, 'wapt')
    else:
        waptpython_path = makepath(systemdrive, 'wapt')

    if "PYTHONHOME" in os.environ.keys():
        del os.environ["PYTHONHOME"]
    if "PYTHONPATH" in os.environ.keys():
        del os.environ["PYTHONPATH"]
    os.environ["PYTHONHOME"] = waptpython_path
    os.environ["PYTHONPATH"] = waptpython_path


""" def uninstall():
    # Uninstalling versions not located to defined directory
    for uninstall in installed_softwares(name='Anaconda3'):
        print('Uninstalling: %s' % uninstall['name'])
        run(uninstall_cmd(uninstall['key']))
        time.sleep(180) """


def session_setup():
    print("Configuring: base options")

    # Initializing variables
    #"C:\Users\username\.anaconda\navigator\anaconda-navigator.ini"
    user_conf_dir = makepath(systemdrive,'Users', get_current_user(), '.anaconda', 'navigator')
    user_conf_file = makepath(user_conf_dir, 'anaconda-navigator.ini')

    # Configuring options
    inifile_writestring(user_conf_file, 'main', 'first_time_offline', 'True')
    inifile_writestring(user_conf_file, 'main', 'offline_mode', 'True')
    inifile_writestring(user_conf_file, 'main', 'hide_offline_dialog', 'True')
    inifile_writestring(user_conf_file, 'main', 'first_run', 'False')
    inifile_writestring(user_conf_file, 'main', 'hide_update_dialog', 'True')
    inifile_writestring(user_conf_file, 'main', 'provide_analytics', 'False')
    inifile_writestring(user_conf_file, 'main', 'show_startup', 'False')
    inifile_writestring(user_conf_file, 'main', 'hide_update_dialog', 'True')
    #inifile_writestring(user_conf_file, 'main', 'hide_quit_dialog', 'True')


def update_package():
    print('Downloading/Updating package content from upstream binary sources')

    # Initializing variables
    proxies = get_proxies()
    app_name = control.name
    url = control.sources
    if control.architecture == 'x64':
        arch = '64'
    else:
        arch = '32'

    # Getting latest version from official website
    print('URL used is: ' + url)
    url_dl = bs_find(url, 'a', 'data-name', '%s-Bit Graphical Installer' % arch, proxies=proxies)['href']
    latest_bin = url_dl.split('/')[-1]
    version = latest_bin.split('-')[1]

    print("Latest %s version is: %s" % (app_name, version))
    print("Download url is: %s" % url_dl)

    # Downloading latest binaries
    if not isfile(latest_bin):
        print('Downloading: %s' % latest_bin)
        wget(url_dl, latest_bin, proxies=proxies)

        # Changing version of the package
        control.version = '%s-%s'%(version,int(control.version.split('-')[-1])+1)
        control.save_control_to_wapt()
        print('Changing version to: %s in WAPT\\control' % control.version)

    # Deleting outdated binaries
    remove_outdated_binaries(version)




def get_proxies():
    import platform
    if platform.python_version_tuple()[0] == '3':
        from urllib.request import getproxies
    else:
        from urllib import getproxies
    return getproxies()


def get_version_from_binary(filename):
    if filename.endswith('.msi'):
        return get_msi_properties(filename)['ProductVersion']
    else:
        return get_file_properties(filename)['ProductVersion']


def remove_outdated_binaries(version, list_extensions=['exe','msi','deb','rpm','dmg','pkg'], list_filename_contain=None):
    if type(list_extensions) != list:
        list_extensions = [list_extensions]
    if list_filename_contain:
        if type(list_filename_contain) != list:
            list_filename_contain = [list_filename_contain]
    list_extensions = ['.' + ext for ext in list_extensions if ext[0] != '.']
    for file_ext in list_extensions:
        for bin_in_dir in glob.glob('*%s' % file_ext):
            if not version in bin_in_dir:
                remove_file(bin_in_dir)
            if list_filename_contain:
                for filename_contain in list_filename_contain:
                    if not filename_contain in bin_in_dir:
                        remove_file(bin_in_dir)


def bs_find(url, element, attribute=None, value=None, headers=None, proxies=None, features='html.parser', **kwargs):
    """"You may need to use a header for some websites. For example: headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0'}
    """
    import requests
    page = requests.get(url, proxies=proxies, headers=headers, **kwargs).text
    try:
        import bs4 as BeautifulSoup
        soup = BeautifulSoup.BeautifulSoup(page, features=features)
    except:
        import BeautifulSoup
        soup = BeautifulSoup.BeautifulSoup(page)
    if value:
        return soup.find(element,{attribute:value})
    else:
        return soup.find(element)


										

  Changelog 


Changelog software url : https://docs.anaconda.com/anaconda/reference/release-notes/

No changelog
  manifest.sha256 
[["Anaconda3-2020.07-Windows-x86.exe","19803e5ccc357b57051cf7fa272e6b499dfedf13790778dc24af302f894e3281"],["setup.py","d7294413f89820551c93cb6464a4fea75f50c401ac274a68aa82f651616716ee"],["WAPT/icon.png","b55165d2364b2eeb9de5a1a3dce776d46560302228154d603878c4f0a6c47fd5"],["WAPT/certificate.crt","a5a97261381e1d0ad46ee15916abec9c2631d0201f5cc50ceb0197a165a0bbbf"],["WAPT/control","af74f38f7b9168ae824fda46831953087b38734e916b3aed7fe2542f390bb76d"]]