mirror of
https://github.com/google/flatbuffers.git
synced 2026-07-01 12:51:36 +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;
|
std::map<std::string, std::set<std::string>> names_by_module;
|
||||||
for (const Import &import : imports.imports) {
|
for (const Import &import : imports.imports) {
|
||||||
if (import.IsLocal()) continue; // skip all local imports
|
if (import.IsLocal()) continue; // skip all local imports
|
||||||
|
if (import.module == "flatbuffers" && import.name == "") continue; // skip double include hardcoded flatbuffers
|
||||||
if (import.name == "") {
|
if (import.name == "") {
|
||||||
modules.insert(import.module);
|
modules.insert(import.module);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ from __future__ import annotations
|
|||||||
import flatbuffers
|
import flatbuffers
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
import flatbuffers
|
|
||||||
import typing
|
import typing
|
||||||
from MyGame.Example.NestedStruct import NestedStruct, NestedStructT
|
from MyGame.Example.NestedStruct import NestedStruct, NestedStructT
|
||||||
from MyGame.Example.TestEnum import TestEnum
|
from MyGame.Example.TestEnum import TestEnum
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ from __future__ import annotations
|
|||||||
import flatbuffers
|
import flatbuffers
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
import flatbuffers
|
|
||||||
import typing
|
import typing
|
||||||
from MyGame.Example.ArrayStruct import ArrayStruct, ArrayStructT
|
from MyGame.Example.ArrayStruct import ArrayStruct, ArrayStructT
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ from __future__ import annotations
|
|||||||
import flatbuffers
|
import flatbuffers
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
import flatbuffers
|
|
||||||
import typing
|
import typing
|
||||||
from MyGame.Example.TestEnum import TestEnum
|
from MyGame.Example.TestEnum import TestEnum
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ from __future__ import annotations
|
|||||||
import flatbuffers
|
import flatbuffers
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
import flatbuffers
|
|
||||||
import typing
|
import typing
|
||||||
from MyGame.Example.NestedUnion.TestSimpleTableWithEnum import TestSimpleTableWithEnum
|
from MyGame.Example.NestedUnion.TestSimpleTableWithEnum import TestSimpleTableWithEnum
|
||||||
from MyGame.Example.NestedUnion.Vec3 import Vec3
|
from MyGame.Example.NestedUnion.Vec3 import Vec3
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ from __future__ import annotations
|
|||||||
import flatbuffers
|
import flatbuffers
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
import flatbuffers
|
|
||||||
import typing
|
import typing
|
||||||
from typing import cast
|
from typing import cast
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ from __future__ import annotations
|
|||||||
import flatbuffers
|
import flatbuffers
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
import flatbuffers
|
|
||||||
import typing
|
import typing
|
||||||
from MyGame.Example.NestedUnion.Any import Any
|
from MyGame.Example.NestedUnion.Any import Any
|
||||||
from MyGame.Example.NestedUnion.TestSimpleTableWithEnum import TestSimpleTableWithEnumT
|
from MyGame.Example.NestedUnion.TestSimpleTableWithEnum import TestSimpleTableWithEnumT
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ from __future__ import annotations
|
|||||||
import flatbuffers
|
import flatbuffers
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
import flatbuffers
|
|
||||||
import typing
|
import typing
|
||||||
|
|
||||||
uoffset: typing.TypeAlias = flatbuffers.number_types.UOffsetTFlags.py_type
|
uoffset: typing.TypeAlias = flatbuffers.number_types.UOffsetTFlags.py_type
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ from __future__ import annotations
|
|||||||
import flatbuffers
|
import flatbuffers
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
import flatbuffers
|
|
||||||
import typing
|
import typing
|
||||||
from MyGame.Example.NestedUnion.Color import Color
|
from MyGame.Example.NestedUnion.Color import Color
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ from __future__ import annotations
|
|||||||
import flatbuffers
|
import flatbuffers
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
import flatbuffers
|
|
||||||
import typing
|
import typing
|
||||||
from MyGame.Example.NestedUnion.Color import Color
|
from MyGame.Example.NestedUnion.Color import Color
|
||||||
from MyGame.Example.NestedUnion.Test import Test, TestT
|
from MyGame.Example.NestedUnion.Test import Test, TestT
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ from __future__ import annotations
|
|||||||
import flatbuffers
|
import flatbuffers
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
import flatbuffers
|
|
||||||
import typing
|
import typing
|
||||||
from typing import cast
|
from typing import cast
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ from __future__ import annotations
|
|||||||
import flatbuffers
|
import flatbuffers
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
import flatbuffers
|
|
||||||
import typing
|
import typing
|
||||||
|
|
||||||
uoffset: typing.TypeAlias = flatbuffers.number_types.UOffsetTFlags.py_type
|
uoffset: typing.TypeAlias = flatbuffers.number_types.UOffsetTFlags.py_type
|
||||||
|
|||||||
Reference in New Issue
Block a user