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

[REQUEST] adding type hints and py.typed metadata #6988

Open
jamesbraza opened this issue Jan 31, 2025 · 1 comment
Open

[REQUEST] adding type hints and py.typed metadata #6988

jamesbraza opened this issue Jan 31, 2025 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@jamesbraza
Copy link

Is your feature request related to a problem? Please describe.

With deepspeed==0.15.4, mypy==1.14.1 reports deepspeed is untyped:

error: Skipping analyzing "deepspeed.utils": module is installed, but missing library stubs or py.typed marker  [import-untyped]
    from deepspeed.utils import logger
    ^
Skipping analyzing "deepspeed.checkpoint.constants": module is installed, but missing library stubs or py.typed marker  [import-untyped]
    from deepspeed.checkpoint.constants import (
    ^

This is because deepspeed doesn't have either type hints or a py.typed marker file.

Describe the solution you'd like

Adding type hints and a py.typed marker file so type checkers can inspect deepspeed to prevent TypeError-related bugs.

Describe alternatives you've considered

A workaround is to disable this error via mypy configuration:

[[tool.mypy.overrides]]
ignore_missing_imports = true
module = [
    "deepspeed.*",
]

Additional context

N/a

@jamesbraza jamesbraza added the enhancement New feature or request label Jan 31, 2025
@loadams loadams self-assigned this Feb 11, 2025
@loadams
Copy link
Collaborator

loadams commented Feb 11, 2025

Hi @jamesbraza - we can add this to our backlog of items, this seems like a reasonable thing for us to provide. If you have any interest in contributing on this, we can provide PR review as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants