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

Daily tests failed on Fri Jan 26 2024 #11318

Closed
github-actions bot opened this issue Jan 26, 2024 · 7 comments · Fixed by python/mypy#16823 or #11316
Closed

Daily tests failed on Fri Jan 26 2024 #11318

github-actions bot opened this issue Jan 26, 2024 · 7 comments · Fixed by python/mypy#16823 or #11316
Labels
help wanted An actionable problem of low to medium complexity where a PR would be very welcome

Comments

@github-actions
Copy link
Contributor

Runs listed here: https://github.com/python/typeshed/actions/workflows/daily.yml

@github-actions github-actions bot added the help wanted An actionable problem of low to medium complexity where a PR would be very welcome label Jan 26, 2024
@AlexWaygood
Copy link
Member

Slugify added type hints, with amusing results for stubtest:

error: slugify.annotations is not present in stub
Stub: in file /home/runner/work/typeshed/typeshed/stubs/python-slugify/slugify/__init__.pyi
MISSING
Runtime:
_Feature((3, 7, 0, 'beta', 1), (3, 11, 0, 'alpha', 0), 16777216)

Found 1 error (checked 5 modules)

I'm guessing #11316 should fix things

@JelleZijlstra
Copy link
Member

Arguably a stubtest bug too.

@hauntsaninja
Copy link
Collaborator

Lol

@hauntsaninja
Copy link
Collaborator

hauntsaninja commented Jan 26, 2024

@AlexWaygood any suggestions for how to fix stubtest issue?

It's related to the interesting https://github.com/python/mypy/pull/14270/files#diff-55639a1f38efeacbb10988649399037c13ad11e9c82890b453d98ea2bed9caf8R350
The symtable approach fails here because we get annotations from some of the import *. I'm inclined to always listen to __module__ if it's present, but that fails for the re.compile test you added...

@hauntsaninja
Copy link
Collaborator

Okay, I found a thing: python/mypy#16823

@AlexWaygood
Copy link
Member

Yeah it's a tricky one — hard to get a heuristic that covers everything here. My inclination is to say that __module__ is pretty unreliable in a fair few cases actually, and that it's more common for an important re.Pattern to be defined in a module than it is for a __future__.annotations to be accidentally imported via an import *. (This is especially true since generally only packages with type annotations import __future__.annotations, and packages with type annotations generally aren't stubtested for long before being removed from typeshed.)

I would personally either:

  1. Accept that this is a somewhat-rare false positive stubtest is going to have, that will need to be allowlisted; or
  2. Add some special-casing specifically for instances of __future__._Feature, since we can after all basically always guarantee that instances of those objects specifically are never really public API that are being deliberately exported

@AlexWaygood
Copy link
Member

Okay, I found a thing: python/mypy#16823

Oh, that looks clever! I'll review in a bit once I've had my breakfast

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted An actionable problem of low to medium complexity where a PR would be very welcome
Projects
None yet
3 participants