Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace ptvsd by debugpy #37

Merged
merged 1 commit into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ ignored-classes=optparse.Values,thread._local,_thread._local
# (useful for modules/projects where namespaces are manipulated during runtime
# and thus existing member attributes cannot be deduced by static analysis). It
# supports qualified module names, as well as Unix pattern matching.
ignored-modules=pymxs,ptvsd,PySide2,menuhook,mxthread,socketio
ignored-modules=pymxs,debugpy,PySide2,menuhook,mxthread,socketio

# Show a hint with possible names when a member name was not found. The aspect
# of finding the hint is based on edit distance.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ most of the other samples.
- [realoadmod](/src/packages/reloadmod/README.md) is small tool that will reload all development modules in one
operation

- [mxvscode](/src/packages/mxvscode/README.md) is a small tool that will automatically import ptvsd (the
- [mxvscode](/src/packages/mxvscode/README.md) is a small tool that will automatically import debugpy (the
VSCode debugging interface) during the startup of 3ds Max and make it accept remote connections.
This may slow down the startup of 3ds Max quite a bit and is meant as a developer-only tool.

Expand Down
2 changes: 1 addition & 1 deletion src/packages/mxvscode/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# mxsvscode
VSCode debugging integration for 3ds Max.

This package installs ptvsd and enables debugging with vscode at the startup
This package installs debugpy and enables debugging with vscode at the startup
of 3ds Max.
17 changes: 14 additions & 3 deletions src/packages/mxvscode/mxvscode/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
"""
Enable vscode debugging during the startup of 3ds Max.
"""
import ptvsd
import sys
import os
import debugpy

def startup():
"""
Allow the remote vscode debugger to attach to the 3ds Max Python
Expand All @@ -10,5 +13,13 @@ def startup():
print("""mxvscode startup enabling vscode debugging
(if you don't use VSCode for debugging Python you can uninstall
mxvscode)""")
ptvsd.enable_attach()
print("-- now ready to receive debugging connections from vscode")

sysexec = sys.executable
(base, file) = os.path.split(sys.executable)
if file.lower() == "3dsmax.exe":
sys.executable = os.path.join(base, "python", "python.exe")
host = "localhost"
port = 5678
debugpy.listen((host, port))
print(f"-- now ready to receive debugging connections from vscode on (${host}, ${port})")
sys.executable = sysexec
2 changes: 1 addition & 1 deletion src/packages/mxvscode/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
long_description_content_type="text/markdown",
packages=setuptools.find_packages(),
install_requires=[
'ptvsd'
'debugpy'
],
entry_points={'3dsMax': 'startup=mxvscode:startup'},
python_requires='>=3.7'
Expand Down