Skip to content

Remove exports from infrahub_sdk.__init__.py #93

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

Merged
merged 1 commit into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/+8dff6891.removed.md
Original file line number Diff line number Diff line change
@@ -0,0 +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.
63 changes: 0 additions & 63 deletions infrahub_sdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,76 +2,13 @@

import importlib.metadata

from .analyzer import GraphQLOperation, GraphQLQueryAnalyzer, GraphQLQueryVariable
from .batch import InfrahubBatch
from .branch import InfrahubBranchManager, InfrahubBranchManagerSync
from .client import InfrahubClient, InfrahubClientSync
from .config import Config
from .exceptions import (
AuthenticationError,
Error,
GraphQLError,
NodeNotFoundError,
ServerNotReachableError,
ServerNotResponsiveError,
ValidationError,
)
from .graphql import Mutation, Query
from .node import InfrahubNode, InfrahubNodeSync
from .schema import (
AttributeSchema,
GenericSchema,
InfrahubRepositoryConfig,
InfrahubSchema,
MainSchemaTypes,
NodeSchema,
ProfileSchema,
RelationshipCardinality,
RelationshipKind,
RelationshipSchema,
SchemaRoot,
)
from .store import NodeStore, NodeStoreSync
from .timestamp import Timestamp
from .uuidt import UUIDT, generate_uuid

__all__ = [
"AttributeSchema",
"AuthenticationError",
"Config",
"Error",
"InfrahubBatch",
"InfrahubBranchManager",
"InfrahubBranchManagerSync",
"InfrahubClient",
"InfrahubClientSync",
"InfrahubNode",
"InfrahubNodeSync",
"InfrahubRepositoryConfig",
"InfrahubSchema",
"generate_uuid",
"GenericSchema",
"GraphQLQueryAnalyzer",
"GraphQLQueryVariable",
"GraphQLError",
"GraphQLOperation",
"MainSchemaTypes",
"NodeNotFoundError",
"NodeSchema",
"Mutation",
"NodeStore",
"NodeStoreSync",
"ProfileSchema",
"Query",
"RelationshipSchema",
"RelationshipCardinality",
"RelationshipKind",
"SchemaRoot",
"ServerNotReachableError",
"ServerNotResponsiveError",
"Timestamp",
"UUIDT",
"ValidationError",
]

try:
Expand Down
2 changes: 1 addition & 1 deletion infrahub_sdk/ctl/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

from rich.console import Console

from .. import InfrahubNode
from ..ctl import config
from ..ctl.client import initialize_client
from ..ctl.repository import get_repository_config
from ..ctl.utils import execute_graphql_query, parse_cli_vars
from ..node import InfrahubNode
from ..schema import InfrahubRepositoryConfig


Expand Down
4 changes: 2 additions & 2 deletions tests/unit/sdk/test_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
import pytest
from rich.console import Console

from infrahub_sdk import Config, InfrahubClient, InfrahubClientSync, ValidationError
from infrahub_sdk import Config, InfrahubClient, InfrahubClientSync
from infrahub_sdk.ctl.schema import display_schema_load_errors
from infrahub_sdk.exceptions import SchemaNotFoundError
from infrahub_sdk.exceptions import SchemaNotFoundError, ValidationError
from infrahub_sdk.schema import (
InfrahubCheckDefinitionConfig,
InfrahubJinja2TransformConfig,
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/sdk/test_store.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import pytest

from infrahub_sdk import InfrahubNode, NodeStore
from infrahub_sdk.node import InfrahubNode
from infrahub_sdk.store import NodeStore

client_types = ["standard", "sync"]

Expand Down