tis-vscode-python icon

Python VSCode Extension

Paquet d’installation silencieuse pour Python VSCode Extension

2025.21.2026010601-24
Development
Extension
Development
Extension

Les paquets PREPROD sont des paquets construits via LUTI. Ils restent généralement 5 jours en PREPROD, après quoi un deuxième scan VirusTotal est effectué pour vérifier que le status n'a pas changé.
Si le paquet réussit ce dernier contrôle, il est promu en PROD et publié sur le store.

  • package: tis-vscode-python
  • name: Python VSCode Extension
  • version: 2025.21.2026010601-24
  • categories: Development,Extension
  • maintainer: WAPT Team,Tranquil IT,Jimmy PELÉ
  • editor: Microsoft
  • licence: opensource_free,cpe:/a:mit:x11_license
  • target_os: all
  • architecture: all
  • signature_date:
  • size: 9.09 Mo
  • homepage : https://github.com/Microsoft/vscode-python
  • depends:

package           : tis-vscode-python
version           : 2025.21.2026010601-24
architecture      : all
section           : base
priority          : optional
name              : Python VSCode Extension
categories        : Development,Extension
maintainer        : WAPT Team,Tranquil IT,Jimmy PELÉ
description       : Python VSCode Extension
depends           : tis-vscode
conflicts         : 
maturity          : PREPROD
locale            : 
target_os         : all
min_wapt_version  : 2.1
sources           : https://marketplace.visualstudio.com/items/ms-python.python
installed_size    : 
impacted_process  : 
description_fr    : 
description_pl    : 
description_de    : 
description_es    : 
description_pt    : 
description_it    : 
description_nl    : 
description_ru    : 
audit_schedule    : 
editor            : Microsoft
keywords          : vscode,extension,python
licence           : opensource_free,cpe:/a:mit:x11_license
homepage          : https://github.com/Microsoft/vscode-python
package_uuid      : 004880b7-a2e9-42d8-a96a-b9fb6fbcbb66
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : https://marketplace.visualstudio.com/items/ms-python.python/changelog
min_os_version    : 
max_os_version    : 
icon_sha256sum    : 2a548f2dd75093de32da7aff8e0553f1903ecf02f22664d95eb01d4aaa28a878
signer            : test
signer_fingerprint: b82fc8ef4a4475c0f69ac168176c2bfc58f572eb716c4eadd65e4785c155dd8e
signature_date    : 2026-01-06T11:28:47.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         : oLpR5NG3sSCwL9YG8Yz58ZbMGXB6hN2bB5X0WvNlNC3Q3zDJ8xbdX016ipd42Rd0tlU6nTb9BALFqwUc1mpr3+4+C9M3ZkLnpzUKxzf/W/2CrMt/uW20xKIehXcPRp0acb7fF4g6hbgspLmkYpwpF5eirOjFwKfa57+FZHrHUk5h6tZQrd7mhiL91UVPlGUZPow3sdwKhx0xdu81dLv6pZmg5d9+YqfZG1epsTkMHwJDiyrCZoeQT6abRDGR3folZ+/7ejOQEwbTz5wis0TUOcSO3DEZGilxeeKTcWLVrCypyrU4UXuAY4ZPG1XbTdUdVRcOzB6WjyQHbI13vykijQ==

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

ext_uid_name = "ms-python.python"


def install():
    # Initializing variables
    package_version = control.get_software_version()
    ext_file_name = glob.glob("*%s*.vsix" % ext_uid_name)[0]
    if get_os_name() == "Windows":
        app_dir = makepath(programfiles, "Microsoft VS Code")
        app_bin_path = makepath(app_dir, "bin", "code")
    elif get_os_name() == "Linux":
        app_dir = makepath("/", "usr", "share", "code")
        app_bin_path = makepath(app_dir, "bin", "code")
    elif get_os_name() == "Darwin":
        app_dir = makepath("/", "Applications", "Visual Studio Code.app")
        app_bin_path = makepath(app_dir, "Contents", "Resources", "app", "bin", "code")
    ext_path = makepath(app_dir, ext_file_name)

    # Removing old extensions from app_dir
    for ext in glob.glob(makepath(app_dir, "*%s*.vsix" % ext_uid_name)) + [makepath(app_dir, "ms-python-release.vsix")]:
        print("Removing: %s" % ext)
        remove_file(ext)

    # Copying extension to app_dir
    print("Copying: %s to: %s" % (ext_file_name, app_dir))
    filecopyto(ext_file_name, app_dir)

    # Disable File Validation Warning
    if get_os_name() == "Windows":
        set_environ_variable("PYDEVD_DISABLE_FILE_VALIDATION", "1")


