Skip to content

Commit 2d220f8

Browse files
authored
add debugpy-adapter entrypoint (#1870)
1 parent f7d8963 commit 2d220f8

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

setup.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,11 @@ def tail_is(*suffixes):
196196
has_ext_modules=lambda: True,
197197
cmdclass=cmds,
198198
# allow the user to call "debugpy" instead of "python -m debugpy"
199-
entry_points={"console_scripts": ["debugpy = debugpy.server.cli:main"]},
199+
entry_points={
200+
"console_scripts": [
201+
"debugpy = debugpy.server.cli:main",
202+
"debugpy-adapter = debugpy.adapter.__main__:main",
203+
],
204+
},
200205
**extras
201206
)

src/debugpy/adapter/__main__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
# and should be imported locally inside main() instead.
1414

1515

16-
def main(args):
16+
def main():
17+
args = _parse_argv(sys.argv)
18+
1719
# If we're talking DAP over stdio, stderr is not guaranteed to be read from,
1820
# so disable it to avoid the pipe filling and locking up. This must be done
1921
# as early as possible, before the logging module starts writing to it.
@@ -230,4 +232,4 @@ def _parse_argv(argv):
230232
# the default "C" locale if so.
231233
pass
232234

233-
main(_parse_argv(sys.argv))
235+
main()

0 commit comments

Comments
 (0)