Skip to content

Commit

Permalink
Add __all__ to unstable modules
Browse files Browse the repository at this point in the history
This helps editors detect what can be imported from where, it at least
improved my experience with VS Code
  • Loading branch information
mathialo committed Nov 28, 2024
1 parent d3b4a0a commit b74bb4c
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 31 deletions.
3 changes: 3 additions & 0 deletions cognite/extractorutils/unstable/configuration/loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
from cognite.extractorutils.exceptions import InvalidConfigError
from cognite.extractorutils.unstable.configuration.models import ConfigModel

__all__ = ["ConfigFormat", "load_file", "load_from_cdf", "load_io", "load_dict"]


_T = TypeVar("_T", bound=ConfigModel)


Expand Down
15 changes: 15 additions & 0 deletions cognite/extractorutils/unstable/configuration/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,21 @@
from cognite.extractorutils.configtools._util import _load_certificate_data
from cognite.extractorutils.exceptions import InvalidConfigError

__all__ = [
"ConfigModel",
"AuthenticationConfig",
"TimeIntervalConfig",
"ConnectionConfig",
"CronConfig",
"IntervalConfig",
"ScheduleConfig",
"LogLevel",
"LogFileHandlerConfig",
"LogConsoleHandlerConfig",
"LogHandlerConfig",
"ExtractorConfig",
]


class ConfigModel(BaseModel):
model_config = ConfigDict(
Expand Down
31 changes: 0 additions & 31 deletions cognite/extractorutils/unstable/core/__main__.py

This file was deleted.

2 changes: 2 additions & 0 deletions cognite/extractorutils/unstable/core/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
from cognite.extractorutils.unstable.scheduling import TaskScheduler
from cognite.extractorutils.util import now

__all__ = ["ConfigType", "ConfigRevision", "Extractor"]

ConfigType = TypeVar("ConfigType", bound=ExtractorConfig)
ConfigRevision = Union[Literal["local"], int]

Expand Down
2 changes: 2 additions & 0 deletions cognite/extractorutils/unstable/core/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
if typing.TYPE_CHECKING:
from .base import Extractor

__all__ = ["Error", "ErrorLevel"]


class ErrorLevel(Enum):
warning = "warning"
Expand Down
2 changes: 2 additions & 0 deletions cognite/extractorutils/unstable/core/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
from ._messaging import RuntimeMessage
from .base import ConfigRevision, ConfigType, Extractor

__all__ = ["Runtime", "ExtractorType"]

ExtractorType = TypeVar("ExtractorType", bound=Extractor)


Expand Down
2 changes: 2 additions & 0 deletions cognite/extractorutils/unstable/core/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

from cognite.extractorutils.unstable.configuration.models import ScheduleConfig

__all__ = ["ScheduledTask", "ContinuousTask", "StartupTask", "Task"]


@dataclass
class _Task(ABC):
Expand Down

0 comments on commit b74bb4c

Please sign in to comment.