def session_setup():
    # Initializing variables
    package_version = control.get_software_version()
    if get_os_name() == "Windows":
        app_dir = makepath(programfiles, "Microsoft VS Code")
        app_bin_path = makepath(app_dir, "bin", "code")
    elif get_os_name() == "Linux":
        app_dir = makepath("/", "usr", "share", "code")
        app_bin_path = makepath(app_dir, "bin", "code")
    elif get_os_name() == "Darwin":
        app_dir = makepath("/", "Applications", "Visual Studio Code.app")
        app_bin_path = makepath(app_dir, "Contents", "Resources", "app", "bin", "code")
    ext_path = glob.glob(makepath(app_dir, "*%s*.vsix" % ext_uid_name))[0]

    # Installing extension in user env
    print("Installing: %s extension in user env" % (ext_path))
    vsix_cmd = f'"{app_bin_path}" --install-extension "{ext_path}"'
    #if force or "2021.12.1559732655" in ext_path:
    #    vsix_cmd += " --force"
    result = run_notfatal(vsix_cmd)  # code extension always return exit status 0 for now
    print(result)
    # if "Failed Installing Extensions" in result and not force:
    #if "Failed Installing Extensions" in result or "A newer version of extension" in result and not force:
    #    print("Unable to install extension with: %s" % ext_path)
    #    print("Force install: %s extension in user env" % (ext_uid_name))
    #    # result_force = run_notfatal('"%s" --install-extension "%s" --force' % (app_bin_path, ext_uid_name))
    #    result_force = run_notfatal('"%s" --install-extension "%s" --force' % (app_bin_path, ext_uid_name + "@2021.12.1559732655"))
    #    print(result_force)
    #    if "Failed Installing Extensions" in result_force:
    #        print("Unable to force install %s extension" % ext_uid_name)

    # # Please disable Jupyter extension manually instead of this code since it can not be done silently
    # if not WAPT.is_installed("tis-vscode-jupyter"):
    #     # Disable Jupyter just once since it run VSCode...
    #     if not registry_readstring(HKEY_CURRENT_USER, r"SOFTWARE\WAPT\Code", "DisableJupyterOnce") == "Done":
    #         run_notfatal('"%s" --disable-extension "ms-toolsai.jupyter"' % (app_bin_path))
    #         registry_setstring(HKEY_CURRENT_USER, r"SOFTWARE\WAPT\Code", "DisableJupyterOnce", "Done")

def uninstall():
    # Initializing variables
    package_version = control.get_software_version()
    if get_os_name() == "Windows":
        app_dir = makepath(programfiles, "Microsoft VS Code")
        app_bin_path = makepath(app_dir, "bin", "code")
    elif get_os_name() == "Linux":
        app_dir = makepath("/", "usr", "share", "code")
        app_bin_path = makepath(app_dir, "bin", "code")
    elif get_os_name() == "Darwin":
        app_dir = makepath("/", "Applications", "Visual Studio Code.app")
        app_bin_path = makepath(app_dir, "Contents", "Resources", "app", "bin", "code")

    # Removing extensions from app_dir
    for ext in glob.glob(makepath(app_dir, "*%s*.vsix" % ext_uid_name)):
        print("Removing: %s" % ext)
        remove_file(ext)

    # Removing extension from user profiles
    killalltasks(["Code", "code"])
    print(remove_tree_for_all_users(makepath(".vscode", "extensions", "%s-*" % ext_uid_name)))


def remove_tree_for_all_users(user_folder_relative_path, ignored_users=None, ignore_system_users=True):
    r"""Remove a specific folder or folders for all user's profiles

    Args:
        user_folder_relative_path (str): relative path to user folder, glob patterns can be used
        ignored_users (str or list of str): ignore specified users
        ignore_system_users (bool): ignore default, public, all users, etc. True by default

    Returns:
        list: list of deleted folders

    >>> print(remove_tree_for_all_users(makepath(".vscode", "extensions", "ms-toolsai.jupyter-*")))
    ['C:\\Users\\username\\.vscode\\extensions\\ms-toolsai.jupyter-2022.2.1001817079', 'C:\\Users\\username\\.vscode\\extensions\\ms-toolsai.jupyter-keymap-1.0.0', 'C:\\Users\\username\\.vscode\\extensions\\ms-toolsai.jupyter-renderers-1.0.6']

    >>> print(remove_tree_for_all_users(makepath(".vscode", "extensions", "ms-toolsai.jupyter-")))
    []

    >>> print(remove_tree_for_all_users(makepath(".vscode", "extensions", "ms-toolsai.jupyter-[a-z]*")))
    ['C:\\Users\\username\\.vscode\\extensions\\ms-toolsai.jupyter-keymap-1.0.0', 'C:\\Users\\username\\.vscode\\extensions\\ms-toolsai.jupyter-renderers-1.0.6']

    >>> print(remove_tree_for_all_users(makepath(".vscode", "extensions", "ms-toolsai.jupyter-1.0.0")))
    ['/home/username/.vscode/extensions/ms-toolsai.jupyter-keymap-1.0.0']

    .. versionadded:: 2.3

    """
    system_users_list = ["All Users", "Default", "Default User", "Public", "Shared"]
    if ignored_users is None:
        ignored_users = []
    if type(ignored_users) != list:
        ignored_users = [ignored_users]

    deleted_folders = []
    skipped_users = []
    if ignored_users:
        skipped_users.extend(ignored_users)
    if ignore_system_users:
        skipped_users.extend(system_users_list)

    if get_os_name() == "Windows":
        users_dir = makepath(systemdrive, "Users")
    elif get_os_name() == "Linux":
        users_dir = "/home"
    elif get_os_name() == "Darwin":
        users_dir = "/Users"

    for user_profile in glob.glob("%s/*/" % users_dir):
        for ignored_user in ignored_users:
            if user_profile.rstrip(os.path.sep).split(os.path.sep)[-1] == ignored_user:
                continue
        for user_folder_to_delete in glob.glob(r"%s" % makepath(user_profile, user_folder_relative_path)):
            deleted_folders.append(user_folder_to_delete)
            remove_tree(user_folder_to_delete)
    return deleted_folders

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

