Skip to content

networkx: ignore_missing_stub = false #13968

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Avasam
Copy link
Collaborator

@Avasam Avasam commented May 9, 2025

Whilst merging stubs from https://github.com/microsoft/python-type-stubs/tree/main/stubs/networkx , I noticed a lot of missing functions. This is a follow-up to #13956

There's 3 categories of new stubtest allowlist entries: 1 to avoid a crash, and 2 idk why they happen.

@Avasam Avasam marked this pull request as draft May 9, 2025 03:59

This comment has been minimized.

Comment on lines +41 to +49
# "..._DT is not present at runtime" but we don't set it in stubs, I don't understand this one
networkx(\.algorithms)?(\.tree)?(\.mst)?\.SpanningTreeIterator\.Partition\._DT
networkx(\.algorithms)?(\.tree)?(\.branchings)?\.ArborescenceIterator\.Partition\._DT

# variable differs from runtime type abc.ABCMeta
networkx.classes.reportviews.EdgeView.dataview
networkx.classes.reportviews.InEdgeView.dataview
networkx.classes.reportviews.OutEdgeView.dataview
networkx.classes.reportviews.OutMultiEdgeView.dataview
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These two issues I don't understand. I'm not sure if it's something I should do differently, just ignore, and/or report to mypy/stubtest

This comment has been minimized.

Comment on lines 38 to 39
# Stubtest crashes due to special unicode character
networkx.readwrite.text.*
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I opened an issue at python/mypy#19071

@Avasam Avasam marked this pull request as ready for review May 10, 2025 17:44

This comment has been minimized.

def items(self) -> ItemsView[str, Incomplete]: ...
def keys(self) -> KeysView[str]: ...
def values(self) -> ValuesView[Incomplete]: ...
# Our pyright test doesn't understand `requires_python` in METADATA.toml
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not too happy about this hack. Let's at least add a "TODO" comment and link a typeshed issue to fix our pyright test.

Copy link
Contributor

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

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