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

Advertize type annotations with py.typed #1677

Merged
merged 1 commit into from
Nov 17, 2021

Conversation

jku
Copy link
Member

@jku jku commented Nov 15, 2021

Existence of py.typed in the top-level package tells users of the
packages that all packages are annotated.

This should fix mypy errors like this in downstream projects:

error: Skipping analyzing "tuf.api.metadata":
found module but no type hints or library stubs

Fixes #1633

Signed-off-by: Jussi Kukkonen jkukkonen@vmware.com

Existence of py.typed in the top-level package tells users of the
packages that the packages are annotated.

This should fix mypy errors like this in downstream projects:
  error: Skipping analyzing "tuf.api.metadata":
  found module but no type hints or library stubs

Fixes theupdateframework#1633

Signed-off-by: Jussi Kukkonen <jkukkonen@vmware.com>
@coveralls
Copy link

Pull Request Test Coverage Report for Build 1462084136

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 97.461%

Totals Coverage Status
Change from base Build 1449719184: 0.0%
Covered Lines: 3946
Relevant Lines: 4030

💛 - Coveralls

@jku
Copy link
Member Author

jku commented Nov 15, 2021

The one issue here might be upstream projects that

  • use annotations
  • use legacy python-tuf API

I'm not sure if any such projects like this exist but for them py.typed would be misleading and they will have to add some mypy config to skip tuf packages... Not optimal but maybe something we can live with until we remove legacy code?

@jku jku merged commit bb15ecf into theupdateframework:develop Nov 17, 2021
@lukpueh lukpueh mentioned this pull request Dec 13, 2021
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.

advertize type annotations
3 participants