add debugpy-adapter entrypoint (#1870)

This commit is contained in:
Jonas Jelten 2025-03-13 16:59:39 +01:00 committed by GitHub
parent f7d8963f99
commit 2d220f8db8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 3 deletions

View file

@ -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
)

View file

@ -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()