Skip to content

Bump python to 3.13 following core 2024.12 - #656

Merged
bouwew merged 5 commits into
mainfrom
py313
Nov 29, 2024
Merged

Bump python to 3.13 following core 2024.12#656
bouwew merged 5 commits into
mainfrom
py313

Conversation

@CoMPaTech

@CoMPaTechCoMPaTech commented Nov 28, 2024

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features

    • Added support for Python 3.13 across various workflows and configurations.
  • Bug Fixes

    • Updated pre-commit hooks to ensure compatibility with Python 3.13.
  • Documentation

    • Changelog updated to reflect the new version (v1.6.1) and support for Python 3.13.
  • Chores

    • Incremented project version in pyproject.toml and updated Python requirements.
    • Modified scripts to support multiple Python versions (3.12 and 3.13).

@CoMPaTechCoMPaTech added dependencies Pull requests that update a dependency file python Pull requests that update Python code labels Nov 28, 2024
@CoMPaTechCoMPaTech self-assigned this Nov 28, 2024
@CoMPaTech
CoMPaTech requested a review from a team as a code ownerNovember 28, 2024 19:43
@coderabbitai

coderabbitaiBot commented Nov 28, 2024

Copy link
Copy Markdown
Contributor

Walkthrough

The changes in this pull request primarily involve updates to various configuration files to support Python version 3.13. Key modifications include updating the DEFAULT_PYTHON environment variable in GitHub Actions workflows, adjusting the pre-commit configuration to specify Python 3.13, and incrementing the project version in pyproject.toml. Additionally, the changelog has been updated to reflect these changes. The overall structure of the workflows and scripts remains unchanged, focusing on compatibility with the latest Python version.

Changes

File PathChange Summary
.github/workflows/merge.ymlUpdated DEFAULT_PYTHON from "3.12" to "3.13".
.github/workflows/verify.ymlUpdated DEFAULT_PYTHON from "3.12" to "3.13"; updated matrix variable python-version in jobs.
.pre-commit-config.yamlUpdated default_language_version from "python3.12" to "python3.13"; adjusted hook configurations.
CHANGELOG.mdAdded new version entry for v1.6.1 with support for Python 3.13.
pyproject.tomlIncremented version from 1.6.0 to 1.6.1; updated requires-python to >=3.12.0; added classifier for Python 3.13.
scripts/python-venv.shUpdated pyversions array to include both 3.13 and 3.12.

Sequence Diagram(s)

sequenceDiagram
participant User
participant GitHub Actions
participant Python Environment
User->>GitHub Actions: Trigger workflow
GitHub Actions->>Python Environment: Set up Python 3.13
Python Environment-->>GitHub Actions: Python 3.13 ready
GitHub Actions->>GitHub Actions: Install dependencies
GitHub Actions->>GitHub Actions: Run tests
GitHub Actions-->>User: Workflow complete
Loading

🐰 "In the meadow, the code does play,
With Python 3.13, hip-hip-hooray!
From merge to verify, all in a row,
Our scripts now dance, with a vibrant glow!
Let's hop and cheer, for changes so bright,
A leap for the future, all feels just right!" 🐇

Warning

Rate limit exceeded

@CoMPaTech has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 8 minutes and 19 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 8bf474a and 4747901.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 8bf474a and 4747901.

