Merge pull request #64 from puremourning/python-ptvsd

Demo of python attach
This commit is contained in:
mergify[bot] 2019-10-26 14:54:54 +00:00 • committed by GitHub
commit c26fe1ddd2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 49 additions and 6 deletions

View file

@ -42,8 +42,13 @@ stages:
go get -u github.com/go-delve/delve/cmd/dlv go get -u github.com/go-delve/delve/cmd/dlv
displayName: 'Install Delve for Go' displayName: 'Install Delve for Go'
# TODO: Use cache to store the download directory - task: CacheBeta@0
- bash: python3 install_gadget.py --all --force-all 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' displayName: 'Install gadgets - python3'
- bash: vim --version - bash: vim --version
@ -78,7 +83,13 @@ stages:
- bash: go get -u github.com/go-delve/delve/cmd/dlv - bash: go get -u github.com/go-delve/delve/cmd/dlv
displayName: 'Install Delve for Go' 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' displayName: 'Install gadgets - python3'
- bash: vim --version - bash: vim --version

View file

@ -111,7 +111,7 @@ GADGETS = {
'language': 'tcl', 'language': 'tcl',
'repo': { 'repo': {
'url': 'https://github.com/puremourning/TclProDebug', 'url': 'https://github.com/puremourning/TclProDebug',
'ref': 'master', 'ref': 'f5c56b7067661ce84e205765060224076569ae0e', # master 26/10/2019
}, },
'do': lambda name, root: InstallTclProDebug( name, root ) 'do': lambda name, root: InstallTclProDebug( name, root )
}, },

View file

@ -94,7 +94,9 @@ class DebugSession( object ):
adapters.update( database.get( 'adapters' ) or {} ) 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() ) ) configuration_name = next( iter( configurations.keys() ) )
else: else:
configuration_name = utils.SelectFromList( configuration_name = utils.SelectFromList(

View file

@ -0,0 +1 @@
env/

View file

@ -10,6 +10,15 @@
"stopOnEntry": true, "stopOnEntry": true,
"console": "integratedTerminal" "console": "integratedTerminal"
} }
},
"attach": {
"adapter": "vscode-python",
"configuration": {
"request": "attach",
"type": "python",
"host": "localhost",
"port": "5678"
}
} }
} }
} }

View file

@ -0,0 +1 @@
ptvsd==4.3.2

View 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

View file

@ -34,7 +34,7 @@ with patch( 'vimspector.utils.SelectFromList',
return_value=None ) as p: return_value=None ) as p:
with patch( 'vimspector.utils.AskForInput', with patch( 'vimspector.utils.AskForInput',
return_value=None ) as p: 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 )' ) vim.eval( 'vimspector#test#signs#AssertCursorIsAtLineInBuffer( fn, 6, 1 )' )
p.assert_called() p.assert_called()
EOF EOF