Merge pull request #64 from puremourning/python-ptvsd
Demo of python attach
This commit is contained in:
commit
c26fe1ddd2
8 changed files with 49 additions and 6 deletions
|
|
@ -42,8 +42,13 @@ stages:
|
|||
go get -u github.com/go-delve/delve/cmd/dlv
|
||||
displayName: 'Install Delve for Go'
|
||||
|
||||
# TODO: Use cache to store the download directory
|
||||
- bash: python3 install_gadget.py --all --force-all
|
||||
- task: CacheBeta@0
|
||||
inputs:
|
||||
key: v1 | gadgets | $(Agent.OS) | install_gadget.py
|
||||
path: gadgets/linux/download
|
||||
displayName: Cache gadgets
|
||||
|
||||
- bash: python3 install_gadget.py --all
|
||||
displayName: 'Install gadgets - python3'
|
||||
|
||||
- bash: vim --version
|
||||
|
|
@ -78,7 +83,13 @@ stages:
|
|||
- bash: go get -u github.com/go-delve/delve/cmd/dlv
|
||||
displayName: 'Install Delve for Go'
|
||||
|
||||
- bash: python3 install_gadget.py --all --force-all
|
||||
- task: CacheBeta@0
|
||||
inputs:
|
||||
key: v1 | gadgets | $(Agent.OS) | install_gadget.py
|
||||
path: gadgets/macos/download
|
||||
displayName: Cache gadgets
|
||||
|
||||
- bash: python3 install_gadget.py --all
|
||||
displayName: 'Install gadgets - python3'
|
||||
|
||||
- bash: vim --version
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ GADGETS = {
|
|||
'language': 'tcl',
|
||||
'repo': {
|
||||
'url': 'https://github.com/puremourning/TclProDebug',
|
||||
'ref': 'master',
|
||||
'ref': 'f5c56b7067661ce84e205765060224076569ae0e', # master 26/10/2019
|
||||
},
|
||||
'do': lambda name, root: InstallTclProDebug( name, root )
|
||||
},
|
||||
|
|
|
|||
|
|
@ -94,7 +94,9 @@ class DebugSession( object ):
|
|||
|
||||
adapters.update( database.get( 'adapters' ) or {} )
|
||||
|
||||
if len( configurations ) == 1:
|
||||
if 'configuration' in launch_variables:
|
||||
configuration_name = launch_variables.pop( 'configuration' )
|
||||
elif len( configurations ) == 1:
|
||||
configuration_name = next( iter( configurations.keys() ) )
|
||||
else:
|
||||
configuration_name = utils.SelectFromList(
|
||||
|
|
|
|||
1
support/test/python/simple_python/.gitignore
vendored
Normal file
1
support/test/python/simple_python/.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
env/
|
||||
|
|
@ -10,6 +10,15 @@
|
|||
"stopOnEntry": true,
|
||||
"console": "integratedTerminal"
|
||||
}
|
||||
},
|
||||
"attach": {
|
||||
"adapter": "vscode-python",
|
||||
"configuration": {
|
||||
"request": "attach",
|
||||
"type": "python",
|
||||
"host": "localhost",
|
||||
"port": "5678"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
1
support/test/python/simple_python/requirements.txt
Normal file
1
support/test/python/simple_python/requirements.txt
Normal file
|
|
@ -0,0 +1 @@
|
|||
ptvsd==4.3.2
|
||||
19
support/test/python/simple_python/run_with_ptvsd
Executable file
19
support/test/python/simple_python/run_with_ptvsd
Executable file
|
|
@ -0,0 +1,19 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
PYTHON=python3
|
||||
|
||||
if [ -n "$1" ]; then
|
||||
PYTHON=$1
|
||||
fi
|
||||
|
||||
pushd $(dirname $0)
|
||||
if [ ! -d env ]; then
|
||||
virtualenv -p $PYTHON env
|
||||
fi
|
||||
|
||||
. env/bin/activate
|
||||
pip install -r requirements.txt
|
||||
|
||||
python -m ptvsd --wait --host localhost --port 5678 main.py
|
||||
popd
|
||||
|
||||
|
|
@ -34,7 +34,7 @@ with patch( 'vimspector.utils.SelectFromList',
|
|||
return_value=None ) as p:
|
||||
with patch( 'vimspector.utils.AskForInput',
|
||||
return_value=None ) as p:
|
||||
vim.eval( 'feedkeys( "\<F5>", "xt" )' )
|
||||
vim.eval( 'vimspector#LaunchWithSettings( { "configuration": "run" } )' )
|
||||
vim.eval( 'vimspector#test#signs#AssertCursorIsAtLineInBuffer( fn, 6, 1 )' )
|
||||
p.assert_called()
|
||||
EOF
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue