From 11c1781977406a46e05e356fee1f3ed9cf228cd4 Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Thu, 2 May 2024 10:36:45 -0400 Subject: [PATCH] Use dynamic version for raft-ann-bench (#2285) Contributes to rapidsai/build-planning#15. Authors: - Kyle Edwards (https://github.com/KyleFromNVIDIA) Approvers: - Corey J. Nolet (https://github.com/cjnolet) - Bradley Dice (https://github.com/bdice) URL: https://github.com/rapidsai/raft/pull/2285 --- python/raft-ann-bench/pyproject.toml | 5 +++- .../raft-ann-bench/src/raft-ann-bench/VERSION | 1 + .../src/raft-ann-bench/__init__.py | 4 ++- .../src/raft-ann-bench/_version.py | 25 +++++++++++++++++++ 4 files changed, 33 insertions(+), 2 deletions(-) create mode 120000 python/raft-ann-bench/src/raft-ann-bench/VERSION create mode 100644 python/raft-ann-bench/src/raft-ann-bench/_version.py diff --git a/python/raft-ann-bench/pyproject.toml b/python/raft-ann-bench/pyproject.toml index ba336d841c..1348343db3 100644 --- a/python/raft-ann-bench/pyproject.toml +++ b/python/raft-ann-bench/pyproject.toml @@ -9,7 +9,7 @@ requires = [ [project] name = "raft-ann-bench" -version = "24.06.00" +dynamic = ["version"] description = "RAFT ANN benchmarks" authors = [ { name = "NVIDIA Corporation" }, @@ -57,3 +57,6 @@ skip = [ "build", "dist", ] + +[tool.setuptools.dynamic] +version = { attr = "raft-ann-bench.__version__" } diff --git a/python/raft-ann-bench/src/raft-ann-bench/VERSION b/python/raft-ann-bench/src/raft-ann-bench/VERSION new file mode 120000 index 0000000000..a4e948506b --- /dev/null +++ b/python/raft-ann-bench/src/raft-ann-bench/VERSION @@ -0,0 +1 @@ +../../../../VERSION \ No newline at end of file diff --git a/python/raft-ann-bench/src/raft-ann-bench/__init__.py b/python/raft-ann-bench/src/raft-ann-bench/__init__.py index 8f2cc34855..80a3b3f284 100644 --- a/python/raft-ann-bench/src/raft-ann-bench/__init__.py +++ b/python/raft-ann-bench/src/raft-ann-bench/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) 2023, NVIDIA CORPORATION. +# Copyright (c) 2023-2024, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,3 +12,5 @@ # See the License for the specific language governing permissions and # limitations under the License. # + +from ._version import __git_commit__, __version__ diff --git a/python/raft-ann-bench/src/raft-ann-bench/_version.py b/python/raft-ann-bench/src/raft-ann-bench/_version.py new file mode 100644 index 0000000000..6dbb8e81b0 --- /dev/null +++ b/python/raft-ann-bench/src/raft-ann-bench/_version.py @@ -0,0 +1,25 @@ +# Copyright (c) 2023-2024, NVIDIA CORPORATION. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + + +import importlib.resources + +__version__ = ( + importlib.resources.files("raft-ann-bench") + .joinpath("VERSION") + .read_text() + .strip() +) +__git_commit__ = ""