Skip to content

Commit

Permalink
Validate version of vegafusion-python-embed (#3303)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonmmease authored Jan 2, 2024
1 parent 03d1a57 commit 77f8b62
Showing 1 changed file with 7 additions and 3 deletions.
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

0 comments on commit 77f8b62

Please sign in to comment.