Skip to content

Commit

Permalink
Use debugpy instead of ptvsd (getgauge#185)
Browse files Browse the repository at this point in the history
* getgauge#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]>
  • Loading branch information
NivedhaSenthil and BugDiver authored Aug 5, 2020
1 parent 50ca02b commit 7646a7f
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion build.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def run_tests():
if item.startswith("test_") and item.endswith(".py"):
fileNamePath = str(os.path.join(root, item))
exit_code = call([sys.executable, fileNamePath]
) if exit_code is 0 else exit_code
) if exit_code == 0 else exit_code
return exit_code


Expand Down
1 change: 0 additions & 1 deletion getgauge/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from os import environ, path
from threading import Timer

import ptvsd
from getgauge import logger
from getgauge.executor import (create_execution_status_response,
execute_method, run_hook)
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ six
pyfakefs==4.1.0
redbaron
twine
ptvsd==4.3.2
debugpy
grpcio-tools
grpcio==1.30.0
protobuf>=3.5.2
parso
futures
futures
2 changes: 1 addition & 1 deletion setup.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ setup(
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
],
install_requires=['redBaron', 'parso', 'ptvsd==4.3.2', 'grpcio==1.28.1', 'protobuf>=3.5.2', 'six'],
install_requires=['redBaron', 'parso', 'debugpy', 'grpcio==1.28.1', 'protobuf>=3.5.2', 'six'],
extras_require={1},
)
7 changes: 3 additions & 4 deletions start.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from threading import Timer

import grpc
import ptvsd
import debugpy
from getgauge import handlers, logger, processor
from getgauge.impl_loader import copy_skel_files
from getgauge.messages import services_pb2_grpc as spg
Expand Down Expand Up @@ -47,12 +47,11 @@ def _handle_detached():

def start():
if environ.get('DEBUGGING'):
ptvsd.enable_attach(address=(
'127.0.0.1', int(environ.get('DEBUG_PORT'))))
debugpy.listen(('127.0.0.1', int(environ.get('DEBUG_PORT'))))
print(ATTACH_DEBUGGER_EVENT)
t = Timer(int(environ.get("debugger_wait_time", 30)), _handle_detached)
t.start()
ptvsd.wait_for_attach()
debugpy.wait_for_client()
t.cancel()
logger.debug('Starting grpc server..')
server = grpc.server(ThreadPoolExecutor(max_workers=1))
Expand Down

0 comments on commit 7646a7f

Please sign in to comment.