python-attrs / attrs

Python Classes Without Boilerplate

Home Page:https://www.attrs.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Latest release breaks hypothesis tests in CPython main branch

skirpichev opened this issue · comments

See python/cpython#122686. Pinning to "attrs<=23.2.0" - a workaround.

Sorry, I didn't deep debugging (yet). If that helps, tracebacks from above job looks like:

[...]
  File "/home/runner/work/cpython/cpython-builddir/hypovenv/lib/python3.14/site-packages/hypothesis/internal/conjecture/data.py", line 2466, in stop_example
    self.tags.update([structural_coverage(l) for l in labels_for_structure])
                      ~~~~~~~~~~~~~~~~~~~^^^
  File "/home/runner/work/cpython/cpython-builddir/hypovenv/lib/python3.14/site-packages/hypothesis/internal/conjecture/data.py", line 170, in structural_coverage
    return STRUCTURAL_COVERAGE_CACHE.setdefault(label, StructuralCoverageTag(label))
                                                       ~~~~~~~~~~~~~~~~~~~~~^^^^^^^
TypeError: StructuralCoverageTag.__init__() takes 1 positional argument but 2 were given

It's this class in Hypothesis:
https://github.com/HypothesisWorks/hypothesis/blob/3c15b34ece30825ed153a0b350f5847efb30dd79/hypothesis-python/src/hypothesis/internal/conjecture/data.py#L157-L160

Maybe hypothesis package should add pinning, but it's not clear for me from release notes that was broken here.

From looking on my phone it looks like the breakage is that we now use the official dataclass transform decorator and they’re applying is a second time. I think that’s something they have to fix, this is just the price of the typing bleeding edge. Has someone opened a ticket over there?

So it looks like attrs can't find annotation-only fields Python 3.14 only anymore.

It's caused by 689a0e6 and my wild guess is that it's related to PEP 649 / PEP 749.