Skip to content

Commit 7646a7f

Browse files
NivedhaSenthilBugDiver
andauthored
Use debugpy instead of ptvsd (#185)
* #180 Use debugpy instead of ptvsd - since vscode removes support for ptvsd soon Signed-off-by: NivedhaSenthil <[email protected]> * Fix build.py Signed-off-by: BugDiver <[email protected]> Co-authored-by: BugDiver <[email protected]>
1 parent 50ca02b commit 7646a7f

File tree

5 files changed

+7
-9
lines changed

5 files changed

+7
-9
lines changed

build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def run_tests():
108108
if item.startswith("test_") and item.endswith(".py"):
109109
fileNamePath = str(os.path.join(root, item))
110110
exit_code = call([sys.executable, fileNamePath]
111-
) if exit_code is 0 else exit_code
111+
) if exit_code == 0 else exit_code
112112
return exit_code
113113

114114

getgauge/processor.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from os import environ, path
44
from threading import Timer
55

6-
import ptvsd
76
from getgauge import logger
87
from getgauge.executor import (create_execution_status_response,
98
execute_method, run_hook)

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ six
22
pyfakefs==4.1.0
33
redbaron
44
twine
5-
ptvsd==4.3.2
5+
debugpy
66
grpcio-tools
77
grpcio==1.30.0
88
protobuf>=3.5.2
99
parso
10-
futures
10+
futures

setup.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ setup(
2222
'Programming Language :: Python :: 3.6',
2323
'Programming Language :: Python :: 3.7',
2424
],
25-
install_requires=['redBaron', 'parso', 'ptvsd==4.3.2', 'grpcio==1.28.1', 'protobuf>=3.5.2', 'six'],
25+
install_requires=['redBaron', 'parso', 'debugpy', 'grpcio==1.28.1', 'protobuf>=3.5.2', 'six'],
2626
extras_require={1},
2727
)

start.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from threading import Timer
88

99
import grpc
10-
import ptvsd
10+
import debugpy
1111
from getgauge import handlers, logger, processor
1212
from getgauge.impl_loader import copy_skel_files
1313
from getgauge.messages import services_pb2_grpc as spg
@@ -47,12 +47,11 @@ def _handle_detached():
4747

4848
def start():
4949
if environ.get('DEBUGGING'):
50-
ptvsd.enable_attach(address=(
51-
'127.0.0.1', int(environ.get('DEBUG_PORT'))))
50+
debugpy.listen(('127.0.0.1', int(environ.get('DEBUG_PORT'))))
5251
print(ATTACH_DEBUGGER_EVENT)
5352
t = Timer(int(environ.get("debugger_wait_time", 30)), _handle_detached)
5453
t.start()
55-
ptvsd.wait_for_attach()
54+
debugpy.wait_for_client()
5655
t.cancel()
5756
logger.debug('Starting grpc server..')
5857
server = grpc.server(ThreadPoolExecutor(max_workers=1))

0 commit comments

Comments
 (0)