Skip to content

PYTHON-3311 Module "pymongo" does not explicitly export attribute "MongoClient"; implicit reexport disabled #994

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

Merged
merged 5 commits into from
Jul 6, 2022

Conversation

blink1073
Copy link
Member

No description provided.

Copy link
Member

@ShaneHarvey ShaneHarvey left a comment

Choose a reason for hiding this comment

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

Nice test! One concern, is adding __all__ a breaking change for any users?

@@ -699,7 +700,7 @@ def command(
check: bool = True,
allowable_errors: Optional[Sequence[Union[str, int]]] = None,
read_preference: Optional[_ServerMode] = None,
codec_options: "Optional[CodecOptions[_CodecDocumentType]]" = None,
codec_options: "Optional[bson.codec_options.CodecOptions[_CodecDocumentType]]" = None,
Copy link
Member

Choose a reason for hiding this comment

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

Interesting. Why was this change needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sphinx saw an ambiguity between bson.CodecOptions and bson.codec_options.CodecOptions. ¯_(ツ)_/¯

names.remove("__all__")
for name in mod.__all__:
if name not in names and name not in ignores:
raise ValueError(name)
Copy link
Member

Choose a reason for hiding this comment

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

Suggest using self.fail or assert with a message explaining the failure here and below.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@blink1073 blink1073 requested a review from ShaneHarvey July 6, 2022 19:32
@ShaneHarvey
Copy link
Member

ShaneHarvey commented Jul 6, 2022

Still have this question:

is adding __all__ a breaking change for any users?

@blink1073
Copy link
Member Author

is adding all a breaking change for any users?

If they were relying on any of the items in GRIDFS_IGNORE it would be a breaking change. We could choose to leave it as an empty list to be extra conservative. I chose only ones that weren't from GridFS itself.

@blink1073
Copy link
Member Author

Also, if the user was relying on any of the typing imports on import * that would be a breaking change.

Copy link
Member

@ShaneHarvey ShaneHarvey left a comment

Choose a reason for hiding this comment

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

Cool, LGTM!

@blink1073 blink1073 merged commit b40f13b into mongodb:master Jul 6, 2022
@blink1073 blink1073 deleted the PYTHON-3311 branch July 6, 2022 23:30
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