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

DeprecationWarning: asyncio.iscoroutinefunction #635

Open
frenzymadness opened this issue Jan 15, 2025 · 6 comments · May be fixed by #637
Open

DeprecationWarning: asyncio.iscoroutinefunction #635

frenzymadness opened this issue Jan 15, 2025 · 6 comments · May be fixed by #637

Comments

@frenzymadness
Copy link

This line:

if not asyncio.iscoroutinefunction(origin):

now gives:

DeprecationWarning: 'asyncio.iscoroutinefunction' is deprecated and slated for removal in Python 3.16; use inspect.iscoroutinefunction() instead

in Python 3.14.

@Dreamsorcerer
Copy link
Member

Well, 3.14 is some way off, so we've not looked at it yet. Feel free to make a PR to add a fix (you can probably add 3.14 to the test matrix as well, marking it experimental like: https://github.com/aio-libs/aiohttp/blob/9482755b40ce69814eea6f65bfbd4c12d1878174/.github/workflows/ci-cd.yml#L158-L161).

Looks like it needs updating to drop 3.8 and add 3.13 as well..

@frenzymadness
Copy link
Author

I agree that there is plenty of time. The problem, IIUC, is this:

async-lru/setup.cfg

Lines 75 to 76 in 52acd32

filterwarnings =
error

Because of that setting, DeprecationWarnings are not ignored, which causes the tests to fail.

@Dreamsorcerer
Copy link
Member

Yes, which ensures we update them correctly as soon as we add 3.14 to the tests, thus ensuring warnings are not propagated to users. As above, feel free to help up and start those updates.

frenzymadness added a commit to frenzymadness/async-lru that referenced this issue Jan 17, 2025
The former causes: DeprecationWarning:
'asyncio.iscoroutinefunction' is deprecated and slated for removal
in Python 3.16; use inspect.iscoroutinefunction() instead.

Fixes: aio-libs#635
@frenzymadness frenzymadness linked a pull request Jan 17, 2025 that will close this issue
3 tasks
@frenzymadness
Copy link
Author

I've proposed a fix for the warning but I'm not gonna fix the testing/CI because:

  • tox config seems to be broken for some time already - the deps in requirements.txt does not contain flake but it's used as a command there
  • the dependency on isort is not specified anywhere
  • I don't understand the difference between requirements and requirements-dev - they both contain dev dependencies IMHO
  • flake8 reports failures that are present there for years apparently

I mean, I can help fix those issues but some decisions have to be made on how you'd like the new CI/testing config to look like. I mean, you have tox, pre_commit, and Makefile and I think this can be simplified.

@Dreamsorcerer
Copy link
Member

* tox config seems to be broken for some time already - the deps in requirements.txt does not contain flake but it's used as a command there

I don't think tox has been used since moving to Github Actions. It's all done in the Github runners now.

* I don't understand the difference between requirements and requirements-dev - they both contain dev dependencies IMHO

Yeah, we need to rename them (I'm hoping to work on an org-wide solution in future and make this more consistent across repos). One is for the test job (and needs to work on all Python versions), the other is for the linter job (a superset of dependencies that only needs to work on a specific version of Python).

* flake8 reports failures that are present there for years apparently

I think both isort/flake8 are being run via pre-commit (and the dependencies are specified there). If you get extra errors, that's most likely because you've not used a fresh env and extra plugins installed that we're not using (my biggest annoyance with flake8).

@Dreamsorcerer
Copy link
Member

#638 should do it.

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 a pull request may close this issue.

2 participants