ripe-scooter-10665
11/28/2022, 3:09 PM./pants test --debug-adapter <path to test file>
I get the following error:
15:06:23.64 [INFO] Completed: Building pytest_runner.pex
15:06:23.64 [ERROR] 1 Exception encountered:
ProcessExecutionFailure: Process 'Building pytest_runner.pex' failed with exit code 1.
stdout:
stderr:
A distribution for debugpy could not be resolved for ~/.pyenv/versions/3.9.15/bin/python3.9.
Found 1 distribution for debugpy that do not apply:
1.) The wheel tags for debugpy 1.6.0 are cp38-cp38-macosx_10_15_x86_64 which do not match the supported tags of ~/.pyenv/versions/3.9.15/bin/python3.9:
cp39-cp39-macosx_13_0_arm64
... 409 more ...
It seems that debugpy is a requirement of pants itself, pinned at 1.6.0 but there does seem to be py3.9 wheels available for it. I tried adding debugpy to my own 3rd party requirements but that didn’t seem to help. Any ideas on how to get around this. Not being able to debug in VSCode is a bit of a pain.bitter-ability-32190
11/28/2022, 3:50 PMripe-scooter-10665
11/28/2022, 4:00 PMbitter-ability-32190
11/28/2022, 4:04 PMripe-scooter-10665
11/28/2022, 4:06 PMbitter-ability-32190
11/28/2022, 4:07 PM./pants generate-lockfiles --reolve=debugpy
on your machine. That will make a new lockfile you check into your repo and I suspect if you run that on a mac, it'll work 🤞ripe-scooter-10665
11/28/2022, 4:13 PMbitter-ability-32190
11/28/2022, 4:14 PMripe-scooter-10665
11/28/2022, 4:14 PM// This lockfile was autogenerated by Pants. To regenerate, run:
//
// ./pants generate-lockfiles --resolve=debugpy
//
// --- BEGIN PANTS LOCKFILE METADATA: DO NOT EDIT OR REMOVE ---
// {
// "version": 3,
// "valid_for_interpreter_constraints": [
// "CPython<3.11,>=3.7"
// ],
// "generated_with_requirements": [
// "debugpy==1.6.3",
// "importlib_metadata==1.4.0"
// ],
// "manylinux": "manylinux2014",
// "requirement_constraints": [],
// "only_binary": [],
// "no_binary": []
// }
// --- END PANTS LOCKFILE METADATA ---
{
"allow_builds": true,
"allow_prereleases": false,
"allow_wheels": true,
"build_isolation": true,
"constraints": [],
"locked_resolves": [
{
"locked_requirements": [
{
"artifacts": [
{
"algorithm": "sha256",
"hash": "84c39940a0cac410bf6aa4db00ba174f973eef521fbe9dd058e26bcabad89c4f",
"url": "<https://files.pythonhosted.org/packages/e4/d6/ed74635ad235293a77f65ccaa17ac3c6012839126f0512a5a53c7cbf82ff/debugpy-1.6.3-py2.py3-none-any.whl>"
},
{
"algorithm": "sha256",
"hash": "d5c814596a170a0a58fa6fad74947e30bfd7e192a5d2d7bd6a12156c2899e13a",
"url": "<https://files.pythonhosted.org/packages/3e/00/9616d339b132f80d0772c28e1119cec24a54d0b3a13a63468af23729253f/debugpy-1.6.3-cp37-cp37m-macosx_10_15_x86_64.whl>"
},
{
"algorithm": "sha256",
"hash": "b8deaeb779699350deeed835322730a3efec170b88927debc9ba07a1a38e2585",
"url": "<https://files.pythonhosted.org/packages/5a/e6/476865a057fe515b2048d9a01b6b270a9eccbd40ec6da7dc3061476faec4/debugpy-1.6.3-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl>"
},
{
"algorithm": "sha256",
"hash": "e8922090514a890eec99cfb991bab872dd2e353ebb793164d5f01c362b9a40bf",
"url": "<https://files.pythonhosted.org/packages/8f/23/8dd369ef3a92bf5fdb4bf0cb84b721efbec43ae81b4f3694f6214b20d6d6/debugpy-1.6.3.zip>"
},
{
"algorithm": "sha256",
"hash": "c4b2bd5c245eeb49824bf7e539f95fb17f9a756186e51c3e513e32999d8846f3",
"url": "<https://files.pythonhosted.org/packages/92/ec/65a8c523e87a75c2dbe044196a8f171870ad6be8ec820d2364e701feb8c7/debugpy-1.6.3-cp310-cp310-macosx_10_15_x86_64.whl>"
},
{
"algorithm": "sha256",
"hash": "4e255982552b0edfe3a6264438dbd62d404baa6556a81a88f9420d3ed79b06ae",
"url": "<https://files.pythonhosted.org/packages/ad/2a/eaeb7a147a7e978d3e8c591771058862edb18af69431039933d833bc3d33/debugpy-1.6.3-cp39-cp39-macosx_10_15_x86_64.whl>"
},
{
"algorithm": "sha256",
"hash": "adcfea5ea06d55d505375995e150c06445e2b20cd12885bcae566148c076636b",
"url": "<https://files.pythonhosted.org/packages/ae/9c/a3e68bab0a3b5395b623dec6b0d4caf2cbc8001e6943187873e1869e5a03/debugpy-1.6.3-cp38-cp38-macosx_10_15_x86_64.whl>"
},
{
"algorithm": "sha256",
"hash": "daadab4403427abd090eccb38d8901afd8b393e01fd243048fab3f1d7132abb4",
"url": "<https://files.pythonhosted.org/packages/d2/e3/d0531ee73216d553d717bf4ac51dff297f89054619fa69db61eef028a07f/debugpy-1.6.3-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl>"
},
{
"algorithm": "sha256",
"hash": "c4cd6f37e3c168080d61d698390dfe2cd9e74ebf80b448069822a15dadcda57d",
"url": "<https://files.pythonhosted.org/packages/e4/fc/555a80da24d0608660f69aad6da45cce890f1b2d055d4d4cd6ed9cf0ea20/debugpy-1.6.3-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl>"
},
{
"algorithm": "sha256",
"hash": "cca23cb6161ac89698d629d892520327dd1be9321c0960e610bbcb807232b45d",
"url": "<https://files.pythonhosted.org/packages/e6/bb/614cfb27df644883e8db05dc4f47e9f3919303a8b125127933262a157847/debugpy-1.6.3-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl>"
}
],
"project_name": "debugpy",
"requires_dists": [],
"requires_python": ">=3.7",
"version": "1.6.3"
},
{
"artifacts": [
{
"algorithm": "sha256",
"hash": "bdd9b7c397c273bcc9a11d6629a38487cd07154fa255a467bf704cd2c258e359",
"url": "<https://files.pythonhosted.org/packages/d7/31/74dcb59a601b95fce3b0334e8fc9db758f78e43075f22aeb3677dfb19f4c/importlib_metadata-1.4.0-py2.py3-none-any.whl>"
},
{
"algorithm": "sha256",
"hash": "f17c015735e1a88296994c0697ecea7e11db24290941983b08c9feb30921e6d8",
"url": "<https://files.pythonhosted.org/packages/8c/0e/10e247f40c89ba72b7f2a2104ccf1b65de18f79562ffe11bfb837b711acf/importlib_metadata-1.4.0.tar.gz>"
}
],
"project_name": "importlib-metadata",
"requires_dists": [
"configparser>=3.5; python_version < \"3\"",
"contextlib2; python_version < \"3\"",
"importlib-resources; python_version < \"3.7\" and extra == \"testing\"",
"packaging; extra == \"testing\"",
"pathlib2; python_version < \"3\"",
"rst.linker; extra == \"docs\"",
"sphinx; extra == \"docs\"",
"zipp>=0.5"
],
"requires_python": "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7",
"version": "1.4"
},
{
"artifacts": [
{
"algorithm": "sha256",
"hash": "83a28fcb75844b5c0cdaf5aa4003c2d728c77e05f5aeabe8e95e56727005fbaa",
"url": "<https://files.pythonhosted.org/packages/d8/20/256eb3f3f437c575fb1a2efdce5e801a5ce3162ea8117da96c43e6ee97d8/zipp-3.11.0-py3-none-any.whl>"
},
{
"algorithm": "sha256",
"hash": "a7a22e05929290a67401440b39690ae6563279bced5f314609d9d03798f56766",
"url": "<https://files.pythonhosted.org/packages/8e/b3/8b16a007184714f71157b1a71bbe632c5d66dd43bc8152b3c799b13881e1/zipp-3.11.0.tar.gz>"
}
],
"project_name": "zipp",
"requires_dists": [
"flake8<5; extra == \"testing\"",
"func-timeout; extra == \"testing\"",
"furo; extra == \"docs\"",
"jaraco.functools; extra == \"testing\"",
"jaraco.itertools; extra == \"testing\"",
"jaraco.packaging>=9; extra == \"docs\"",
"jaraco.tidelift>=1.4; extra == \"docs\"",
"more-itertools; extra == \"testing\"",
"pytest-black>=0.3.7; platform_python_implementation != \"PyPy\" and extra == \"testing\"",
"pytest-checkdocs>=2.4; extra == \"testing\"",
"pytest-cov; extra == \"testing\"",
"pytest-enabler>=1.3; extra == \"testing\"",
"pytest-flake8; python_version < \"3.12\" and extra == \"testing\"",
"pytest-mypy>=0.9.1; platform_python_implementation != \"PyPy\" and extra == \"testing\"",
"pytest>=6; extra == \"testing\"",
"rst.linker>=1.9; extra == \"docs\"",
"sphinx>=3.5; extra == \"docs\""
],
"requires_python": ">=3.7",
"version": "3.11"
}
],
"platform_tag": null
}
],
"path_mappings": {},
"pex_version": "2.1.108",
"pip_version": "20.3.4-patched",
"prefer_older_binary": false,
"requirements": [
"debugpy==1.6.3",
"importlib_metadata==1.4.0"
],
"requires_python": [
"<3.11,>=3.7"
],
"resolver_version": "pip-2020-resolver",
"style": "universal",
"target_systems": [
"linux",
"mac"
],
"transitive": true,
"use_pep517": null
}
bitter-ability-32190
11/28/2022, 4:18 PMdebugpy-1.6.3.zip"
OK we're out of my area of expertise, unfortunatelyripe-scooter-10665
11/28/2022, 4:31 PMbitter-ability-32190
11/28/2022, 4:36 PMripe-scooter-10665
11/28/2022, 4:47 PMbitter-ability-32190
11/28/2022, 4:54 PMimport debugpy
debugpy.listen(("localhost", 5678))
• run ./pants test --debug ...
ripe-scooter-10665
11/28/2022, 4:56 PMbitter-ability-32190
11/28/2022, 5:00 PM__init__
. Or a high-level pytest plugin, or a conftest.py
. Basically anywhere it'll get executed "early"-m debugpy
directly from pantsripe-scooter-10665
11/28/2022, 5:01 PMbitter-ability-32190
11/28/2022, 5:01 PMenough-analyst-54434
11/28/2022, 10:17 PM15:06:23.64 [INFO] Completed: Building pytest_runner.pex
15:06:23.64 [ERROR] 1 Exception encountered:
ProcessExecutionFailure: Process 'Building pytest_runner.pex' failed with exit code 1.
stdout:
stderr:
A distribution for debugpy could not be resolved for ~/.pyenv/versions/3.9.15/bin/python3.9.
Found 1 distribution for debugpy that do not apply:
1.) The wheel tags for debugpy 1.6.0 are cp38-cp38-macosx_10_15_x86_64 which do not match the supported tags of ~/.pyenv/versions/3.9.15/bin/python3.9:
cp39-cp39-macosx_13_0_arm64
... 409 more ...
Refers not to resolving dependencies from the internet, but resolving them from a built PEX. In other words, the PEX file contains only Python 3.8 debugpy, but the PEX was launched with Python 3.9; so no dice. Towards that end, from a quick read of code, it looks like the debugpy subsystem, although it supports ICs, is requested without them: https://github.com/pantsbuild/pants/blob/8fd8960ccb014f0e0bade811db970d513aedcef2/src/python/pants/backend/python/goals/pytest_runner.py#L543
I think that means maybe the ambient interpreter running Pants (3.9 in your case?), is what gets used to build that Pex. And that does not match the test batch in question which uses 3.8.
Just a guess.bitter-ability-32190
11/28/2022, 10:28 PMenough-analyst-54434
11/28/2022, 10:31 PMripe-scooter-10665
11/29/2022, 8:45 AMbitter-ability-32190
11/29/2022, 2:05 PM