mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-06 05:27:24 +00:00
[Python] Avoid double flatbuffers include in pyi files (#8626)
This commit is contained in:
@@ -587,6 +587,7 @@ class PythonStubGenerator {
|
||||
std::map<std::string, std::set<std::string>> names_by_module;
|
||||
for (const Import &import : imports.imports) {
|
||||
if (import.IsLocal()) continue; // skip all local imports
|
||||
if (import.module == "flatbuffers" && import.name == "") continue; // skip double include hardcoded flatbuffers
|
||||
if (import.name == "") {
|
||||
modules.insert(import.module);
|
||||
} else {
|
||||
|
||||
@@ -3,7 +3,6 @@ from __future__ import annotations
|
||||
import flatbuffers
|
||||
import numpy as np
|
||||
|
||||
import flatbuffers
|
||||
import typing
|
||||
from MyGame.Example.NestedStruct import NestedStruct, NestedStructT
|
||||
from MyGame.Example.TestEnum import TestEnum
|
||||
|
||||
@@ -3,7 +3,6 @@ from __future__ import annotations
|
||||
import flatbuffers
|
||||
import numpy as np
|
||||
|
||||
import flatbuffers
|
||||
import typing
|
||||
from MyGame.Example.ArrayStruct import ArrayStruct, ArrayStructT
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ from __future__ import annotations
|
||||
import flatbuffers
|
||||
import numpy as np
|
||||
|
||||
import flatbuffers
|
||||
import typing
|
||||
from MyGame.Example.TestEnum import TestEnum
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ from __future__ import annotations
|
||||
import flatbuffers
|
||||
import numpy as np
|
||||
|
||||
import flatbuffers
|
||||
import typing
|
||||
from MyGame.Example.NestedUnion.TestSimpleTableWithEnum import TestSimpleTableWithEnum
|
||||
from MyGame.Example.NestedUnion.Vec3 import Vec3
|
||||
|
||||
@@ -3,7 +3,6 @@ from __future__ import annotations
|
||||
import flatbuffers
|
||||
import numpy as np
|
||||
|
||||
import flatbuffers
|
||||
import typing
|
||||
from typing import cast
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ from __future__ import annotations
|
||||
import flatbuffers
|
||||
import numpy as np
|
||||
|
||||
import flatbuffers
|
||||
import typing
|
||||
from MyGame.Example.NestedUnion.Any import Any
|
||||
from MyGame.Example.NestedUnion.TestSimpleTableWithEnum import TestSimpleTableWithEnumT
|
||||
|
||||
@@ -3,7 +3,6 @@ from __future__ import annotations
|
||||
import flatbuffers
|
||||
import numpy as np
|
||||
|
||||
import flatbuffers
|
||||
import typing
|
||||
|
||||
uoffset: typing.TypeAlias = flatbuffers.number_types.UOffsetTFlags.py_type
|
||||
|
||||
@@ -3,7 +3,6 @@ from __future__ import annotations
|
||||
import flatbuffers
|
||||
import numpy as np
|
||||
|
||||
import flatbuffers
|
||||
import typing
|
||||
from MyGame.Example.NestedUnion.Color import Color
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ from __future__ import annotations
|
||||
import flatbuffers
|
||||
import numpy as np
|
||||
|
||||
import flatbuffers
|
||||
import typing
|
||||
from MyGame.Example.NestedUnion.Color import Color
|
||||
from MyGame.Example.NestedUnion.Test import Test, TestT
|
||||
|
||||
@@ -3,7 +3,6 @@ from __future__ import annotations
|
||||
import flatbuffers
|
||||
import numpy as np
|
||||
|
||||
import flatbuffers
|
||||
import typing
|
||||
from typing import cast
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ from __future__ import annotations
|
||||
import flatbuffers
|
||||
import numpy as np
|
||||
|
||||
import flatbuffers
|
||||
import typing
|
||||
|
||||
uoffset: typing.TypeAlias = flatbuffers.number_types.UOffsetTFlags.py_type
|
||||
|
||||
Reference in New Issue
Block a user