Skip to content

Commit

Permalink
Merge pull request #4580 from rapidsai/branch-24.08
Browse files Browse the repository at this point in the history
Forward-merge branch-24.08 into branch-24.10
  • Loading branch information
GPUtester authored Jul 31, 2024
2 parents a7f28e4 + d77a2d6 commit 5fbc0fc
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
21 changes: 21 additions & 0 deletions python/nx-cugraph/_nx_cugraph/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,27 @@ def get_info():
return d


def _check_networkx_version():
import warnings

import networkx as nx

version_major, version_minor = nx.__version__.split(".")[:2]
if version_major != "3":
warnings.warn(
f"nx-cugraph version {__version__} is only known to work with networkx "
f"versions 3.x, but networkx {nx.__version__} is installed. "
"Perhaps try upgrading your Python environment.",
UserWarning,
stacklevel=2,
)
if len(version_minor) > 1:
raise RuntimeWarning(
f"nx-cugraph version {__version__} does not work with networkx version "
f"{nx.__version__}. Please upgrade (or fix) your Python environment."
)


if __name__ == "__main__":
from pathlib import Path

Expand Down
3 changes: 3 additions & 0 deletions python/nx-cugraph/nx_cugraph/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@
from .algorithms import *

from _nx_cugraph._version import __git_commit__, __version__
from _nx_cugraph import _check_networkx_version

_check_networkx_version()

0 comments on commit 5fbc0fc

Please sign in to comment.