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

Create an empty py.typed file to add mypy type hint support #61

Merged
merged 4 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions pydantic_mongo/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from .abstract_repository import AbstractRepository # noqa
from .fields import ObjectIdField # noqa
from .version import __version__ # noqa
from .abstract_repository import AbstractRepository as AbstractRepository
from .fields import ObjectIdField as ObjectIdField
from .version import __version__ as __version__

__all__ = [ "fields", "version", "abstract_repository" ]
2 changes: 1 addition & 1 deletion pydantic_mongo/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from pydantic_core import core_schema


class ObjectIdField(str):
class ObjectIdField(ObjectId):
@classmethod
def __get_pydantic_core_schema__(
cls, _source_type: Any, _handler: Any
Expand Down
1 change: 1 addition & 0 deletions pydantic_mongo/py.typed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@