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

Using trio with attrs 24.1.0 raises a warning #3053

Closed
pquentin opened this issue Aug 3, 2024 · 4 comments · Fixed by #3054 or #3060
Closed

Using trio with attrs 24.1.0 raises a warning #3053

pquentin opened this issue Aug 3, 2024 · 4 comments · Fixed by #3054 or #3060

Comments

@pquentin
Copy link
Member

pquentin commented Aug 3, 2024

This happens to break urllib3's CI which, like trio, fails on warnings.

ImportError while loading conftest '/.../urllib3/test/conftest.py'.
test/conftest.py:15: in <module>
    from dummyserver.app import hypercorn_app
dummyserver/app.py:14: in <module>
    import trio
.nox/test-3-12/lib/python3.12/site-packages/trio/__init__.py:23: in <module>
    from ._core import TASK_STATUS_IGNORED as TASK_STATUS_IGNORED  # isort: split
.nox/test-3-12/lib/python3.12/site-packages/trio/_core/__init__.py:9: in <module>
    from ._entry_queue import TrioToken
.nox/test-3-12/lib/python3.12/site-packages/trio/_core/_entry_queue.py:149: in <module>
    @attrs.define(eq=False, hash=False)
.nox/test-3-12/lib/python3.12/site-packages/attr/_next_gen.py:402: in wrap
    return do_it(cls, True)
.nox/test-3-12/lib/python3.12/site-packages/attr/_next_gen.py:348: in do_it
    return attrs(
.nox/test-3-12/lib/python3.12/site-packages/attr/_make.py:1291: in attrs
    warnings.warn(
E   DeprecationWarning: The `hash` argument is deprecated in favor of `unsafe_hash` and will be removed in or after August 2025.
@A5rocks
Copy link
Contributor

A5rocks commented Aug 5, 2024

@pquentin
Copy link
Member Author

pquentin commented Aug 5, 2024

As mentioned by @hynek in #3054 (comment), there's at least one missing instance of this problem. I'm now seeing this:

ImportError while loading conftest '/Users/runner/work/urllib3/urllib3/test/conftest.py'.
test/conftest.py:14: in <module>
    from dummyserver.app import hypercorn_app
dummyserver/app.py:14: in <module>
    import trio
.nox/test-3-8/lib/python3.8/site-packages/trio/__init__.py:26: in <module>
    from . import abc, from_thread, lowlevel, socket, to_thread
.nox/test-3-8/lib/python3.8/site-packages/trio/from_thread.py:6: in <module>
    from ._threads import (
.nox/test-3-8/lib/python3.8/site-packages/trio/_threads.py:143: in <module>
    class ThreadPlaceholder:
.nox/test-3-8/lib/python3.8/site-packages/attr/_next_gen.py:402: in wrap
    return do_it(cls, True)
.nox/test-3-8/lib/python3.8/site-packages/attr/_next_gen.py:348: in do_it
    return attrs(
.nox/test-3-8/lib/python3.8/site-packages/attr/_make.py:1291: in attrs
    warnings.warn(
E   DeprecationWarning: The `hash` argument is deprecated in favor of `unsafe_hash` and will be removed in or after August 2025.

@A5rocks
Copy link
Contributor

A5rocks commented Aug 5, 2024

I'm surprised our CI passed...

@A5rocks
Copy link
Contributor

A5rocks commented Aug 5, 2024

OK I'm pretty sure this is because when pytest uses a plugin (which we use) it isn't looking for warnings. And then the warning doesn't happen again next time we import.

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