Skip to content

Daily tests failed on Fri Jan 26 2024 #11318

Closed
python/mypy
#16823

Description

@github-actions

Activity

  1. added
    help wantedAn actionable problem of low to medium complexity where a PR would be very welcome
    on Jan 26, 2024
  2. AlexWaygood commented on Jan 26, 2024

    @AlexWaygood
    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

  3. JelleZijlstra commented on Jan 26, 2024

    @JelleZijlstra
    Member

    Arguably a stubtest bug too.

  4. hauntsaninja commented on Jan 26, 2024

    @hauntsaninja
    Collaborator

    Lol

  5. hauntsaninja commented on Jan 26, 2024

    @hauntsaninja
    Collaborator

    @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...

  6. hauntsaninja commented on Jan 26, 2024

    @hauntsaninja
    Collaborator

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

  7. AlexWaygood commented on Jan 26, 2024

    @AlexWaygood
    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
  8. AlexWaygood commented on Jan 26, 2024

    @AlexWaygood
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedAn actionable problem of low to medium complexity where a PR would be very welcome

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions