Skip to content

Commit a19512f

Browse files
committed
Include debugpy in debug pex when configured as debugger
1 parent dc6ab3e commit a19512f

4 files changed

Lines changed: 36 additions & 2 deletions

File tree

third_party/python/BUILD

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,9 +417,24 @@ pip_library(
417417

418418
python_wheel(
419419
name = "debugpy",
420-
hashes = ["f058c204341fd7ff800ee0edafc106ca0fb1c9857e8a8895a6e04cca3ddcb7bf"],
420+
hashes = [
421+
"c1178ae571aff42e61801a38b007af504ec8e05fde1c5c12e5a7efef21009642", # linux_amd64, Python 3.10
422+
"7de0b7dfeedc504421032afba845ae2a7bcc32ddfb07dae2c3ca5442f821c344", # linux_amd64, Python 3.11
423+
"88f47850a4284b88bd2bfee1f26132147d5d504e4e86c22485dfa44b97e19b4b", # linux_amd64, Python 3.12
424+
"84562982dd7cf5ebebfdea667ca20a064e096099997b175fe204e86817f64eaf", # linux_amd64, Python 3.13
425+
"077a7447589ee9bc1ff0cdf443566d0ecf540ac8aa7333b775ebcb8ce9f4ecad", # linux_amd64, Python 3.14
426+
"157e96ffb7f80b3ad36d808646198c90acb46fdcfd8bb1999838f0b6f2b59c64", # darwin_amd64, Python 3.10
427+
"eada6042ad88fa1571b74bd5402ee8b86eded7a8f7b827849761700aff171f1b", # darwin_amd64/darwin_arm64, Python 3.11
428+
"4ae3135e2089905a916909ef31922b2d733d756f66d87345b3e5e52b7a55f13d", # darwin_amd64/darwin_arm64, Python 3.12
429+
"5dff4bb27027821fdfcc9e8f87309a28988231165147c31730128b1c983e282a", # darwin_amd64/darwin_arm64, Python 3.13
430+
"9c74df62fc064cd5e5eaca1353a3ef5a5d50da5eb8058fcef63106f7bebe6173", # darwin_amd64/darwin_arm64, Python 3.14
431+
"5be9bed9ae3be00665a06acaa48f8329d2b9632f15fd09f6a9a8c8d9907e54d7", # any
432+
],
421433
licences = ["MIT"],
422-
version = "1.5.0",
434+
version = "1.8.20",
435+
zip_safe = False,
436+
# There doesn't seem to be a predictable URL for this version of debugpy so we need to resolve it instead.
437+
tool = "//tools:wheel_resolver",
423438
)
424439

425440
python_wheel(

tools/BUILD

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,20 @@ remote_file(
1313
binary = True,
1414
visibility = ["PUBLIC"],
1515
)
16+
17+
_WHEEL_RESOLVER_VERSION = "2.0.0"
18+
19+
remote_file(
20+
name = "wheel_resolver",
21+
url =
22+
f"https://github.com/please-build/python-rules/releases/download/wheel_resolver-v{_WHEEL_RESOLVER_VERSION}/wheel_resolver-{_WHEEL_RESOLVER_VERSION}-{CONFIG.OS}_{CONFIG.ARCH}",
23+
hashes = [
24+
"b48315ec1c6670faf7feb2a532a4d0cb104a03113525ef1799062d7576f66b36", # darwin_amd64
25+
"70db6d2eb18ab915f555824a8f29fe0909bcf87db0b583a5d6ad3156a54a034a", # darwin_arm64
26+
"d47802282b4acf1669a1d69531c69eb2dd3f0f069fd8e59d0c9aff946f7aff44", # freebsd_amd64
27+
"6aa0304bde5ab5f68d3415fd8761f6684f5c88835791b0dbd12f909120d797c6", # linux_amd64
28+
"09e340203aa88d4e9de7f61b044d1f29fb688abf3c8b7547f80ad6ca3e441495", # linux_arm64
29+
],
30+
binary = True,
31+
visibility = ["PUBLIC"],
32+
)

tools/please_pex/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ genrule(
4444
visibility = ["PUBLIC"],
4545
deps = [
4646
"//third_party/python:behave_bootstrap",
47+
"//third_party/python:debugpy",
4748
"//third_party/python:pytest_bootstrap",
4849
"//third_party/python:unittest_bootstrap",
4950
],

tools/please_pex/pex/pex_main.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ def _explode_zip():
9292
# that the cache has already been prepared.
9393
lockfile.write("pex unzip completed")
9494
sys.path = [PEX_PATH] + [x for x in sys.path if x != PEX]
95+
sys.path.insert(1, os.path.join(sys.path[0], '.bootstrap'))
9596
try:
9697
yield
9798
finally:

0 commit comments

Comments
 (0)