Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@bluenote10
Copy link
Contributor

@bluenote10 bluenote10 commented Jan 18, 2025

Aim seems to have decent type annotations. Unfortunately it is missing a py.typed marker, which would allow users to actually benefit from these typings.

For instance when type checking the following user snippet with mypy:

from aim import Repo, Run

repo = Repo("/tmp/test_repo")
run = Run(repo=repo)

reveal_type(repo)
reveal_type(run)

repo.non_existing_method()
run.non_existing_method()

The output is:

debug_aim_types.py:6: note: Revealed type is "Any"
debug_aim_types.py:7: note: Revealed type is "Any"
Success: no issues found in 1 source file

i.e., mypy just sees untyped Any instances and fails to detect any bug / wrong usage on them, which is a bummer.

By adding this py.typed marker, mypy will reveal the types properly as Repo and Run, and it will be able to detect erroneous usages.

@CLAassistant
Copy link

CLAassistant commented Jan 18, 2025

CLA assistant check
All committers have signed the CLA.

@alberttorosyan alberttorosyan changed the title add py.typed marker to allow users to benefit from existing type annotations [feat] Add py.typed marker to allow users to benefit from existing type annotations Jan 20, 2025
Copy link
Member

@alberttorosyan alberttorosyan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bluenote10 thanks for your contribution! Approving this PR

@alberttorosyan alberttorosyan merged commit 7a98238 into aimhubio:main Jan 20, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants