Skip to content
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

Validate version of vegafusion-python-embed #3303

Merged
merged 1 commit into from
Jan 2, 2024
Merged
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
10 changes: 7 additions & 3 deletions altair/utils/_importers.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@ def import_vegafusion() -> ModuleType:
min_version = "1.5.0"
try:
version = importlib_version("vegafusion")
if Version(version) < Version(min_version):
embed_version = importlib_version("vegafusion-python-embed")
if version != embed_version or Version(version) < Version(min_version):
raise RuntimeError(
f"The vegafusion package must be version {min_version} or greater. "
f"Found version {version}"
"The versions of the vegafusion and vegafusion-python-embed packages must match\n"
f"and must be version {min_version} or greater.\n"
f"Found:\n"
f" - vegafusion=={version}\n"
f" - vegafusion-python-embed=={embed_version}\n"
)
import vegafusion as vf # type: ignore

Expand Down