Thanks to visit codestin.com
Credit goes to github.com

Skip to content

networkx: add all missing __all__ #13956

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 2 commits into from
May 9, 2025

Conversation

Avasam
Copy link
Collaborator

@Avasam Avasam commented May 7, 2025

Whilst merging stubs from https://github.com/microsoft/python-type-stubs/tree/main/stubs/networkx , I noticed a lot of missing functions. Let's start with __all__.

I set ignore_missing_stub = false and went through all errors mentionning __all__.

Not that I didn't put any effort into new annotations further than what Pylance was able to provide for return types.

The point is to keep this a fairly simple and easy review. Which will reduce the complexity of upcoming PRs.

@@ -23,3 +24,5 @@ from networkx.utils.misc import (
from networkx.utils.random_sequence import *
from networkx.utils.rcm import *
from networkx.utils.union_find import *

config: NetworkXConfig # Set by networkx/__init__.py
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is the only "special thing" I had to do throughout this PR.

networkx/__init__.py contains the lines:

config = utils.backends._set_configs_from_environment()
utils.config = utils.configs.config = config 

This comment has been minimized.

@@ -1,7 +1,15 @@
from binascii import Incomplete
Copy link
Member

Choose a reason for hiding this comment

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

binascii? I think this recurs a few times

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ugh, bad Pylance autoimport I didn't notice. Thanks for catching it !

Copy link
Member

@JelleZijlstra JelleZijlstra left a comment

Choose a reason for hiding this comment

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

Looks good, feel free to merge once you fix the binascii thing

Copy link
Contributor

github-actions bot commented May 9, 2025

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@Avasam Avasam merged commit 4b5e235 into python:main May 9, 2025
43 checks passed
@Avasam Avasam deleted the networkx-add-all-missing-`__all__` branch May 9, 2025 02:37
max-muoto pushed a commit to max-muoto/typeshed that referenced this pull request May 10, 2025
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