Skip to content

Commit

Permalink
Merge pull request #119 from golles/update-python-3.12
Browse files Browse the repository at this point in the history
Update Python to 3.12, devcontainer and make it possible to run HA in a Codespace
  • Loading branch information
golles authored Feb 16, 2024
2 parents 838acb9 + f4993be commit 30748e8
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 19 deletions.
7 changes: 6 additions & 1 deletion .devcontainer/configuration.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
default_config:

http:
use_x_forwarded_for: true
trusted_proxies:
- 127.0.0.1
- ::1

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

# If you need to debug uncommment the line below (doc: https://www.home-assistant.io/integrations/debugpy/)
# debugpy:
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "HA KNMI development",
"image": "mcr.microsoft.com/vscode/devcontainers/python:0-3.11-bullseye",
"image": "mcr.microsoft.com/devcontainers/python:3.12-bookworm",
"postCreateCommand": "scripts/setup",
"forwardPorts": [8123],
"customizations": {
Expand All @@ -22,6 +22,7 @@
"files.eol": "\n",
"editor.tabSize": 4,
"python.analysis.autoSearchPaths": false,
"python.experiments.optOutFrom": ["pythonTestAdapter"],
"python.formatting.blackPath": "/usr/local/py-utils/bin/black",
"editor.formatOnPaste": false,
"editor.formatOnSave": true,
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/issue.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ body:
required: true
attributes:
label: Python version
placeholder: "3.11"
placeholder: "3.12"
description: >
Can be found in [![System info](https://my.home-assistant.io/badges/system_health.svg)](https://my.home-assistant.io/redirect/system_health/)
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
pull_request: ~

env:
DEFAULT_PYTHON: "3.11"
DEFAULT_PYTHON: "3.12"

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand All @@ -32,7 +32,7 @@ jobs:
- name: Check code formatting with isort
uses: isort/isort-action@master
with:
requirementsFiles: "requirements.txt requirements_test.txt"
requirementsFiles: "requirements.txt requirements_dev.txt"

tests:
runs-on: ubuntu-latest
Expand All @@ -48,8 +48,7 @@ jobs:

- name: Install requirements
run: |
python3 -m pip install -r requirements.txt
python3 -m pip install -r requirements_test.txt
python3 -m pip install -r requirements_dev.txt
- name: Run tests
run: |
Expand Down
5 changes: 1 addition & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
pip>=21.0,<24.1
isort
colorlog
homeassistant
homeassistant>=2023.9.0
5 changes: 5 additions & 0 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-r requirements.txt
pip>=21.0,<24.1
isort
colorlog
pytest-homeassistant-custom-component
1 change: 0 additions & 1 deletion requirements_test.txt

This file was deleted.

2 changes: 1 addition & 1 deletion scripts/setup
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ set -e

cd "$(dirname "$0")/.."

python3 -m pip install --requirement requirements.txt
python3 -m pip install --requirement requirements_dev.txt
7 changes: 2 additions & 5 deletions scripts/update
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ set -e

cd "$(dirname "$0")/.."

python3 -m pip install --upgrade --force-reinstall --requirement requirements.txt
sudo apt update && sudo apt -y upgrade

if python -c "import pytest_homeassistant_custom_component" &> /dev/null; then
# User also has test requirements, update those as well.
python3 -m pip install --upgrade --force-reinstall --requirement requirements_test.txt
fi
python3 -m pip install --upgrade --force-reinstall --requirement requirements_dev.txt
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ sonar.sourceEncoding=UTF-8
sonar.sources=custom_components
sonar.tests=tests

sonar.python.version=3.11
sonar.python.version=3.12
sonar.python.coverage.reportPaths=coverage.xml

0 comments on commit 30748e8

Please sign in to comment.