Last active
June 4, 2024 11:21
-
-
Save yuvve/2b87176e5b26cb8e0851fe4c2689e87e to your computer and use it in GitHub Desktop.
VSCode launch settings for Python, Pytest and Scrapy, that add the VSCode workspace to path
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
// Using the launch settings below, | |
// you can debug (F5) modules inside subfolders | |
// that import files from parent- or sister folders | |
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "Python: Run Module With Path", | |
"type": "python", | |
"request": "launch", | |
"program":"${file}", | |
"justMyCode": true, | |
"env":{ | |
"PYTHONPATH":"${workspaceFolder}" | |
} | |
}, | |
{ | |
"name":"Pytest: Run Module With Path", | |
"type": "python", | |
"request":"launch", | |
"module": "pytest", | |
"args": ["${file}", "-s"], | |
"env":{ | |
"PYTHONPATH":"${workspaceFolder}" | |
} | |
}, | |
{ | |
"name":"Pytest: Run All Tests With Path", | |
"type": "python", | |
"request":"launch", | |
"module": "pytest", | |
"args": ["-s"], | |
"env":{ | |
"PYTHONPATH":"${workspaceFolder}" | |
} | |
}, | |
{ | |
"name": "Crawl with scrapy", | |
"type": "python", | |
"request": "launch", | |
"module": "scrapy", | |
"cwd": "${fileDirname}", | |
"args": [ | |
"crawl", | |
"crawlingNLP", | |
"-a", | |
"start_urls=\"https://bdx.se\"", | |
"-L", | |
"ERROR" | |
], | |
"justMyCode": false, | |
"console": "integratedTerminal", | |
"env":{ | |
"PYTHONPATH":"${workspaceFolder}" | |
} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment