Skip to content

Add support for python3.11#366

Merged
wbarnha merged 65 commits intofaust-streaming:masterfrom
wbarnha:add-py311
Nov 29, 2022
Merged

Add support for python3.11#366
wbarnha merged 65 commits intofaust-streaming:masterfrom
wbarnha:add-py311

Conversation

@wbarnha
Copy link
Member

@wbarnha wbarnha commented Sep 21, 2022

Prepare for upcoming release of Python 3.11 on 10/24

@codecov-commenter
Copy link

codecov-commenter commented Sep 21, 2022

Codecov Report

Base: 93.97% // Head: 93.86% // Decreases project coverage by -0.10% ⚠️

Coverage data is based on head (3447f53) compared to base (7bef2a2).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #366      +/-   ##
==========================================
- Coverage   93.97%   93.86%   -0.11%     
==========================================
  Files         102      102              
  Lines       11085    11085              
  Branches     1302     1516     +214     
==========================================
- Hits        10417    10405      -12     
- Misses        586      596      +10     
- Partials       82       84       +2     
Impacted Files Coverage Δ
faust/streams.py 88.01% <ø> (ø)
faust/transport/consumer.py 92.30% <100.00%> (-1.71%) ⬇️
faust/transport/drivers/aiokafka.py 73.49% <100.00%> (ø)
faust/transport/producer.py 89.16% <100.00%> (ø)
faust/__init__.py 96.07% <0.00%> (-3.93%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@wbarnha wbarnha marked this pull request as ready for review October 24, 2022 17:48
@wbarnha wbarnha marked this pull request as draft October 24, 2022 18:00
@wbarnha
Copy link
Member Author

wbarnha commented Oct 24, 2022

Apparently Python 3.11 has not been released yet, today.

@wbarnha
Copy link
Member Author

wbarnha commented Oct 25, 2022

Run scripts/tests
+ [ -z true ]
+ pytest tests/unit tests/functional tests/integration tests/meticulous/ tests/regression
ImportError while loading conftest '/home/runner/work/faust/faust/tests/conftest.py'.
tests/conftest.py:12: in <module>
    from mode.utils.mocks import AsyncContextManagerMock, AsyncMock, MagicMock, Mock, patch
/opt/hostedtoolcache/Python/3.11.0/x64/lib/python3.11/site-packages/mode/utils/mocks.py:7: in <module>
    from asyncio import coroutine
E   ImportError: cannot import name 'coroutine' from 'asyncio' (/opt/hostedtoolcache/Python/3.11.0/x64/lib/python3.11/asyncio/__init__.py)

Looks like mode-streaming needs an update.

@wbarnha wbarnha self-assigned this Nov 21, 2022
@wbarnha wbarnha added the enhancement New feature or request label Nov 21, 2022
@wbarnha wbarnha marked this pull request as ready for review November 22, 2022 20:19
@wbarnha wbarnha requested a review from patkivikram November 22, 2022 21:47
@wbarnha
Copy link
Member Author

wbarnha commented Nov 23, 2022

The product of immediately testing this PR of Faust with an example:

[2022-11-23 00:50:29,094] [1] [ERROR] [^---Conductor]: Crashed reason=TypeError('An asyncio.Future, a coroutine or an awaitable is required') 
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/mode/services.py", line 843, in _execute_task
    await task
  File "/usr/local/lib/python3.10/dist-packages/faust/transport/conductor.py", line 288, in _subscriber
    await self.app.agents.wait_until_agents_started()
  File "/usr/local/lib/python3.10/dist-packages/faust/agents/manager.py", line 80, in wait_until_agents_started
    await self.wait_for_stopped(self._agents_started)
  File "/usr/local/lib/python3.10/dist-packages/mode/services.py", line 704, in wait_for_stopped
    return (await self.wait(*coros, timeout=timeout)).stopped
  File "/usr/local/lib/python3.10/dist-packages/mode/services.py", line 711, in wait
    return await self._wait_one(coros[0], timeout=timeout)
  File "/usr/local/lib/python3.10/dist-packages/mode/services.py", line 779, in _wait_one
    results = await self.wait_first(coro, timeout=timeout)
  File "/usr/local/lib/python3.10/dist-packages/mode/services.py", line 740, in wait_first
    futures = {
  File "/usr/local/lib/python3.10/dist-packages/mode/services.py", line 741, in <dictcomp>
    coro: asyncio.ensure_future(
  File "/usr/lib/python3.10/asyncio/tasks.py", line 615, in ensure_future
    return _ensure_future(coro_or_future, loop=loop)
  File "/usr/lib/python3.10/asyncio/tasks.py", line 630, in _ensure_future
    raise TypeError('An asyncio.Future, a coroutine or an awaitable '
TypeError: An asyncio.Future, a coroutine or an awaitable is required

Ugh, there's still work left to be done.

@wbarnha
Copy link
Member Author

wbarnha commented Nov 23, 2022

faust-streaming/mode#30 fixed the previous issue! We're good to go!

Edit: I ran this branch and mode-streaming 0.3.1rc1 on my own code and it still seems there's some issues needing to be resolved? I can't tell, everything started working fine on its own after a bit.

@wbarnha
Copy link
Member Author

wbarnha commented Nov 24, 2022

I got it working in Python 3.11 but a heads up:

/usr/local/lib/python3.11/site-packages/requests/__init__.py:109: RequestsDependencyWarning: urllib3 (1.26.13) or chardet (5.1.0dev0)/charset_normalizer (2.1.1) doesn't match a supported version!

@wbarnha wbarnha merged commit cf397bc into faust-streaming:master Nov 29, 2022
@wbarnha wbarnha deleted the add-py311 branch November 29, 2022 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants