Repository navigation
pvsc-dev-ext.py has issues for first time users #3837
Description
Having issues running python3 pvsc-dev-ext.py setup stable for the first time
python3 pvsc-dev-ext.py setup stable
Cloning https://github.com/Microsoft/vscode-python.git ...
Traceback (most recent call last):
File "pvsc-dev-ext.py", line 142, in <module>
setup(VSCode[args.install_type])
File "pvsc-dev-ext.py", line 111, in setup
clone_repo(checkout)
File "pvsc-dev-ext.py", line 47, in clone_repo
run_command(cmd)
File "pvsc-dev-ext.py", line 36, in run_command
cmd.check_returncode()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 422, in check_returncode
self.stderr)
subprocess.CalledProcessError: Command '['git', 'clone', '-q', '--single-branch', '--branch', 'master', 'https://github.com/Microsoft/vscode-python.git', '/Users/anthonyshaw/.vscode/extensions/vscode-python']' returned non-zero exit status 1.
I looked at the script and the issue is that subprocess.Popen is being called with shell=true so the list of arguments are not being parsed.
If I changed it to shell=False the script works
python3 pvsc-dev-ext.py setup stable
Cloning https://github.com/Microsoft/vscode-python.git ...
Installing npm dependencies ...
Building TypeScript files ...
Installing PyPI packages ...
the second issue was that if any of the subprocess.run calls fail, it doesn't print the output from the command to the screen. I'd updated the script again to handle subprocess.CalledProcessError exceptions in the __main__ section and print the command requested and the output.
Cloning git@github.com:tonybaloney/vscode-python ...
Failed to run command ['git', 'clone', '-q', '--single-branch', '--branch', 'refactor_local_to_field', 'git@github.com:tonybaloney/vscode-python', '/Users/anthonyshaw/.vscode/extensions/vscode-python'] : b"fatal: destination path '/Users/anthonyshaw/.vscode/extensions/vscode-python' already exists and is not an empty directory.\n"
The 3rd thing, is that it would be nice to request a different origin and branch when cloning. I'm trying to setup a development environment to contribute to the project. I could clone, cd to the plugin path, add a remote and configure the default upstream remote, but that seems to be working against the workflow that was designed.
So I'd added 2 optional arguments, --branch (which defaults to master) and --repo which defaults to REPO_URL.
python3 pvsc-dev-ext.py setup stable --repo git@github.com:tonybaloney/vscode-python --branch refactor_local_to_field
PR to follow
Activity
ericsnowcurrently commentedon Jan 7, 2019
I've verified that the script works on master.