Skip to content

Mypy unable to see py.typed marker for partial builds #818

Description

@addisonklinke

Caveat: I'm not much of a typing expert, so maybe I've missed something, but I have a hard type getting mypy to accept a partial builds

To reproduce

With mypy==1.15.0

# my_lib/aliases.py
from functools import partial

from hydra_zen import builds

builds_full_sig = partial(builds, populate_full_signature=True)

# error: Need type annotation for "builds_full_sig"  [var-annotated]

Switching to the more verbose

def builds_full_sig(*args, **kwargs):
    return builds(*args, populate_full_signature=True, **kwargs)

# Package 'my_lib.aliases' cannot be type checked due to missing py.typed marker. 
# See https://mypy.readthedocs.io/en/stable/installed_packages.html for more details

Theory

I see py.typed has existed here for 4 years, so somehow mypy isn't applying that to builds?

Desired behavior

Similar to how ZenStore is self-partially to build in common defaults, it'd be nice to enable this for builds (with mypy support)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions