Skip to content

Commit 6d45e7b

Browse files
authored
Removes (unintentional?) runtime dependency on packaging from nx-cugraph (#4240)
A [recent PR](#4217) was merged that added `packaging` as a runtime dependency to nx-cugraph. This PR removes that dependency and manually extracts the `major` and `minor` version numbers instead. Authors: - Rick Ratzel (https://github.com/rlratzel) - Erik Welch (https://github.com/eriknw) Approvers: - Brad Rees (https://github.com/BradReesWork) - Erik Welch (https://github.com/eriknw) URL: #4240
1 parent fa096f0 commit 6d45e7b

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

python/nx-cugraph/_nx_cugraph/__init__.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,19 @@
2323
$ python _nx_cugraph/__init__.py
2424
"""
2525

26-
from packaging.version import Version
27-
2826
from _nx_cugraph._version import __version__
2927

30-
_nx_cugraph_version = Version(__version__)
28+
# This is normally handled by packaging.version.Version, but instead of adding
29+
# an additional runtime dependency on "packaging", assume __version__ will
30+
# always be in <major>.<minor>.<build> format.
31+
(_version_major, _version_minor) = __version__.split(".")[:2]
3132

3233
# Entries between BEGIN and END are automatically generated
3334
_info = {
3435
"backend_name": "cugraph",
3536
"project": "nx-cugraph",
3637
"package": "nx_cugraph",
37-
"url": f"https://github.com/rapidsai/cugraph/tree/branch-{_nx_cugraph_version.major:02}.{_nx_cugraph_version.minor:02}/python/nx-cugraph",
38+
"url": f"https://github.com/rapidsai/cugraph/tree/branch-{_version_major:0>2}.{_version_minor:0>2}/python/nx-cugraph",
3839
"short_summary": "GPU-accelerated backend.",
3940
# "description": "TODO",
4041
"functions": {

0 commit comments

Comments
 (0)