From 3015d7a58f5f55f63145426fe05874f6c6e93643 Mon Sep 17 00:00:00 2001 From: fly1d <309400591+fly1d@users.noreply.github.com> Date: Tue, 25 Aug 2026 10:59:09 +0800 Subject: [PATCH 1/2] Make types-networkx NumPy dependency optional OpenAI Codex assisted with issue review, implementation, and verification. The change was reviewed before submission. --- stubs/networkx/METADATA.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stubs/networkx/METADATA.toml b/stubs/networkx/METADATA.toml index 80c1685dcf49..acd13d3d97e0 100644 --- a/stubs/networkx/METADATA.toml +++ b/stubs/networkx/METADATA.toml @@ -1,7 +1,7 @@ version = "3.6.1" upstream-repository = "https://github.com/networkx/networkx" # requires a version of numpy with a `py.typed` file -dependencies = ["numpy>=1.20"] +optional-dependencies = ["numpy>=1.20"] [tool.stubtest] # stub_uploader won't allow pandas-stubs in the requires field https://github.com/typeshed-internal/stub_uploader/issues/90 From 142ce78cf9b5c11c47f4ba3bef9ecb3617805412 Mon Sep 17 00:00:00 2001 From: fly1d <309400591+fly1d@users.noreply.github.com> Date: Thu, 3 Sep 2026 10:21:29 +0800 Subject: [PATCH 2/2] Raise the networkx NumPy typing floor The stubs import numpy.typing.NDArray, which was introduced in NumPy 1.21. Keep the optional dependency aligned with the minimum typing API the stubs use rather than an unreleased NetworkX requirement. OpenAI Codex assisted with review, implementation, and verification. The change was reviewed before submission. --- stubs/networkx/METADATA.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stubs/networkx/METADATA.toml b/stubs/networkx/METADATA.toml index acd13d3d97e0..0f83cc29aabf 100644 --- a/stubs/networkx/METADATA.toml +++ b/stubs/networkx/METADATA.toml @@ -1,7 +1,7 @@ version = "3.6.1" upstream-repository = "https://github.com/networkx/networkx" -# requires a version of numpy with a `py.typed` file -optional-dependencies = ["numpy>=1.20"] +# Requires a version of NumPy with `numpy.typing.NDArray`. +optional-dependencies = ["numpy>=1.21"] [tool.stubtest] # stub_uploader won't allow pandas-stubs in the requires field https://github.com/typeshed-internal/stub_uploader/issues/90