Skip to content

Commit 1040901

Browse files
karthiknadigrandomir
authored andcommitted
[backport] Pin debugpy (microsoft#17619)
* pin to debugpy verion 1.4.3 * Pin to particular version of debugpy.
1 parent 8edb720 commit 1040901

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

pythonFiles/install_debugpy.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
EXTENSION_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
1010
DEBUGGER_DEST = os.path.join(EXTENSION_ROOT, "pythonFiles", "lib", "python")
1111
DEBUGGER_PACKAGE = "debugpy"
12-
DEBUGGER_PYTHON_VERSIONS = ("cp39",)
12+
DEBUGGER_PYTHON_ABI_VERSIONS = ("cp39",)
13+
DEBUGGER_VERSION = "1.4.3" # can also be "latest"
1314

1415

1516
def _contains(s, parts=()):
@@ -28,7 +29,7 @@ def _get_debugger_wheel_urls(data, version):
2829
return list(
2930
r["url"]
3031
for r in data["releases"][version]
31-
if _contains(r["url"], DEBUGGER_PYTHON_VERSIONS)
32+
if _contains(r["url"], DEBUGGER_PYTHON_ABI_VERSIONS)
3233
)
3334

3435

@@ -53,10 +54,14 @@ def _download_and_extract(root, url, version):
5354

5455
def main(root):
5556
data = _get_package_data()
56-
latest_version = max(data["releases"].keys(), key=version_parser)
5757

58-
for url in _get_debugger_wheel_urls(data, latest_version):
59-
_download_and_extract(root, url, latest_version)
58+
if DEBUGGER_VERSION == "latest":
59+
use_version = max(data["releases"].keys(), key=version_parser)
60+
else:
61+
use_version = DEBUGGER_VERSION
62+
63+
for url in _get_debugger_wheel_urls(data, use_version):
64+
_download_and_extract(root, url, use_version)
6065

6166

6267
if __name__ == "__main__":

0 commit comments

Comments
 (0)