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

Add support for Python 3.13 #129442

Open
wants to merge 9 commits into
base: dev
Choose a base branch
from
Open

Add support for Python 3.13 #129442

wants to merge 9 commits into from

Conversation

cdce8p
Copy link
Member

@cdce8p cdce8p commented Oct 29, 2024

Breaking change

The following integrations won't work with Python 3.13 and might be removed in the future.

  • Comelit
  • Wetherflow

The profiler.memory service is not available when using Python 3.13. It will return if and when guppy3 becomes Python 3.13 compatible.

Environment Canada, EZVIZ, Kraken, and NOAA Tides are also not yet available. Support will be added once a new pandas version is released.

Proposed change

Add initial support for Python 3.13.
The following integrations don't work yet.

PEP 594 removed a lot of "dead" batteries from the stdlib. Unfortunately, those are not quite dead yet and a lot of integrations and dependencies still use them. Fortunately there are backport libraries available which we can use instead. At some point, we might want to remove them as well, but they certainly make the transition easier.

Additional dependencies

--
For reference the Python 3.12 update:

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.

To help with the load of incoming pull requests:

@cdce8p cdce8p added breaking-change noteworthy Marks a PR as noteworthy and should be in the release notes (in case it normally would not appear) and removed core labels Oct 29, 2024
@cdce8p cdce8p marked this pull request as ready for review October 30, 2024 17:14
@cdce8p
Copy link
Member Author

cdce8p commented Oct 30, 2024

The PR is ready now! Wheels will follow once the base image and wheel builder have been updated.

Copy link
Member

@bdraco bdraco left a comment

Choose a reason for hiding this comment

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

LGTM, should we wait until after we ship 2024.11.0?

@edenhaus
Copy link
Contributor

LGTM, should we wait until after we ship 2024.11.0?

In my opinion, we should wait, as this PR could create potential merge conflicts with the RC

@cdce8p
Copy link
Member Author

cdce8p commented Oct 31, 2024

In my opinion, we should wait, as this PR could create potential merge conflicts with the RC

I don't think this is an issue here. All three of the integrations modified here are quite stable. There is only one PR to add a new platform to comelit which could be impacted but it's still in draft: #125154.

Overall, merge conflicts should be similar to other PRs and easy to resolve.

An alternative of course would be to just cherry-pick this one as that would completely eliminate any potential conflicts. It doesn't need to be mentioned in the release notes quite yet but users would still be able to try out 3.13 early if they want to.

@cdce8p cdce8p force-pushed the add-313 branch 3 times, most recently from 4cf892c to 532814b Compare November 4, 2024 22:57
@cdce8p
Copy link
Member Author

cdce8p commented Nov 4, 2024

tokenizers released a 3.13 compatible version today, so we no longer need to disable Anthropic. Furthermore, mediafile no longer depends on the (removed) imghdr package. So the added dependency on standard-imghdr could also be removed.

Will update the PR again tomorrow, once the (unrelated) CI issue is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change cla-signed Hacktoberfest new-feature noteworthy Marks a PR as noteworthy and should be in the release notes (in case it normally would not appear)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants