Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump python to 3.13 following core 2024.12 #656

Merged
merged 5 commits into from
Nov 29, 2024
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: Latest release

env:
CACHE_VERSION: 10
DEFAULT_PYTHON: "3.12"
DEFAULT_PYTHON: "3.13"

# Only run on merges
on:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: Latest commit

env:
CACHE_VERSION: 11
DEFAULT_PYTHON: "3.12"
DEFAULT_PYTHON: "3.13"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Python version 3.13 is not yet supported by Home Assistant core

The verification shows that Home Assistant core currently requires Python >=3.12.0 in its pyproject.toml, and there's no evidence of an upcoming move to Python 3.13. While there are some compatibility packages prepared for Python 3.13 in the constraints file, the core itself is not yet ready for this version. This change should be reverted to maintain compatibility with Home Assistant core.

  • .github/workflows/verify.yml: Change DEFAULT_PYTHON: "3.13" back to a supported version (3.12)
  • Same change needed at lines 176 and 216
🔗 Analysis chain

Verify compatibility with Home Assistant core

Since this PR is titled "Bump python to 3.123 following core 2024.12", please ensure that:

  1. This aligns with Home Assistant core's Python version requirements
  2. All constraints from Home Assistant core are compatible

Also applies to: 176-176, 216-216

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check Home Assistant core compatibility

# Check for Python version requirements in HA core constraints
curl -s https://raw.githubusercontent.com/home-assistant/core/dev/homeassistant/package_constraints.txt | grep -i "python_version"

# Check for any Python version specific dependencies
curl -s https://raw.githubusercontent.com/home-assistant/core/dev/requirements_test.txt | grep -i "python_version"

Length of output: 382


Script:

#!/bin/bash
# Let's check the core repository's Python version requirements more comprehensively

# Check pyproject.toml in core for Python version
curl -s https://raw.githubusercontent.com/home-assistant/core/dev/pyproject.toml | grep -A 5 "python ="

# Check setup.py in core for Python version
curl -s https://raw.githubusercontent.com/home-assistant/core/dev/setup.py | grep -A 5 "python_requires"

# Check if there are any recent commits mentioning Python 3.13
curl -s "https://api.github.com/repos/home-assistant/core/commits?per_page=10" | jq -r '.[] | select(.commit.message | contains("3.13")) | .commit.message'

Length of output: 629

PRE_COMMIT_HOME: ~/.cache/pre-commit

on:
Expand Down Expand Up @@ -173,7 +173,7 @@ jobs:
needs: commitcheck
strategy:
matrix:
python-version: ["3.12"]
python-version: ["3.13", "3.12"]
steps:
- name: Check out committed code
uses: actions/checkout@v4
Expand Down Expand Up @@ -213,7 +213,7 @@ jobs:
needs: prepare-test-cache
strategy:
matrix:
python-version: ["3.12"]
python-version: ["3.13", "3.12"]

steps:
- name: Check out committed code
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ci:

default_language_version:
# force all unspecified python hooks to run python3
python: python3.12
python: python3.13
CoMPaTech marked this conversation as resolved.
Show resolved Hide resolved

repos:
# Run manually in CI skipping the branch checks
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## v1.6.1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why a version-bump? Nothing changes to the actual code?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pyproject.toml changed indicating compatibility with 3.13 - hence 1.60 would only be displayed as compatible with 3.12 - as such bumping the version

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah OK :)


- Support python 3.13

## v1.6.0

- New Feature: implement collection of location/zone data: Plugwise Adam thermostat representations are zone-based instead of device-based.
Expand Down
11 changes: 6 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "plugwise"
version = "1.6.0"
version = "1.6.1"
license = {file = "LICENSE"}
description = "Plugwise Smile (Adam/Anna/P1) and Stretch module for Python 3."
readme = "README.md"
Expand All @@ -15,6 +15,7 @@ classifiers = [
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Home Automation",
]
authors = [
Expand All @@ -24,7 +25,7 @@ maintainers = [
{ name = "bouwew"},
{ name = "CoMPaTech" }
]
requires-python = ">=3.11.0"
requires-python = ">=3.12.0"
dependencies = [
"aiohttp",
"defusedxml",
Expand All @@ -47,7 +48,7 @@ include-package-data = true
include = ["plugwise*"]

[tool.black]
target-version = ["py312"]
target-version = ["py313"]
exclude = 'generated'

[tool.isort]
Expand Down Expand Up @@ -185,7 +186,7 @@ norecursedirs = [
]

[tool.mypy]
python_version = "3.12"
python_version = "3.13"
show_error_codes = true
follow_imports = "silent"
ignore_missing_imports = true
Expand Down Expand Up @@ -215,7 +216,7 @@ omit= [
]

[tool.ruff]
target-version = "py312"
target-version = "py313"

lint.select = [
"B002", # Python does not support the unary prefix increment
Expand Down
2 changes: 1 addition & 1 deletion scripts/python-venv.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -eu

pyversions=(3.12)
pyversions=(3.13 3.12)
my_path=$(git rev-parse --show-toplevel)
my_venv=${my_path}/venv

Expand Down
Loading