Skip to content

Commit

Permalink
Update python to 3.11 and add Black formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
carleeno committed Oct 12, 2023
1 parent 1e5f460 commit 20a8aeb
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 11 deletions.
10 changes: 4 additions & 6 deletions .devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ElevenLabs TTS Custom Component",
"image": "mcr.microsoft.com/vscode/devcontainers/python:0-3.10-bullseye",
"image": "mcr.microsoft.com/vscode/devcontainers/python:0-3.11",
"postCreateCommand": "scripts/setup",
"appPort": [
"9123:8123"
Expand All @@ -11,17 +11,15 @@
"ms-python.python",
"github.vscode-pull-request-github",
"ryanluker.vscode-coverage-gutters",
"ms-python.vscode-pylance"
"ms-python.vscode-pylance",
"ms-python.black-formatter"
],
"settings": {
"files.eol": "\n",
"editor.tabSize": 4,
"python.pythonPath": "/usr/bin/python3",
"python.analysis.autoSearchPaths": false,
"python.linting.pylintEnabled": true,
"python.linting.enabled": true,
"python.formatting.provider": "black",
"python.formatting.blackPath": "/usr/local/py-utils/bin/black",
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.formatOnPaste": false,
"editor.formatOnSave": true,
"editor.formatOnType": true,
Expand Down
21 changes: 20 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,30 @@ jobs:
- name: "Set up Python"
uses: actions/[email protected]
with:
python-version: "3.10"
python-version: "3.11"
cache: "pip"

- name: "Install requirements"
run: python3 -m pip install -r requirements.txt

- name: "Run"
run: python3 -m ruff check .

black:
name: "Black"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout the repository"
uses: "actions/[email protected]"

- name: "Set up Python"
uses: actions/[email protected]
with:
python-version: "3.11"
cache: "pip"

- name: "Install requirements"
run: python3 -m pip install -r requirements.txt

- name: "Run"
run: python3 -m black --check .
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: "Set up Python"
uses: actions/[email protected]
with:
python-version: "3.10"
python-version: "3.11"
cache: "pip"

- name: "Install requirements"
Expand Down
2 changes: 1 addition & 1 deletion hacs.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "ElevenLabs TTS",
"filename": "elevenlabs_tts.zip",
"hide_default_branch": true,
"homeassistant": "2023.5.3",
"homeassistant": "2023.10.1",
"render_readme": true,
"zip_release": true
}
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
colorlog==6.7.0
homeassistant>=2023.5.3
homeassistant>=2023.8.1
pip>=21.0,<23.3
ruff==0.0.292
black==23.3.0
orjson
2 changes: 1 addition & 1 deletion requirements_test.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-r requirements.txt
pytest
pytest-cov
pytest-homeassistant-custom-component==0.13.45
pytest-homeassistant-custom-component==0.13.64
pre-commit>=2.11.1
respx

Expand Down
2 changes: 2 additions & 0 deletions scripts/lint
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ set -e
cd "$(dirname "$0")/.."

ruff check . --fix

black .

0 comments on commit 20a8aeb

Please sign in to comment.