Skip to content

Commit

Permalink
Add check for nx release candidate versions
Browse files Browse the repository at this point in the history
  • Loading branch information
nv-rliu committed Aug 15, 2024
1 parent a538745 commit 25d9f11
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion python/nx-cugraph/_nx_cugraph/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ def get_info():

def _check_networkx_version():
import warnings
import re

import networkx as nx

Expand All @@ -310,7 +311,11 @@ def _check_networkx_version():
UserWarning,
stacklevel=2,
)
if len(version_minor) > 1:

# Allow single-digit minor versions, e.g. 3.4 and release candidates, e.g. 3.4rc0
pattern = r"^\d(rc\d+)?$"

if not re.match(pattern, version_minor):
raise RuntimeWarning(
f"nx-cugraph version {__version__} does not work with networkx version "
f"{nx.__version__}. Please upgrade (or fix) your Python environment."
Expand Down

0 comments on commit 25d9f11

Please sign in to comment.