From 6d45e7b0f095577dbe60a35a1e46f8f582171057 Mon Sep 17 00:00:00 2001 From: Rick Ratzel <3039903+rlratzel@users.noreply.github.com> Date: Fri, 15 Mar 2024 03:26:26 -0500 Subject: [PATCH] Removes (unintentional?) runtime dependency on `packaging` from nx-cugraph (#4240) A [recent PR](https://github.com/rapidsai/cugraph/pull/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: https://github.com/rapidsai/cugraph/pull/4240 --- python/nx-cugraph/_nx_cugraph/__init__.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/python/nx-cugraph/_nx_cugraph/__init__.py b/python/nx-cugraph/_nx_cugraph/__init__.py index f6e5e3aa570..098de46af8e 100644 --- a/python/nx-cugraph/_nx_cugraph/__init__.py +++ b/python/nx-cugraph/_nx_cugraph/__init__.py @@ -23,18 +23,19 @@ $ python _nx_cugraph/__init__.py """ -from packaging.version import Version - from _nx_cugraph._version import __version__ -_nx_cugraph_version = Version(__version__) +# This is normally handled by packaging.version.Version, but instead of adding +# an additional runtime dependency on "packaging", assume __version__ will +# always be in .. format. +(_version_major, _version_minor) = __version__.split(".")[:2] # Entries between BEGIN and END are automatically generated _info = { "backend_name": "cugraph", "project": "nx-cugraph", "package": "nx_cugraph", - "url": f"https://github.com/rapidsai/cugraph/tree/branch-{_nx_cugraph_version.major:02}.{_nx_cugraph_version.minor:02}/python/nx-cugraph", + "url": f"https://github.com/rapidsai/cugraph/tree/branch-{_version_major:0>2}.{_version_minor:0>2}/python/nx-cugraph", "short_summary": "GPU-accelerated backend.", # "description": "TODO", "functions": {