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

Add py.typed for static analysis with mypy #65

Merged
merged 1 commit into from
May 30, 2022

Conversation

ryu22e
Copy link
Contributor

@ryu22e ryu22e commented May 26, 2022

The budoux source code contains type hints, but the following error occurs when using mypy.

$ cat main.py
import budoux
parser = budoux.load_default_japanese_parser()
$ mypy main.py
main.py:1: error: Skipping analyzing "budoux": module is installed, but missing library stubs or py.typed marker
main.py:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
Found 1 error in 1 file (checked 1 source file)

I added py.typed file according to the URL in the error message above. After adding the file, the error no longer occurs as shown below.

$ mypy main.py
Success: no issues found in 1 source file

@google-cla
Copy link

google-cla bot commented May 26, 2022

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@tushuhei tushuhei self-requested a review May 30, 2022 04:43
Copy link
Member

@tushuhei tushuhei left a comment

Choose a reason for hiding this comment

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

Thanks for your PR!
For some reason, I'm still seeing the same error in the GitHub action.
https://github.com/google/budoux/runs/6648740861

I believe the first thing needs to be fixed around mypy is that the GitHub action does not stop even if mypy is showing an error. I made another issue to follow up on this point at #67.

@tushuhei
Copy link
Member

Never mind, actually I found that it's a separate issue to yours.

@tushuhei tushuhei self-requested a review May 30, 2022 05:04
Copy link
Member

@tushuhei tushuhei left a comment

Choose a reason for hiding this comment

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

Sorry about the confusion. I managed to reproduce the issue and confirmed that your change resolves that. Thanks for your contribution!

@tushuhei tushuhei merged commit 7812232 into google:main May 30, 2022
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.

2 participants