ext_uid_name = "ms-python.python"
ext_publisher = ext_uid_name.split(".")[0]


def update_package():
    # Declaring local variables
    result = False
    proxies = get_proxies()
    if not proxies:
        proxies = get_proxies_from_wapt_console()
    app_name = control.name
    url = "https://marketplace.visualstudio.com/items?itemName=%s" % ext_uid_name

    # Getting latest version from official sources
    print("URL used is %s" % url)
    for bs_search in bs_find_all(url, "script", "type", "application/json", proxies=proxies):
        if bs_search.string.startswith("{"):
            json_data = json.loads(bs_search.string)
            break
    
    version = json_data["Resources"]["Version"]

    download_url = "https://marketplace.visualstudio.com/_apis/public/gallery/publishers/%s/vsextensions/%s/%s/vspackage" % (
        ext_publisher,
        json_data["Resources"]["ExtensionName"],
        version,
    )
    latest_bin = ext_uid_name + "-%s.vsix" % version

    print("Latest %s version is: %s" % (app_name, version))
    print("Download URL is: %s" % download_url)

    # Downloading latest binaries
    if not isfile(latest_bin):
        print("Downloading: %s" % latest_bin)
        content = requests.get(download_url, stream=True)
        nb_wait = 0
        max_wait = 3600
        while str(content.status_code) == "429":
            timewait = int(content.headers["Retry-After"])
            print("Wait %s" % timewait)
            nb_wait = nb_wait + timewait
            if nb_wait > max_wait:
                error("Max wait ...")
            time.sleep(timewait)
            content = requests.get(download_url, stream=True)

        with open(latest_bin, "wb") as f:
            for chunk in content.iter_content(chunk_size=1024 * 1024):
                f.write(chunk)

    # Changing version of the package
    if Version(version) > Version(control.get_software_version()):
        print("Software version updated (from: %s to: %s)" % (control.get_software_version(), Version(version)))
        result = True
    else:
        print("Software version up-to-date (%s)" % Version(version))
    control.version = "%s-%s" % (Version(version), control.version.split("-", 1)[-1])
    # control.set_software_version(version)
    control.save_control_to_wapt()

    # Deleting outdated binaries
    remove_outdated_binaries(version, "vsix")

    # Validating or not update-package-sources
    return result

01ca7fe94636e5a08fcb73849d3b5df25d51e2c82f4dd1a08f01798b25899819 : WAPT/certificate.crt
d687f25a17c0738a20df72663e63b91700cda6f97d4408702647b763916bf400 : WAPT/changelog.txt
7f95232197dc6dd400ba8d0c2daa40f203dcb1e348ececcf898fc3353a423d26 : WAPT/control
2a548f2dd75093de32da7aff8e0553f1903ecf02f22664d95eb01d4aaa28a878 : WAPT/icon.png
9268a67abe264f39e7440afc15a2f37ec5c5996c2722d70cf73bf3e12dee69c9 : luti.json
30c57cddafe867b6dfbfe78a0b2b92400f7f40813a0b3a8b9b788330e69d8609 : ms-python.python-2025.21.2026010601.vsix
685ed45f23f51db201e20a8f618df7863062691ca2a88ded4eb1915bf76674b2 : setup.py
5cdc5bffe857b5342be53dc024fc76a20abd00d27c26a50e7cdc8d7a51dc95a5 : update_package.py

https://marketplace.visualstudio.com/items/ms-python.python/changelog
2023.8.0-23
===
Temporary using ms-python.python@2021.12.1559732655 until https://github.com/microsoft/vscode-python/issues/21265 is fixed


2023.8.0-21
===
Disable File Validation Warning with Set PYDEVD_DISABLE_FILE_VALIDATION=1 on Windows


2022.20.1-20
===
Switch to release version
Removes old file ms-python-release.vsix if found
Please disable Jupyter extension manually if you do not use it
Handle downgrade with `wapt-get session-setup tis-python -f`