Created
April 6, 2017 00:43
-
-
Save mattmc3/32600624f77d90cb7e68d5ab93f02260 to your computer and use it in GitHub Desktop.
VSCode tasks for Python 3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// # Be sure to set up virtualenv | |
// python3 -m venv .env | |
// source .env/bin/activate | |
// pip install --upgrade pip | |
// pip freeze > requirements.txt | |
// | |
// ${workspaceRoot} the path of the folder opened in VS Code | |
// ${file} the current opened file | |
// ${fileBasename} the current opened file's basename | |
// ${fileDirname} the current opened file's dirname | |
// ${fileExtname} the current opened file's extension | |
// ${cwd} the task runner's current working directory on startup | |
{ | |
"version": "0.1.0", | |
"command": "bash", | |
"isShellCommand": true, | |
"showOutput": "always", | |
"options": { | |
"cwd": "${workspaceRoot}" | |
}, | |
"args": [ | |
"-c" | |
], | |
"tasks": [ | |
{ | |
"taskName": "Python Run", | |
"suppressTaskName": true, | |
"isBuildCommand": true, | |
"args": ["source ${workspaceRoot}/.env/bin/activate; echo \"running ${file}\"; python ${file}; deactivate"] | |
}, | |
{ | |
"taskName": "pytest", | |
"suppressTaskName": true, | |
"isTestCommand": true, | |
"args": ["source ${workspaceRoot}/.env/bin/activate; py.test; deactivate"] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment