Skip to content

Commit

Permalink
Add Additional Check for NetworkX Release Candidate Versions (#4613)
Browse files Browse the repository at this point in the history
Part of rapidsai/graph_dl#579

This PR allows `nx-cugraph` to operate with release candidate (under development) versions of `networkx`

What This Pattern Allows:
- Just a single digit: `3.4`, `3.9`, etc

- Release Candidate format: `3.4rc0`. `3.7rc2`

This is needed to complete adding nightly test coverage for development branches of `nx`

Authors:
  - Ralph Liu (https://github.com/nv-rliu)

Approvers:
  - Erik Welch (https://github.com/eriknw)
  - Rick Ratzel (https://github.com/rlratzel)

URL: #4613
  • Loading branch information
nv-rliu authored Aug 16, 2024
1 parent de81819 commit a6a84eb
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 a6a84eb

Please sign in to comment.