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

Update __all__ fields #13063

Merged
merged 4 commits into from Oct 16, 2023
Merged

Update __all__ fields #13063

merged 4 commits into from Oct 16, 2023

Conversation

svlandeg
Copy link
Member

Update __all__ fields across the main modules

Description

Ensure that the imported classes/functions can be easily imported from the main module instead of a submodule (and doesn't get flagged by type checking). For easier maintenance, alphabetize the lists.

Types of change

fix

Checklist

  • I confirm that I have the right to submit this contribution under the project's MIT license.
  • I ran the tests, and all new and existing tests passed.
  • My changes don't require a change to the documentation, or if they do, I've added all required information.

@svlandeg svlandeg added the enhancement Feature requests and improvements label Oct 12, 2023
@kabirkhan
Copy link
Contributor

Looks great, wondering if we should add an __all__ to the main __init__.py file as well though
Currently for type checking (with pyright at least) you need to do:

from spacy.language import Language

instead of just:

from spacy import Language

@svlandeg svlandeg marked this pull request as draft October 13, 2023 08:44
@adrianeboyd
Copy link
Contributor

I'm actually not sure it's the intention of the API to support/prefer from spacy import Language? It looks like it's only imported in __init__.py for typing.

@svlandeg svlandeg marked this pull request as ready for review October 16, 2023 08:15
@svlandeg
Copy link
Member Author

As there is (only) discussion about the __all__ field in the main __init__.py but the actual edits of this PR do not touch that file, I'll go ahead and get this PR merged and leave the rest up for further discussion, to ensure this one does not get blocked.

@svlandeg svlandeg merged commit 699dd8b into explosion:master Oct 16, 2023
15 checks passed
@svlandeg svlandeg deleted the feat/all branch October 16, 2023 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature requests and improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants