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 support for py.typed file #201

Merged
merged 3 commits into from Feb 11, 2022
Merged

Conversation

nzsmith1
Copy link
Contributor

@nzsmith1 nzsmith1 commented Feb 9, 2022

Resolves #194

I have added the py.typed file to the project and added it to the pyproject.toml file. Running a test file:

from beanie import Document

class test(Document):
    name: str
    value: int

and running the command poetry run mypy test.py, I get the following output with the current build:
test.py:1: error: Skipping analyzing "beanie": module is installed, but missing library stubs or py.typed marker

running the same command on this built version, I get the following output:
Success: no issues found in 1 source file

So mypy can find the py.typed file just fine now.

I have added a few types where I could, the big section I left as I don't really understand how the field gets converted to a string name is the /odm/operators/*.py field parameters. This should probably be looked at by someone with a bit more knowledge of the depths than me and can be looked at as a different task.

@nzsmith1
Copy link
Contributor Author

nzsmith1 commented Feb 9, 2022

Looks like I did not setup my environment correctly on my home PC, I will have a look at this mypy error tomorrow...

@roman-right roman-right merged commit cf848b8 into roman-right:main Feb 11, 2022
@wonjoonSeol-WS
Copy link
Contributor

@nzsmith1
Hello, how did you deal with mypy errors after adding py.typed? I am still unable to update past 1.9.1 due to this issue.
#205

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.

[mypy] missing library stubs or py.typed marker
3 participants