Skip to content

Commit

Permalink
Refresh development files
Browse files Browse the repository at this point in the history
  • Loading branch information
felipecrs committed Oct 12, 2023
1 parent 5190865 commit d93b853
Show file tree
Hide file tree
Showing 24 changed files with 180 additions and 298 deletions.
38 changes: 38 additions & 0 deletions .devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"image": "mcr.microsoft.com/devcontainers/python:3.11-bullseye",
"postCreateCommand": "scripts/setup",
"forwardPorts": [8123],
"portsAttributes": {
"8123": {
"label": "Home Assistant",
"onAutoForward": "notify"
}
},
"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"github.vscode-pull-request-github",
"ryanluker.vscode-coverage-gutters",
"charliermarsh.ruff",
"ms-python.black-formatter"
],
"settings": {
"files.eol": "\n",
"editor.tabSize": 2,
"python.pythonPath": "/usr/bin/python3",
"python.analysis.autoSearchPaths": false,
"editor.formatOnPaste": false,
"editor.formatOnSave": true,
"editor.formatOnType": true,
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter"
},
"python.formatting.provider": "none"
}
}
},
"remoteUser": "vscode"
}
14 changes: 0 additions & 14 deletions .devcontainer/Dockerfile

This file was deleted.

60 changes: 0 additions & 60 deletions .devcontainer/README.md

This file was deleted.

37 changes: 0 additions & 37 deletions .devcontainer/devcontainer.json

This file was deleted.

4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ updates:
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
30 changes: 15 additions & 15 deletions .github/workflows/pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,27 @@ jobs:
runs-on: "ubuntu-latest"
name: Validate
steps:
- uses: "actions/checkout@v4"
- uses: "actions/checkout@v4"

- name: HACS validation
uses: "hacs/action@main"
with:
category: "integration"
ignore: brands
- name: HACS validation
uses: "hacs/action@main"
with:
category: "integration"
ignore: brands

- name: Hassfest validation
uses: "home-assistant/actions/hassfest@master"
- name: Hassfest validation
uses: "home-assistant/actions/hassfest@master"

style:
runs-on: "ubuntu-latest"
name: Check style formatting
steps:
- uses: "actions/checkout@v4"
- uses: "actions/setup-python@v4"
with:
python-version: "3.x"
- run: python3 -m pip install black
- run: black .
- uses: "actions/checkout@v4"
- uses: "actions/setup-python@v4"
with:
python-version: "3.x"
- run: python3 -m pip install black
- run: black .

tests:
runs-on: "ubuntu-latest"
Expand All @@ -41,7 +41,7 @@ jobs:
with:
python-version: "3.10"
- name: Install requirements
run: python3 -m pip install -r requirements_dev.txt
run: python3 -m pip install -r requirements.txt
- name: Run tests
run: |
pytest \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
with:
python-version: "3.11"
- name: Install requirements
run: python3 -m pip install -r requirements_dev.txt
run: python3 -m pip install -r requirements.txt
- name: Run tests
run: |
pytest \
Expand Down
48 changes: 48 additions & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# The contents of this file is based on https://github.com/home-assistant/core/blob/dev/pyproject.toml

target-version = "py310"

select = [
"B007", # Loop control variable {name} not used within loop body
"B014", # Exception handler with duplicate exception
"C", # complexity
"D", # docstrings
"E", # pycodestyle
"F", # pyflakes/autoflake
"ICN001", # import concentions; {name} should be imported as {asname}
"PGH004", # Use specific rule codes when using noqa
"PLC0414", # Useless import alias. Import alias does not rename original package.
"SIM105", # Use contextlib.suppress({exception}) instead of try-except-pass
"SIM117", # Merge with-statements that use the same scope
"SIM118", # Use {key} in {dict} instead of {key} in {dict}.keys()
"SIM201", # Use {left} != {right} instead of not {left} == {right}
"SIM212", # Use {a} if {a} else {b} instead of {b} if not {a} else {a}
"SIM300", # Yoda conditions. Use 'age == 42' instead of '42 == age'.
"SIM401", # Use get from dict with default instead of an if block
"T20", # flake8-print
"TRY004", # Prefer TypeError exception for invalid type
"RUF006", # Store a reference to the return value of asyncio.create_task
"UP", # pyupgrade
"W", # pycodestyle
]

ignore = [
"D202", # No blank lines allowed after function docstring
"D203", # 1 blank line required before class docstring
"D213", # Multi-line docstring summary should start at the second line
"D404", # First word of the docstring should not be This
"D406", # Section name should end with a newline
"D407", # Section name underlining
"D411", # Missing blank line before section
"E501", # line too long
"E731", # do not assign a lambda expression, use a def
]

[flake8-pytest-style]
fixture-parentheses = false

[pyupgrade]
keep-runtime-typing = true

[mccabe]
max-complexity = 25
43 changes: 10 additions & 33 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,11 @@
{
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
// Example of attaching to local debug server
"name": "Python: Attach Local",
"type": "python",
"request": "attach",
"port": 5678,
"host": "localhost",
"pathMappings": [
{
"localRoot": "${workspaceFolder}",
"remoteRoot": "."
}
],
},
{
// Example of attaching to my production server
"name": "Python: Attach Remote",
"type": "python",
"request": "attach",
"port": 5678,
"host": "homeassistant.local",
"pathMappings": [
{
"localRoot": "${workspaceFolder}",
"remoteRoot": "/usr/src/homeassistant"
}
]
}
]
}
"version": "2.0.0",
"tasks": [
{
"label": "Run Home Assistant on port 8123",
"type": "shell",
"command": "scripts/develop",
"problemMatcher": []
}
]
}
16 changes: 0 additions & 16 deletions .vscode/settings.json

This file was deleted.

29 changes: 0 additions & 29 deletions .vscode/tasks.json

This file was deleted.

22 changes: 10 additions & 12 deletions .devcontainer/configuration.yaml → config/configuration.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
default_config:

logger:
default: info
logs:
custom_components.expose_camera_stream_source: debug

stream:

debugpy:

expose_camera_stream_source:
# https://www.home-assistant.io/integrations/default_config/
default_config:

# https://www.home-assistant.io/integrations/logger/
logger:
default: info
logs:
custom_components.expose_camera_stream_source: debug

expose_camera_stream_source:
3 changes: 1 addition & 2 deletions custom_components/expose_camera_stream_source/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""
Custom integration to integrate expose_camera_stream_source with Home Assistant.
"""Custom integration to integrate expose_camera_stream_source with Home Assistant.
For more details about this integration, please refer to
https://github.com/felipecrs/hass-expose-camera-stream-source
Expand Down
Loading

0 comments on commit d93b853

Please sign in to comment.