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

Build: fix build in mypyc >=1.14 #350

Open
tlambert03 opened this issue Jan 24, 2025 · 0 comments
Open

Build: fix build in mypyc >=1.14 #350

tlambert03 opened this issue Jan 24, 2025 · 0 comments

Comments

@tlambert03
Copy link
Member

Not sure what happened yet... but something changed in mypyc that causes compile failures, and persistent test failures that look like this:

    def test_group_blocked_exclude() -> None:
        """Test that we can exempt certain signals from being blocked."""
        group = MyGroup()

        mock1 = Mock()
        mock2 = Mock()

        group.sig1.connect(mock1)
        group.sig2.connect(mock2)

>       with group.all.blocked(exclude=("sig2",)):

tests/test_group.py:172:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
src/psygnal/_signal.py:1502: in __enter__
    self._signal.block(exclude=self._exclude)
src/psygnal/_group.py:162: in block
    if (exclude and sig in exclude) or name in exclude:
src/psygnal/_signal.py:1130: in __contains__
    return self._slot_index(slot) >= 0
src/psygnal/_signal.py:1094: in _slot_index
    normed = weak_callback(slot, on_ref_error="ignore")
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

>   raise TypeError(f"unsupported type {type(cb)}")  # pragma: no cover
E   TypeError: unsupported type <class 'tuple'>

weird thing is it seems like it's flipping around the arguments to sig in exclude, such that it runs at runtime as if it were exclude in sig?

i'm going to pin it for now, but opening the issue so I don't forget

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant