-
-
Notifications
You must be signed in to change notification settings - Fork 735
Add support for Python 3.8 #3249
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
Conversation
Seems like a slight issue with stacktrace:
I think we can remove that from the 3.8 build. |
Thanks for reviewing @TomAugspurger. Yeah, |
Failure on 3.8 in
I don't recall seeing that before. |
Restarted the 3.8 build to check, though I think we'll want to avoid adding new flaky tests :) |
CI passed. Restarting again |
I noticed the AppVeyor/Windows tests only include Python 3.6, so this doesn't address the Tornado situation with Python 3.8 on Windows, right? Context: tornadoweb/tornado#2608 I'm testing Distributed with Python 3.8 on Windows (most packages from conda-forge) and it seems to be working fine for my usage (1 thread per worker) after adjusting the event loop policy. To do that, I added...
...right after: distributed/distributed/utils.py Lines 1194 to 1198 in b6fb541
(not sure if it's the best place for that or even if it's generic enough) |
There was a Python 3.8-related fix to tornado in version 6.0.3 (tornadoweb/tornado#2683). This causes only one of our tests, However, when using tornado < 6.0.3 on Python 3.8 there are many
Are there any objections to bumping our minimum tornado version to 6.0.3 (for reference, this version was released on Jun 22, 2019)? Not sure if this is too aggressive a bump for most users cc @mrocklin |
@jrbourbeau I think there are way to do version-specific requirements: https://setuptools.readthedocs.io/en/latest/setuptools.html#declaring-platform-specific-dependencies It'll complicate our setup.py / conda recipe a bit, but is probably worth it for tornado, maybe? |
I've run into some systems that still don't react well to Tornado 6. For example I think that our dask-examples binder deployment might not work due to some Jupyter/Tornado issues. I could be wrong though. |
This might also be good motivation to replace |
In general I find that |
Yeah, that would help us avoid the tornado issue. I opened up #3372 to see how the test suite handles the
Agreed |
In Python 3.8, Luckily, almost all the occurrences of |
That seems sensible to me. Thank you for diving into this @jrbourbeau |
Np, it's a subtle change that's good to know about A few other notes:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we're quite close. I think just a bit of debug code, and one question on the windows event loop stuff.
if WINDOWS and sys.version_info >= (3, 8): | ||
# WindowsProactorEventLoopPolicy is not compatible with tornado 6 | ||
# fallback to the pre-3.8 default of Selector | ||
# https://github.com/tornadoweb/tornado/issues/2608 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I understand, tornado decided not to do this for users by default. Did Jupyter decided whether or not to do it?
Is appropriate for Dask to me making this decision?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tornado decided not to set the event loop policy to asyncio.WindowsSelectorEventLoopPolicy()
by default and instead recommends projects do that themselves. Jupyter and several other projects have done this (e.g. jupyter/notebook#5047).
Our situation is a little different because we want to set the event loop policy to tornado's AnyThreadEventLoopPolicy
to let us create loops inside of any thread. Tornado has decided to set the base class for AnyThreadEventLoopPolicy
to asyncio.WindowsSelectorEventLoopPolicy
on Windows (tornadoweb/tornado@d2af6a6), but there hasn't been a release with the those changes yet so we're doing that ourselves here. I'll add a note that we can remove this once the next tornado release is out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jrbourbeau. I think we're good to merge this whenever (once the CI is passing 😄).
CI is passing 🎉 For reference, there was a patch made to the conda-forge tornado feedstock that fixed the tornado event loop policy issue with Python 3.8 on Windows. Unfortunately the patch also broke things for us (hence the most recent CI failure). Fortunately, other packages have fixed things internally and the patch to the conda-forge recipe was recently removed (xref conda-forge/tornado-feedstock#36). It's worth noting that the same conda recipe patch was also made to tornado in the default channel and is still in place, so that's why we're installing |
Woo!
…On Thu, Feb 13, 2020 at 2:10 PM James Bourbeau ***@***.***> wrote:
Merged #3249 <#3249> into master.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3249?email_source=notifications&email_token=AACKZTH2MYZUZKMPC5JJMDTRCXANXA5CNFSM4JPF3UK2YY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOWUAJ2EY#event-3036716307>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACKZTDEHWS4SRCAZESDXCDRCXANXANCNFSM4JPF3UKQ>
.
|
See the corresponding
dask/dask
PR at dask/dask#5603