-
-
Notifications
You must be signed in to change notification settings - Fork 37.6k
Add python 3.11 to the CI #88038
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
Merged
Merged
Add python 3.11 to the CI #88038
Changes from all commits
Commits
Show all changes
57 commits
Select commit
Hold shift + click to select a range
5ea6684
Remove profiler.memory service
bdraco 7c34b60
squash
bdraco fda1dd5
Merge branch 'dev' into python3.11
bdraco 2be2d46
temp remove
bdraco 07a5cea
Merge remote-tracking branch 'upstream/python3.11' into python3.11
bdraco f0207a0
temp dump tests
bdraco db33aa1
temp dump tests
bdraco 073fcdb
drop a few more to get a run
bdraco e97afea
drop a few more to get a run
bdraco 8d32bb6
Account for changed python3.11 enum.IntFlag behavior in zha
bdraco 945d95f
Merge branch 'zha_fix_py3.11' into python3.11
bdraco 57e5c21
merge
bdraco 18d9e4a
restore
bdraco 4b84ec2
restore
bdraco 835fc17
legacy value
bdraco bc99908
Merge branch 'zha_fix_py3.11' into python3.11
bdraco e4b9e7a
Merge remote-tracking branch 'upstream/dev' into python3.11
bdraco 31f4394
tweak a bit for the python 3.11 timings
bdraco 9fc251a
block cchardet
bdraco 789b0b4
conditional
bdraco c923fe1
adjust est
bdraco 84ca277
adjust est
bdraco 9b6fdc8
test
bdraco 8d7cc8e
Merge branch 'profiler' into python3.11
bdraco f4d4f10
not yet
bdraco b57b4b0
tweak
bdraco 80296e9
Merge branch 'zha_fix_py3.11' into python3.11
bdraco cd9d6fc
give a little leeway for timing
bdraco c7d260b
Fix otbr tests
emontnemery 6ae2d91
Merge remote-tracking branch 'upstream/otbr_fix_tests' into python3.11
bdraco 8ad961e
Increase database test timeout
bdraco 79fd224
Merge branch 'db_timeout' into python3.11
bdraco e311fda
Increase database test timeout
bdraco 573454a
Merge branch 'db_timeout' into python3.11
bdraco 9a9af40
Fix aprs tests with python 3.11
bdraco 4562301
merge fix
bdraco 735aa48
hints
bdraco bc6fce1
Merge branch 'aprs_py311' into python3.11
bdraco e39a79d
Merge branch 'dev' into python3.11
bdraco f37d332
Merge branch 'dev' into python3.11
bdraco c47cd7e
Update homeassistant/package_constraints.txt
bdraco 00da4b7
Update script/gen_requirements_all.py
bdraco eeac603
Merge branch 'dev' into python3.11
bdraco 838db8f
Constrain uamqp for Python 3.10 only
frenck 0f119e6
Merge remote-tracking branch 'upstream/dev' into python3.11
bdraco 42b42c2
Merge remote-tracking branch 'upstream/frenck-2023-0312' into python3.11
bdraco a162aac
Merge remote-tracking branch 'upstream/python3.11' into python3.11
bdraco f7629fc
Merge branch 'dev' into python3.11
bdraco 15ecc72
Bump vulcan-api to 2.3.0
bdraco 8de5fb5
Merge branch 'vulcan_api' into python3.11
bdraco ee0c0c2
Merge remote-tracking branch 'upstream/python3.11' into python3.11
bdraco d56311c
add ban
bdraco 2369260
Bump python-matter-server to 2.1.1
marcelveldt 781e484
revert
bdraco 66d747e
Merge remote-tracking branch 'upstream/bump-matter-server-2.1.1' into…
bdraco a9ea3ac
Update tests/asyncio_legacy.py
bdraco c4e6088
Merge branch 'dev' into python3.11
bdraco File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,128 @@ | ||
| """Minimal legacy asyncio.coroutine.""" | ||
|
|
||
| # flake8: noqa | ||
| # stubbing out for integrations that have | ||
| # not yet been updated for python 3.11 | ||
| # but can still run on python 3.10 | ||
| # | ||
| # Remove this once rflink, fido, and blackbird | ||
| # have had their libraries updated to remove | ||
| # asyncio.coroutine | ||
| from asyncio import base_futures, constants, format_helpers | ||
| from asyncio.coroutines import _is_coroutine | ||
| import collections.abc | ||
| import functools | ||
| import inspect | ||
| import logging | ||
| import traceback | ||
| import types | ||
| import warnings | ||
|
|
||
| logger = logging.getLogger(__name__) | ||
|
|
||
|
|
||
| class CoroWrapper: | ||
| # Wrapper for coroutine object in _DEBUG mode. | ||
|
|
||
| def __init__(self, gen, func=None): | ||
| assert inspect.isgenerator(gen) or inspect.iscoroutine(gen), gen | ||
| self.gen = gen | ||
| self.func = func # Used to unwrap @coroutine decorator | ||
| self._source_traceback = format_helpers.extract_stack(sys._getframe(1)) | ||
| self.__name__ = getattr(gen, "__name__", None) | ||
| self.__qualname__ = getattr(gen, "__qualname__", None) | ||
|
|
||
| def __iter__(self): | ||
| return self | ||
|
|
||
| def __next__(self): | ||
| return self.gen.send(None) | ||
|
|
||
| def send(self, value): | ||
| return self.gen.send(value) | ||
|
|
||
| def throw(self, type, value=None, traceback=None): | ||
| return self.gen.throw(type, value, traceback) | ||
|
|
||
| def close(self): | ||
| return self.gen.close() | ||
|
|
||
| @property | ||
| def gi_frame(self): | ||
| return self.gen.gi_frame | ||
|
|
||
| @property | ||
| def gi_running(self): | ||
| return self.gen.gi_running | ||
|
|
||
| @property | ||
| def gi_code(self): | ||
| return self.gen.gi_code | ||
|
|
||
| def __await__(self): | ||
| return self | ||
|
|
||
| @property | ||
| def gi_yieldfrom(self): | ||
| return self.gen.gi_yieldfrom | ||
|
|
||
| def __del__(self): | ||
| # Be careful accessing self.gen.frame -- self.gen might not exist. | ||
| gen = getattr(self, "gen", None) | ||
| frame = getattr(gen, "gi_frame", None) | ||
| if frame is not None and frame.f_lasti == -1: | ||
| msg = f"{self!r} was never yielded from" | ||
| tb = getattr(self, "_source_traceback", ()) | ||
| if tb: | ||
| tb = "".join(traceback.format_list(tb)) | ||
| msg += ( | ||
| f"\nCoroutine object created at " | ||
| f"(most recent call last, truncated to " | ||
| f"{constants.DEBUG_STACK_DEPTH} last lines):\n" | ||
| ) | ||
| msg += tb.rstrip() | ||
| logger.error(msg) | ||
|
|
||
|
|
||
| def legacy_coroutine(func): | ||
| """Decorator to mark coroutines. | ||
| If the coroutine is not yielded from before it is destroyed, | ||
| an error message is logged. | ||
| """ | ||
| warnings.warn( | ||
| '"@coroutine" decorator is deprecated since Python 3.8, use "async def" instead', | ||
| DeprecationWarning, | ||
| stacklevel=2, | ||
| ) | ||
| if inspect.iscoroutinefunction(func): | ||
| # In Python 3.5 that's all we need to do for coroutines | ||
| # defined with "async def". | ||
| return func | ||
|
|
||
| if inspect.isgeneratorfunction(func): | ||
| coro = func | ||
| else: | ||
|
|
||
| @functools.wraps(func) | ||
| def coro(*args, **kw): | ||
| res = func(*args, **kw) | ||
| if ( | ||
| base_futures.isfuture(res) | ||
| or inspect.isgenerator(res) | ||
| or isinstance(res, CoroWrapper) | ||
| ): | ||
| res = yield from res | ||
| else: | ||
| # If 'res' is an awaitable, run it. | ||
| try: | ||
| await_meth = res.__await__ | ||
| except AttributeError: | ||
| pass | ||
| else: | ||
| if isinstance(res, collections.abc.Awaitable): | ||
| res = yield from await_meth() | ||
| return res | ||
|
|
||
| wrapper = types.coroutine(coro) | ||
| wrapper._is_coroutine = _is_coroutine # For iscoroutinefunction(). | ||
| return wrapper | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.