Skip to content

Commit

Permalink
Raise ImportError if neptune is installed
Browse files Browse the repository at this point in the history
  • Loading branch information
kgodlewski committed Nov 27, 2024
1 parent 668bef0 commit 437b634
Showing 1 changed file with 24 additions and 5 deletions.
29 changes: 24 additions & 5 deletions src/neptune_fetcher/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
"ReadOnlyRun",
]

try:
from importlib.metadata import (
PackageNotFoundError,
version,
)
from importlib.metadata import (
PackageNotFoundError,
version,
)

try:
# This will raise PackageNotFoundError if the package is not installed
version("neptune-experimental")

Expand All @@ -43,5 +43,24 @@
except PackageNotFoundError:
pass

try:
version("neptune")

raise ImportError(
"""You have `neptune` installed. The package is no longer a dependency and causes conflicts.
Uninstall it before using `neptune-fetcher`:
pip uninstall neptune
If you're using `uv`:
uv pip uninstall neptune
"""
)
except PackageNotFoundError:
pass

from .read_only_project import ReadOnlyProject
from .read_only_run import ReadOnlyRun

0 comments on commit 437b634

Please sign in to comment.