tis-vscode-pylance
2023.7.31-24
Pylance VSCode Extension
15821 downloads
Download
See build result See VirusTotal scan

Description
- package : tis-vscode-pylance
- name : Pylance VSCode Extension
- version : 2023.7.31-24
- categories : Extension
- maintainer : WAPT Team,Tranquil IT,Jimmy PELÉ
- installed_size : 80667008
- editor : Microsoft
- licence : MIT
- signature_date : 2023-11-15T17:02:58.320983
- size : 11.60 Mo
- locale : all
- target_os : windows,mac,debian(>=10),ubuntu(>=18)
- impacted_process :
- architecture : x64
- Homepage : https://github.com/microsoft/pylance-release#readme
- Depends :
Control
package : tis-vscode-pylance
version : 2023.7.31-24
architecture : x64
section : base
priority : optional
name : Pylance VSCode Extension
categories : Extension
maintainer : WAPT Team,Tranquil IT,Jimmy PELÉ
description : Pylance VSCode Extension
depends : tis-vscode-python
conflicts :
maturity : PROD
locale : all
target_os : windows,mac,debian(>=10),ubuntu(>=18)
min_wapt_version : 2.3
sources : https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance
installed_size : 80667008
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,pylance
licence : MIT
homepage : https://github.com/microsoft/pylance-release#readme
package_uuid : 574e0c63-5ae9-4940-a527-1a7af7d0d54a
valid_from :
valid_until :
forced_install_on :
changelog : https://marketplace.visualstudio.com/items/ms-python.vscode-pylance/changelog
min_os_version :
max_os_version :
icon_sha256sum : 2a548f2dd75093de32da7aff8e0553f1903ecf02f22664d95eb01d4aaa28a878
signer : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature : yo4WQ2mQz4gYYjPJDt1+tPVw0bvaLKAYU+DD10/149c231u+3c9kz/sxuUBs17EQcZntxV48ia1oNZi0ozGnHkyJM3iQGkuXQL3BpsY5d/G6SVma4Q/0AWn9ZMuvU4dJo/tDu6dsfd23gKiCPmfWt5jwFGXJp9ibTsvm8bbg7ztnyihfv47YGcJ8m2znKMOGK7k9Sp18naTYN5fHhOFyjC+kUY3HR1WwbwuzQmoudSzONnw7xVpYmbflu2jqEBm0W1dnZvKOaBQIN10klCmw3xQUcpxi5qR3yb+Q/QGYw2HwNk0SMQsW6ICoD01qrNUj6wzNtnZxuVO00HeJvft4bA==
signature_date : 2023-11-15T17:02:58.320983
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 *
ext_uid_name = "ms-python.vscode-pylance"
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)):
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)
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 "2023.4.40" 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 + "@2023.4.40"))
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 audit():
# 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")
try:
ext_path = glob.glob(makepath(app_dir, "*%s*.vsix" % ext_uid_name))[0]
print("OK: %s extension present" % ext_uid_name)
return "OK"
except:
print("ERROR: %s extension absent" % ext_uid_name)
return "ERROR"
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
Update_package.py
# -*- coding: utf-8 -*-
from setuphelpers import *
import json
import requests
import time
ext_uid_name = "ms-python.vscode-pylance"
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
api_url = "https://api.github.com/repos/microsoft/vscode-python/releases/latest"
json_load = json.loads(wgets(api_url, proxies=proxies))
version = json_load["tag_name"].split("-")[-1].replace("v", "")
version = "2023.4.40"
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.version = "%s-%s" % (Version("2023.7.31"), 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
9d67e65fae0b50ce40b315a75088514368211fb2992de9e3f778f61d7345340d : setup.py
: __pycache__
f6721c1e8daae9b9d0c9d8f74dbef478b4a0a17e8dea08300ac1977df0a9160e : update_package.py
2a548f2dd75093de32da7aff8e0553f1903ecf02f22664d95eb01d4aaa28a878 : WAPT/icon.png
a5a97261381e1d0ad46ee15916abec9c2631d0201f5cc50ceb0197a165a0bbbf : WAPT/certificate.crt
6d7e67fe5b72f81d255f220a721105adabd11503d838b061db5598c4cc75425d : WAPT/changelog.txt
736c18335d542c709d7b182d2a773d2c59f52289aa553749d6cc07040533185f : luti.json
8269d5feb095bcad9bec6c839e67b7adf315f243f6a8b32061f36d5be6363e41 : ms-python.vscode-pylance-2023.4.40.vsix
fc246372249b90960f26bc6001babd2f5f849f50b8e637705e71370f8137bee9 : WAPT/control