diff --git a/altair/typing.py b/altair/typing/__init__.py similarity index 94% rename from altair/typing.py rename to altair/typing/__init__.py index 3c17895dd..d80469f35 100644 --- a/altair/typing.py +++ b/altair/typing/__init__.py @@ -51,10 +51,10 @@ "theme", ] -import altair.vegalite.v5.schema._config as theme +from altair.typing import theme +from altair.typing.theme import ThemeConfig from altair.utils.schemapi import Optional from altair.vegalite.v5.api import ChartType, is_chart_type -from altair.vegalite.v5.schema._config import ThemeConfig from altair.vegalite.v5.schema.channels import ( ChannelAngle, ChannelColor, diff --git a/altair/typing/theme.py b/altair/typing/theme.py new file mode 100644 index 000000000..17f9a7fd2 --- /dev/null +++ b/altair/typing/theme.py @@ -0,0 +1 @@ +from altair.vegalite.v5.schema._config import * # noqa: F403 diff --git a/altair/vegalite/v5/schema/_config.py b/altair/vegalite/v5/schema/_config.py index 39b39ec81..80864718d 100644 --- a/altair/vegalite/v5/schema/_config.py +++ b/altair/vegalite/v5/schema/_config.py @@ -10,7 +10,7 @@ from typing import TypedDict else: from typing_extensions import TypedDict - +from ._typing import PaddingKwds, RowColKwds if TYPE_CHECKING: # ruff: noqa: F405 diff --git a/tools/generate_schema_wrapper.py b/tools/generate_schema_wrapper.py index 2ff01c3ab..80cfb3bb7 100644 --- a/tools/generate_schema_wrapper.py +++ b/tools/generate_schema_wrapper.py @@ -1076,6 +1076,7 @@ def vegalite_main(skip_download: bool = False) -> None: HEADER, "from typing import Any, TYPE_CHECKING, Literal, Sequence, TypedDict, Union", import_typing_extensions((3, 14), "TypedDict", include_sys=True), + f"from ._typing import {ROW_COL_KWDS}, {PADDING_KWDS}", "\n\n", import_type_checking("from ._typing import * # noqa: F403"), "\n\n",