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

Expose typings for the library users #704

Merged
merged 2 commits into from
Mar 26, 2021
Merged

Conversation

SergeyTsaplin
Copy link
Contributor

@SergeyTsaplin SergeyTsaplin commented Mar 4, 2021

What do these changes do?

These changes expose the type hints for the library users and fix the callbacks interfaces issue. The exposing is described in the PEP561.

Description

If there is no py.typed file in the library root, mypy doesn't discover the type hints from the sources.
So for the following command:

mypy -c "import kopf"
...

fails with message:

<string>:1: error: Skipping analyzing 'kopf': found module but no type hints or library stubs
<string>:1: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
Found 1 error in 1 file (checked 1 source file)

After the PR will be merged the command above should pass successfully:

mypy -c "import kopf"
Success: no issues found in 1 source file

The change does not affect the end-users and there are no breaking changes.

Type of changes

  • Bugfix (non-breaking change which fixes an issue)

Checklist

  • The code addresses only the mentioned problem, and this problem only
  • I think the code is well written
  • Unit tests for the changes that exist
  • Documentation reflects the changes
  • If you provide code modification, please add yourself to CONTRIBUTORS.txt

@SergeyTsaplin SergeyTsaplin changed the title Expose typings for the library users Draft: Expose typings for the library users Mar 4, 2021
@SergeyTsaplin SergeyTsaplin marked this pull request as draft March 4, 2021 15:06
@SergeyTsaplin SergeyTsaplin changed the title Draft: Expose typings for the library users Expose typings for the library users Mar 4, 2021
Signed-off-by: Sergei Tsaplin <me@sergeytsaplin.com>
@lgtm-com
Copy link

lgtm-com bot commented Mar 5, 2021

This pull request introduces 4 alerts when merging d9db887 into 8a08e0a - view on LGTM.com

new alerts:

  • 4 for Unused import

Base automatically changed from master to main March 10, 2021 19:45
@lgtm-com
Copy link

lgtm-com bot commented Mar 10, 2021

This pull request introduces 4 alerts when merging d9db887 into e71dc60 - view on LGTM.com

new alerts:

  • 4 for Unused import

Signed-off-by: Sergei Tsaplin <me@sergeytsaplin.com>
@SergeyTsaplin SergeyTsaplin marked this pull request as ready for review March 11, 2021 18:57
@nolar nolar merged commit b27f695 into nolar:main Mar 26, 2021
@nolar nolar added the automation CI/CD: testing, linting, releasing automatically label Mar 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automation CI/CD: testing, linting, releasing automatically
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants