Skip to content

Commit ed48858

Browse files
authored
Merge pull request #93 from opsmill/pog-remove-exports
Remove exports from `infrahub_sdk.__init__.py`
2 parents e6cffd7 + 49d4834 commit ed48858

File tree

5 files changed

+6
-67
lines changed

5 files changed

+6
-67
lines changed

changelog/+8dff6891.removed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Breaking change: Removed all exports from infrahub_sdk/__init__.py except InfrahubClient, InfrahubClientSync and Config. If you previously imported other classes such as InfrahubNode from the root level these need to change to instead be an absolute path.

infrahub_sdk/__init__.py

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -2,76 +2,13 @@
22

33
import importlib.metadata
44

5-
from .analyzer import GraphQLOperation, GraphQLQueryAnalyzer, GraphQLQueryVariable
6-
from .batch import InfrahubBatch
7-
from .branch import InfrahubBranchManager, InfrahubBranchManagerSync
85
from .client import InfrahubClient, InfrahubClientSync
96
from .config import Config
10-
from .exceptions import (
11-
AuthenticationError,
12-
Error,
13-
GraphQLError,
14-
NodeNotFoundError,
15-
ServerNotReachableError,
16-
ServerNotResponsiveError,
17-
ValidationError,
18-
)
19-
from .graphql import Mutation, Query
20-
from .node import InfrahubNode, InfrahubNodeSync
21-
from .schema import (
22-
AttributeSchema,
23-
GenericSchema,
24-
InfrahubRepositoryConfig,
25-
InfrahubSchema,
26-
MainSchemaTypes,
27-
NodeSchema,
28-
ProfileSchema,
29-
RelationshipCardinality,
30-
RelationshipKind,
31-
RelationshipSchema,
32-
SchemaRoot,
33-
)
34-
from .store import NodeStore, NodeStoreSync
35-
from .timestamp import Timestamp
36-
from .uuidt import UUIDT, generate_uuid
377

388
__all__ = [
39-
"AttributeSchema",
40-
"AuthenticationError",
419
"Config",
42-
"Error",
43-
"InfrahubBatch",
44-
"InfrahubBranchManager",
45-
"InfrahubBranchManagerSync",
4610
"InfrahubClient",
4711
"InfrahubClientSync",
48-
"InfrahubNode",
49-
"InfrahubNodeSync",
50-
"InfrahubRepositoryConfig",
51-
"InfrahubSchema",
52-
"generate_uuid",
53-
"GenericSchema",
54-
"GraphQLQueryAnalyzer",
55-
"GraphQLQueryVariable",
56-
"GraphQLError",
57-
"GraphQLOperation",
58-
"MainSchemaTypes",
59-
"NodeNotFoundError",
60-
"NodeSchema",
61-
"Mutation",
62-
"NodeStore",
63-
"NodeStoreSync",
64-
"ProfileSchema",
65-
"Query",
66-
"RelationshipSchema",
67-
"RelationshipCardinality",
68-
"RelationshipKind",
69-
"SchemaRoot",
70-
"ServerNotReachableError",
71-
"ServerNotResponsiveError",
72-
"Timestamp",
73-
"UUIDT",
74-
"ValidationError",
7512
]
7613

7714
try:

infrahub_sdk/ctl/generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33

44
from rich.console import Console
55

6-
from .. import InfrahubNode
76
from ..ctl import config
87
from ..ctl.client import initialize_client
98
from ..ctl.repository import get_repository_config
109
from ..ctl.utils import execute_graphql_query, parse_cli_vars
10+
from ..node import InfrahubNode
1111
from ..schema import InfrahubRepositoryConfig
1212

1313

tests/unit/sdk/test_schema.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
import pytest
66
from rich.console import Console
77

8-
from infrahub_sdk import Config, InfrahubClient, InfrahubClientSync, ValidationError
8+
from infrahub_sdk import Config, InfrahubClient, InfrahubClientSync
99
from infrahub_sdk.ctl.schema import display_schema_load_errors
10-
from infrahub_sdk.exceptions import SchemaNotFoundError
10+
from infrahub_sdk.exceptions import SchemaNotFoundError, ValidationError
1111
from infrahub_sdk.schema import (
1212
InfrahubCheckDefinitionConfig,
1313
InfrahubJinja2TransformConfig,

tests/unit/sdk/test_store.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import pytest
22

3-
from infrahub_sdk import InfrahubNode, NodeStore
3+
from infrahub_sdk.node import InfrahubNode
4+
from infrahub_sdk.store import NodeStore
45

56
client_types = ["standard", "sync"]
67

0 commit comments

Comments
 (0)