📒 Files selected for processing (1)
  • .github/workflows/verify.yml (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/verify.yml

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitaicoderabbitaiBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Outside diff range and nitpick comments (2)
scripts/python-venv.sh (1)

Line range hint 4-24: Consider updating documentation about Python version requirements.

Since we're adding support for Python 3.13, it would be helpful to document this change in the project's documentation.

Let's verify if we need to update any documentation:

#!/bin/bash# Description: Check for Python version references in documentation# Look for README files and documentation directoriesecho"Checking documentation for Python version references..."
rg -l "python.*3\.(12|13)"$(fd -t f -e md -e rst)
.pre-commit-config.yaml (1)

Line range hint 1-5: Consider temporary CI adjustments for Python 3.13 transition

During the Python 3.13 transition period, consider:

  1. Temporarily increasing the autoupdate frequency from quarterly
  2. Running all hooks in CI at least once to verify Python 3.13 compatibility
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between e4c2b9c and 76b927d.

📒 Files selected for processing (6)
  • .github/workflows/merge.yml (1 hunks)
  • .github/workflows/verify.yml (3 hunks)
  • .pre-commit-config.yaml (1 hunks)
  • CHANGELOG.md (1 hunks)
  • pyproject.toml (6 hunks)
  • scripts/python-venv.sh (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • CHANGELOG.md
🔇 Additional comments (10)
scripts/python-venv.sh (1)

4-4: LGTM! Verify Python 3.13 compatibility with dependencies.

The addition of Python 3.13 as the primary version while keeping 3.12 as fallback is a good approach. However, since Python 3.13 is relatively new, we should verify compatibility.

Let's check the project's dependencies for Python 3.13 compatibility:

✅ Verification successful

Python 3.13 upgrade is compatible with project configuration

The project's configuration already supports Python 3.13:

  • pyproject.toml specifies requires-python = ">=3.12.0", which includes Python 3.13
  • Core dependencies (aiohttp, defusedxml, munch, python-dateutil) are mature packages that typically maintain compatibility with new Python versions
  • Development dependencies are either version-agnostic or have specific versions that are compatible
  • The project follows HA-core versioning for most dependencies, which ensures ecosystem compatibility
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash# Description: Check if project dependencies support Python 3.13# Look for pyproject.toml or requirements.txt to analyze dependencies# First, check if we have pyproject.tomlif [ -f"pyproject.toml" ];thenecho"Checking dependencies in pyproject.toml..."
cat pyproject.toml | grep -A 20 "dependencies"fi# Then check for requirements.txtif [ -f"requirements.txt" ];thenecho"Checking dependencies in requirements.txt..."
cat requirements.txt
fi

Length of output: 636


Script:

#!/bin/bash# Let's check the specific versions of dependencies to verify Python 3.13 compatibility# First, let's check if there's any Python version constraints in pyproject.tomlecho"Checking Python version constraints in pyproject.toml..."
rg "python_version|python_requires|requires-python" pyproject.toml -A 2
# Then, let's check for any setup.py that might have version constraintsecho -e "\nChecking for Python version constraints in setup.py..."if [ -f"setup.py" ];then
rg "python_requires|requires-python" setup.py -A 2
fi# Let's also check the specific versions of direct dependenciesecho -e "\nChecking specific versions in requirements files..."
fd "requirements.*\.txt$" -x cat {}

Length of output: 1013

.github/workflows/merge.yml (4)

8-8: Verify PR title - version number mismatch

The PR title mentions Python 3.123, but the change implements Python 3.13. This appears to be a typo in the PR title.

Consider updating the PR title to correctly reflect Python 3.13.


8-8: LGTM - Python version update

The update to Python 3.13 looks good, pending the verification checks above. The workflow structure remains unchanged and appropriate for the publishing process.


8-8: Verify Python 3.13 compatibility with GitHub Actions

Let's verify the compatibility of Python 3.13 with GitHub Actions and the setup-python action.

✅ Verification successful

Let me gather more specific information about Python 3.13 support.


Python 3.13 is compatible and properly configured

The codebase is already well-configured for Python 3.13:

  • The project's pyproject.toml explicitly supports Python 3.13 in its classifiers
  • Black and Ruff tools are configured for Python 3.13 target
  • Mypy is configured for Python 3.13
  • The workflow uses actions/setup-python@v5 which is the latest version supporting Python 3.13
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash# Description: Check setup-python action versions and their Python support# Get the latest release info for setup-python actionecho"Checking setup-python action releases..."
gh api repos/actions/setup-python/releases/latest
# Check workflow runs in the repository using Python 3.13echo"Checking existing workflow runs with Python 3.13..."
gh run list --workflow=merge.yml --json conclusion,name,headBranch,status | jq '.[] | select(.name=="Latest release")'

Length of output: 6055


Script:

#!/bin/bash# Check the Python version specification in the workflow fileecho"Checking Python setup in workflow file..."
cat .github/workflows/merge.yml
# Check if there are any Python version constraints in requirements or setup filesecho -e "\nChecking Python version constraints in project files..."
fd -e txt -e toml -e cfg -e ini -e yaml -e yml | xargs grep -l "python"2>/dev/null | xargs cat 2>/dev/null

Length of output: 13170


Line range hint 27-31: Verify dependencies compatibility with Python 3.13

The workflow uses setup-python@v5. Let's ensure all dependencies and actions are compatible with Python 3.13.

✅ Verification successful

Python 3.13 compatibility is properly configured

The project is fully configured for Python 3.13 compatibility:

  • pyproject.toml explicitly lists Python 3.13 support in classifiers
  • Project requires Python >=3.12.0 which includes 3.13
  • All tools (black, mypy, ruff) are configured for Python 3.13
  • No version-specific dependencies that would conflict with Python 3.13
  • Workflow files correctly use Python 3.13 as DEFAULT_PYTHON
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash# Description: Check for Python version constraints in project dependencies# Check pyproject.toml for Python version constraintsecho"Checking Python version constraints in pyproject.toml..."if [ -f"pyproject.toml" ];then
cat pyproject.toml | grep -A 5 "python_requires"fi# Check requirements files for any version-specific dependenciesecho"Checking requirements files for version constraints..."
fd -e txt -e in requirements | xargs cat 2>/dev/null | grep -i "python_version"

Length of output: 386


Script:

#!/bin/bash# Let's check for any Python-related files and dependencies more thoroughly# Check for setup.py, setup.cfg, or pyproject.tomlecho"=== Python Project Configuration Files ==="
fd "setup\.py|setup\.cfg|pyproject\.toml"# Look for requirements filesecho -e "\n=== Requirements Files ==="
fd "requirements"# Check content of setup.py if it existsecho -e "\n=== Setup.py Content (if exists) ==="if [ -f"setup.py" ];then
cat setup.py
fi# Check for tox.ini which might have Python version specsecho -e "\n=== Tox Configuration (if exists) ==="if [ -f"tox.ini" ];then
cat tox.ini
fi# Check GitHub workflow files for Python version referencesecho -e "\n=== GitHub Workflow Python Version References ==="
rg "python-version" .github/workflows/

Length of output: 4265


Script:

#!/bin/bash# Let's check the content of configuration files and requirements for version constraints# Check pyproject.toml contentecho"=== pyproject.toml Content ==="
cat pyproject.toml
# Check setup.cfg contentecho -e "\n=== setup.cfg Content ==="
cat setup.cfg
# Check requirements files contentecho -e "\n=== requirements_test.txt Content ==="
cat requirements_test.txt
echo -e "\n=== requirements_commit.txt Content ==="
cat requirements_commit.txt
# Check for Python version environment variableecho -e "\n=== DEFAULT_PYTHON Environment Variable in Workflows ==="
rg "DEFAULT_PYTHON" .github/workflows/

Length of output: 14914

.pre-commit-config.yaml (1)

Line range hint 13-83: Verify hook configurations for Python 3.13 compatibility

Several hooks might benefit from updates to fully support Python 3.13:

  1. pyupgrade and python-typing-update use --py39-plus flags
  2. Consider updating hook versions to their latest releases for better Python 3.13 support

Let's check for newer versions of these hooks:

pyproject.toml (3)

51-51: Verify tool compatibility with Python 3.13

The black and ruff configurations are set to target Python 3.13. Let's ensure these tools support this version.

Run this script to check the latest supported Python versions in the tools' dependencies:

Also applies to: 219-219

✅ Verification successful

Python 3.13 is supported by both black and ruff

Based on the PyPI classifiers, both black and ruff explicitly declare support for Python 3.13 in their latest versions. The target-version configuration in pyproject.toml is valid and compatible.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash# Description: Check tool compatibility with Python 3.13# Get the latest versions and their Python supportecho"Checking black..."
curl -s https://pypi.org/pypi/black/json | jq -r '.info.classifiers[] | select(contains("Programming Language :: Python"))'echo"Checking ruff..."
curl -s https://pypi.org/pypi/ruff/json | jq -r '.info.classifiers[] | select(contains("Programming Language :: Python"))'

Length of output: 952


Line range hint 189-209: Verify MyPy compatibility and type checking settings

The MyPy configuration is set to Python 3.13 with strict type checking enabled. Let's verify:

  1. MyPy's support for Python 3.13
  2. Any potential type checking changes needed for Python 3.13 compatibility

Run this script to check MyPy's Python version support:

✅ Verification successful

MyPy configuration is compatible with Python 3.13

The verification confirms that MyPy officially supports Python 3.13 as shown in its PyPI classifiers. The strict type checking settings are standard MyPy configurations that are version-agnostic, and the codebase shows minimal typing usage with no Python 3.13-specific type hints that could cause compatibility issues.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash# Description: Check MyPy compatibility with Python 3.13echo"Checking MyPy Python version support..."
curl -s https://pypi.org/pypi/mypy/json | jq -r '.info.classifiers[] | select(contains("Programming Language :: Python"))'# Look for any Python 3.13-specific type hints in the codebaseecho"Checking for Python 3.13-specific type hints..."
rg "typing\.".

Length of output: 692


7-7: ⚠️ Potential issue

Version constraints need revision

There are several inconsistencies in the version-related changes:

  1. The PR title mentions Python 3.123, but the changes show 3.13. Please clarify the intended Python version.
  2. The requires-python = ">=3.12.0" constraint should be updated to reflect the minimum Python version requirement for this release.
  3. Consider if a minor version bump (1.6.0 -> 1.6.1) is sufficient for a major Python version update.

Let's verify the Python version requirements across the project:

Also applies to: 18-18, 28-28

✅ Verification successful

Version constraints are correctly aligned with project changes

Based on the search results, the version-related changes in pyproject.toml are consistent with the project's direction:

  1. The CHANGELOG.md clearly shows this is a Python 3.13 update, not 3.123 (the PR title appears to have a typo).
  2. The requires-python = ">=3.12.0" constraint is correct as it maintains compatibility with both Python 3.12 and 3.13, which is confirmed by:
    • CHANGELOG entries showing support for both versions
    • The python-venv.sh script showing both versions (3.12, 3.13) are supported
  3. The minor version bump (1.6.1) is appropriate as Python version support is being added without breaking changes.
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash# Description: Check Python version requirements across the project# Look for Python version references in workflow files and other configs
rg -g "!pyproject.toml""3\.1[23]".

Length of output: 8356

.github/workflows/verify.yml (1)

8-8: Verify Python 3.13 support in GitHub Actions

The workflow is being updated to use Python 3.13. Please ensure that:

  1. Python 3.13 is officially supported by GitHub Actions' setup-python action
  2. All dependencies are compatible with Python 3.13
✅ Verification successful

Python 3.13 update is safe to proceed

Based on the comprehensive analysis of the codebase:

  1. The project explicitly declares Python 3.13 support in pyproject.toml's classifiers and requires-python fields
  2. GitHub Actions setup-python@v5 action is used, which supports Python 3.13
  3. All workflow files consistently use Python 3.13
  4. The project has proper test coverage (>94%) and type checking with mypy configured for Python 3.13
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash# Description: Check for potential compatibility issues with Python 3.13# Check setup.py and requirements files for version constraints
rg -l "python_requires|requires-python|Python ::|Framework ::"# Look for version-specific code
rg "sys.version|python_version"

Length of output: 152


Script:

#!/bin/bash# Check the content of pyproject.toml to understand version requirements
cat pyproject.toml
# Check GitHub Actions workflow files for any other Python version references
rg -l "python-version|python_version" .github/workflows/

Length of output: 10845


Script:

#!/bin/bash# Check the content of workflow files to see Python version configurations
cat .github/workflows/verify.yml
cat .github/workflows/merge.yml
# Check if there are any other workflow files with Python setup
fd -e yml -e yaml . .github/workflows/

Length of output: 17267

Comment thread.pre-commit-config.yaml
Comment thread.github/workflows/verify.yml Outdated
env:
CACHE_VERSION: 11
DEFAULT_PYTHON: "3.12"
DEFAULT_PYTHON: "3.13"

Copy link
Copy Markdown
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

@codecov

codecovBot commented Nov 28, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (e4c2b9c) to head (4747901).
Report is 6 commits behind head on main.

Additional details and impacted files
@@ Coverage Diff @@## main #656 +/- ##
=========================================
Coverage 100.00% 100.00% =========================================
Files 20 20 Lines 3393 3393 =========================================
Hits 3393 3393 

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@coderabbitaicoderabbitaiBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 6668889 and 8bf474a.

📒 Files selected for processing (1)
  • .github/workflows/verify.yml (3 hunks)
🧰 Additional context used
📓 Learnings (1)
.github/workflows/verify.yml (1)
Learnt from: CoMPaTech
PR: plugwise/python-plugwise#656
File: .github/workflows/verify.yml:176-176
Timestamp: 2024-11-28T19:48:51.051Z
Learning: In this project, we align our supported Python versions with HA-core. When HA-core moves to a new Python version (e.g., Python 3.13), we update our testing matrix accordingly and discontinue testing for the previous version.
🪛 yamllint (1.35.1)
.github/workflows/verify.yml

[error] 176-176: syntax error: expected ',' or ']', but got ''

(syntax)

🔇 Additional comments (2)
.github/workflows/verify.yml (2)

8-8: ⚠️ Potential issue

Revert Python version update until HA core supports 3.13

Based on the current Home Assistant core requirements (Python >=3.12.0), this change is premature. We should maintain alignment with HA core's Python version support.

- DEFAULT_PYTHON: "3.13"+ DEFAULT_PYTHON: "3.12"

Line range hint 201-205: Verify HA core constraints compatibility

The workflow installs dependencies with HA core constraints. We should verify that all dependencies are compatible with the Python version in use.

✅ Verification successful

Python version compatibility is properly configured

The workflow is correctly configured for HA core compatibility:

  • Uses Python 3.12 and 3.13 in test matrix, which covers HA core's requirement of Python >=3.12.0
  • Default Python version is set to 3.13, which is forward-compatible with the special dependencies that activate on Python >=3.13
  • The workflow uses uv for dependency management which respects version constraints
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash# Description: Verify compatibility with HA core constraints# Check HA core's Python version requirements
curl -s https://raw.githubusercontent.com/home-assistant/core/dev/pyproject.toml | grep -A 5 "python ="# Check if any dependencies have Python version constraints
curl -s https://raw.githubusercontent.com/home-assistant/core/dev/homeassistant/package_constraints.txt | grep -i "python_version"

Length of output: 634


Script:

#!/bin/bash# Check Python version used in the workflow
grep -A 5 "python-version" .github/workflows/verify.yml
# Check if there's a requirements file that might contain version constraints
fd requirements.txt --exec cat {}

Length of output: 6601


Script:

#!/bin/bash# Check the DEFAULT_PYTHON env variable value
grep "DEFAULT_PYTHON" .github/workflows/verify.yml
# Check setup.py for Python version requirements
fd setup.py --exec cat {}

Length of output: 1772

Comment thread.github/workflows/verify.yml Outdated
strategy:
matrix:
python-version: ["3.12"]
python-version: ["3.13" "3.12"]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix syntax error in Python version matrix

There's a syntax error in the matrix definition - missing comma between versions.

- python-version: ["3.13" "3.12"]+ python-version: ["3.12"]

Note: As per the previous discussion about aligning with HA core, we should maintain only Python 3.12 testing for now.

Also applies to: 216-216

🧰 Tools
🪛 yamllint (1.35.1)

[error] 176-176: syntax error: expected ',' or ']', but got ''

(syntax)

@sonarqubecloud

Copy link
Copy Markdown

@CoMPaTechCoMPaTech changed the title Bump python to 3.123 following core 2024.12Bump python to 3.13 following core 2024.12Nov 28, 2024
Comment threadCHANGELOG.md
@@ -1,5 +1,9 @@
# Changelog

## v1.6.1

Copy link
Copy Markdown
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
Copy Markdown
MemberAuthor

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
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ah OK :)

@bouwewbouwew left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@bouwew
bouwew merged commit 8967e51 into mainNov 29, 2024
@bouwew
bouwew deleted the py313 branch November 29, 2024 15:58
@coderabbitaicoderabbitaiBot mentioned this pull request Oct 7, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependenciesPull requests that update a dependency filepythonPull requests that update Python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@CoMPaTech@bouwew