Visual Studio Code Settings for Python
See Getting Started with Python in VS Code and then Python environments in VS Code. Note the use of .env file
Workspace Files
.vscode/launch.json
:
See https://code.visualstudio.com/docs/python/debugging
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"justMyCode": false,
"args": ["--pythonpath", "/foo/bar", "mqtt", "cpu_percent"],
}
]
}
.vscode/settings.json
Also see python-linting and settings-reference.
{
"mypy-type-checker.args": [
"--ignore-missing-imports",
"--follow-imports=silent",
"--show-column-numbers",
"--strict"
],
"python.testing.pytestEnabled": false,
"python.testing.unittestEnabled": true,
"python.testing.unittestArgs": [
"-v",
"-s",
".",
"-p",
"*_test.py"
],
"cSpell.words": [
"scrapy"
]
}
You can tell I like unittest
and mypy
, not pylint
and pytest
.
.flake8
[flake8]
extend-ignore = E127,E128,E231,E265,E302,E501
exclude = doc,.git,.mypy_cache,__pycache__,.vscode
max-complexity = 20
.gitignore
__pycache__/
__pypackages__/
venv/
.scrapy
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
*.log
mypy.ini
[mypy-recurrent.*]
ignore_missing_imports = True