From 2d220f8db82325a8f3f63e59a8affb355334e079 Mon Sep 17 00:00:00 2001 From: Jonas Jelten Date: Thu, 13 Mar 2025 16:59:39 +0100 Subject: [PATCH] add debugpy-adapter entrypoint (#1870) --- setup.py | 7 ++++++- src/debugpy/adapter/__main__.py | 6 ++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index d16a27c5..2c4b9b8e 100644 --- a/setup.py +++ b/setup.py @@ -196,6 +196,11 @@ if __name__ == "__main__": has_ext_modules=lambda: True, cmdclass=cmds, # allow the user to call "debugpy" instead of "python -m debugpy" - entry_points={"console_scripts": ["debugpy = debugpy.server.cli:main"]}, + entry_points={ + "console_scripts": [ + "debugpy = debugpy.server.cli:main", + "debugpy-adapter = debugpy.adapter.__main__:main", + ], + }, **extras ) diff --git a/src/debugpy/adapter/__main__.py b/src/debugpy/adapter/__main__.py index dd784cb5..93cd05f6 100644 --- a/src/debugpy/adapter/__main__.py +++ b/src/debugpy/adapter/__main__.py @@ -13,7 +13,9 @@ import sys # and should be imported locally inside main() instead. -def main(args): +def main(): + args = _parse_argv(sys.argv) + # If we're talking DAP over stdio, stderr is not guaranteed to be read from, # so disable it to avoid the pipe filling and locking up. This must be done # as early as possible, before the logging module starts writing to it. @@ -230,4 +232,4 @@ if __name__ == "__main__": # the default "C" locale if so. pass - main(_parse_argv(sys.argv)) + main()