Skip to content

Commit

Permalink
[backport] Pin debugpy (microsoft#17619)
Browse files Browse the repository at this point in the history
* pin to debugpy verion 1.4.3

* Pin to particular version of debugpy.
  • Loading branch information
karthiknadig authored and randomir committed Mar 18, 2022
1 parent 8edb720 commit 1040901
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions pythonFiles/install_debugpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
EXTENSION_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
DEBUGGER_DEST = os.path.join(EXTENSION_ROOT, "pythonFiles", "lib", "python")
DEBUGGER_PACKAGE = "debugpy"
DEBUGGER_PYTHON_VERSIONS = ("cp39",)
DEBUGGER_PYTHON_ABI_VERSIONS = ("cp39",)
DEBUGGER_VERSION = "1.4.3" # can also be "latest"


def _contains(s, parts=()):
Expand All @@ -28,7 +29,7 @@ def _get_debugger_wheel_urls(data, version):
return list(
r["url"]
for r in data["releases"][version]
if _contains(r["url"], DEBUGGER_PYTHON_VERSIONS)
if _contains(r["url"], DEBUGGER_PYTHON_ABI_VERSIONS)
)


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

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

for url in _get_debugger_wheel_urls(data, latest_version):
_download_and_extract(root, url, latest_version)
if DEBUGGER_VERSION == "latest":
use_version = max(data["releases"].keys(), key=version_parser)
else:
use_version = DEBUGGER_VERSION

for url in _get_debugger_wheel_urls(data, use_version):
_download_and_extract(root, url, use_version)


if __name__ == "__main__":
Expand Down

0 comments on commit 1040901

Please sign in to comment.