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

Latest release breaks hypothesis tests in CPython main branch #1326

Closed
skirpichev opened this issue Aug 5, 2024 · 5 comments · Fixed by #1329
Closed

Latest release breaks hypothesis tests in CPython main branch #1326

skirpichev opened this issue Aug 5, 2024 · 5 comments · Fixed by #1329
Labels

Comments

@skirpichev
Copy link

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

@hynek
Copy link
Member

hynek commented Aug 5, 2024

I’m afk, can I have a
Short, Self Contained, Correct, Example please?

@skirpichev
Copy link
Author

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.

@hynek
Copy link
Member

hynek commented Aug 5, 2024

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?

@skirpichev
Copy link
Author

HypothesisWorks/hypothesis#4067

@hynek
Copy link
Member

hynek commented Aug 6, 2024

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.

hynek added a commit that referenced this issue Aug 6, 2024
Essentially switch to PEP 649 / 749 for annotations. Some tests need to
be skipped for now, but the rest is working.

Fixes #1326
hynek added a commit that referenced this issue Aug 6, 2024
* Restore basic functionality on 3.14[sic]

Essentially switch to PEP 649 / 749 for annotations. Some tests need to
be skipped for now, but the rest is working.

Fixes #1326

* Add news fragment

* We have not 3.14 CI yet

* Use imprerative xfails instead of skips
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants