Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/python
{
"name": "Python 3",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/python:1-3.12-bookworm",
"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
"ms-python.black-formatter",
"ms-python.isort",
"ms-python.flake8",
"eamodio.gitlens"
]
}
},
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "pip3 install --user -r requirements.txt",
"postCreateCommand": "virtualenv venv && ./venv/bin/pip install -r requirements-dev.txt && ./venv/bin/pre-commit install"
// Configure tool-specific properties.
// "customizations": {},
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
1 change: 1 addition & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ exclude =
docker-compose.yaml,
frontend,
*.md,
*/*.md,
*.txt

extend-select =
Expand Down
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ repos:
- id: check-yaml

- id: check-json
exclude: ^.devcontainer/devcontainer.json$

- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.39.0
Expand Down
91 changes: 91 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug SunPower Integration",
"type": "debugpy",
"request": "launch",
"program": "${workspaceFolder}/testing/debug_runner.py",
"console": "integratedTerminal",
"envFile": "${workspaceFolder}/.env",
"env": {
"PYTHONPATH": "${workspaceFolder}:${workspaceFolder}/custom_components"
},
"cwd": "${workspaceFolder}",
"justMyCode": false,
"stopOnEntry": false
},
{
"name": "Test with Sample Data",
"type": "debugpy",
"request": "launch",
"program": "${workspaceFolder}/testing/test_with_sample_data.py",
"console": "integratedTerminal",
"env": {
"PYTHONPATH": "${workspaceFolder}:${workspaceFolder}/custom_components"
},
"cwd": "${workspaceFolder}",
"justMyCode": false,
"stopOnEntry": false
},
{
"name": "Debug HA Integration",
"type": "debugpy",
"request": "launch",
"program": "${workspaceFolder}/testing/test_ha_integration.py",
"console": "integratedTerminal",
"envFile": "${workspaceFolder}/.env",
"env": {
"PYTHONPATH": "${workspaceFolder}:${workspaceFolder}/custom_components"
},
"cwd": "${workspaceFolder}",
"justMyCode": false,
"stopOnEntry": false
},
{
"name": "Debug SunPower API Client",
"type": "debugpy",
"request": "launch",
"program": "${workspaceFolder}/testing/test_api.py",
"console": "integratedTerminal",
"envFile": "${workspaceFolder}/.env",
"env": {
"PYTHONPATH": "${workspaceFolder}:${workspaceFolder}/custom_components"
},
"cwd": "${workspaceFolder}",
"justMyCode": false,
"stopOnEntry": false
},
{
"name": "Debug Current File",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"envFile": "${workspaceFolder}/.env",
"env": {
"PYTHONPATH": "${workspaceFolder}:${workspaceFolder}/custom_components"
},
"cwd": "${workspaceFolder}",
"justMyCode": false
},
{
"name": "Run Tests",
"type": "debugpy",
"request": "launch",
"module": "pytest",
"args": [
"tests/",
"-v",
"--tb=short"
],
"console": "integratedTerminal",
"envFile": "${workspaceFolder}/.env",
"env": {
"PYTHONPATH": "${workspaceFolder}:${workspaceFolder}/custom_components"
},
"cwd": "${workspaceFolder}",
"justMyCode": false
}
]
}
47 changes: 47 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"python.defaultInterpreterPath": "./venv/bin/python",
"python.terminal.activateEnvironment": true,
"python.linting.enabled": true,
"python.linting.flake8Enabled": true,
"python.linting.pylintEnabled": false,
"python.formatting.provider": "black",
"python.formatting.blackArgs": [
"--line-length",
"99"
],
"python.sortImports.args": [
"--profile",
"black"
],
"editor.insertSpaces": true,
"editor.tabSize": 2,
"editor.formatOnSave": true,
"editor.detectIndentation": false,
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit"
},
"files.exclude": {
"**/__pycache__": true,
"**/*.pyc": true,
".pytest_cache": true,
".coverage": true,
"htmlcov": true
},
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit"
}
},
"python.testing.pytestEnabled": true,
"python.testing.unittestEnabled": false,
"python.testing.pytestArgs": [
"tests"
],
"python.analysis.typeCheckingMode": "basic",
"python.analysis.autoImportCompletions": true,
"python.analysis.extraPaths": [
"./custom_components"
]
}
Loading