Skip to content

Remove use of asyncio API deprecated in python 3.14 #1862

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 3 commits into from
Jun 12, 2025

Conversation

braingram
Copy link
Contributor

@braingram braingram commented Jun 12, 2025

At this moment this also adds python 3.14-dev testing. EDIT: This was removed

This remove the use of deprecated asyncio policies.

During local testing with python 3.14 another deprecation was found for asyncio.iscoroutinefunction:
https://docs.python.org/3.14/whatsnew/3.14.html#deprecated

This was replaced with inspect.iscoroutinefunction.

Fixes: #1861

@martindurant
Copy link
Member

The test environments are based on conda, which doesn't have 3.14dev available yet. We could do a pip-based minimalist CI run without all the optional extras.

@braingram
Copy link
Contributor Author

The test environments are based on conda, which doesn't have 3.14dev available yet. We could do a pip-based minimalist CI run without all the optional extras.

Thanks! I removed that part (and fixed the linting errors). I wanted to wait to see if the other tests passed.

For 3.14 nightly wheels for numpy: https://pypi.anaconda.org/scientific-python-nightly-wheels/ (and possibly other test dependencies) might be needed.

I was able to install an environment locally with python 3.14, dev numpy and just the "test" dependencies. It revealed one more deprecation warning for a single use of asyncio.iscoroutinefunction (which is replaced by a function of the same name in inspect that is already in use in other parts of fsspec).

@braingram braingram changed the title Remove use of asyncio policies (deprecated in python 3.14) Remove use of asyncio API deprecated in python 3.14 Jun 12, 2025
@braingram braingram marked this pull request as ready for review June 12, 2025 20:01
@braingram
Copy link
Contributor Author

I think this is ready for review. Let me know if there is any more testing to do, documentation/changelog to update, or anything else.

@martindurant
Copy link
Member

I'll update the changelog at release time :)

Adding a 3.14dev CI run would still be a good idea, but it can be done in a different PR or wait for conda (which will only happen some time after official release).

@martindurant martindurant merged commit 01ecda4 into fsspec:master Jun 12, 2025
10 checks passed
@braingram braingram deleted the remove_policy branch June 12, 2025 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

'asyncio.get_event_loop_policy' is deprecated and slated for removal in Python 3.16 when running with python 3.14
2 participants