From ec6b6bb6bca69c7152986b8701090ba93b174e1d Mon Sep 17 00:00:00 2001 From: divyegala Date: Thu, 12 Oct 2023 17:40:22 -0700 Subject: [PATCH 01/13] nightly versions --- ci/build_cpp.sh | 4 +++- ci/build_python.sh | 10 ++++++++++ ci/build_wheel.sh | 9 +++++---- conda/recipes/libwholegraph/meta.yaml | 4 ++-- conda/recipes/pylibwholegraph/meta.yaml | 4 ++-- .../pylibwholegraph/__init__.py | 2 +- .../pylibwholegraph/_version.py | 18 ++++++++++++++++++ python/pylibwholegraph/pyproject.toml | 5 ++++- 8 files changed, 45 insertions(+), 11 deletions(-) create mode 100644 python/pylibwholegraph/pylibwholegraph/_version.py diff --git a/ci/build_cpp.sh b/ci/build_cpp.sh index e290374fd..4e1b7bd2a 100755 --- a/ci/build_cpp.sh +++ b/ci/build_cpp.sh @@ -9,8 +9,10 @@ export CMAKE_GENERATOR=Ninja rapids-print-env +version=$(rapids-generate-version) + rapids-logger "Begin cpp build" -rapids-conda-retry mambabuild conda/recipes/libwholegraph +RAPIDS_PACKAGE_VERSION=${version} rapids-conda-retry mambabuild conda/recipes/libwholegraph rapids-upload-conda-to-s3 cpp diff --git a/ci/build_python.sh b/ci/build_python.sh index e4382400e..1f2110958 100755 --- a/ci/build_python.sh +++ b/ci/build_python.sh @@ -13,6 +13,13 @@ PACKAGES="libwholegraph" CPP_CHANNEL=$(rapids-download-conda-from-s3 cpp) +version=$(rapids-generate-version) +git_commit=$(git rev-parse HEAD) +export RAPIDS_PACKAGE_VERSION=${version} + +version_file_libwholegraph="python/libwholegraph/libwholegraph/_version.py" +sed -i "/^__version__/ s/= .*/= ${version}/g" ${version_file_libwholegraph} +sed -i "/^__git_commit__/ s/= .*/= \"${git_commit}\"/g" ${version_file_libwholegraph} rapids-mamba-retry install \ --channel "${CPP_CHANNEL}" \ "${PACKAGES}" @@ -22,6 +29,9 @@ rapids-logger "Begin py build" # TODO: Remove `--no-test` flags once importing on a CPU # node works correctly rapids-logger "Begin pylibwholegraph build" +version_file_pylibwholegraph="python/pylibwholegraph/pylibwholegraph/_version.py" +sed -i "/^__version__/ s/= .*/= ${version}/g" ${version_file_pylibwholegraph} +sed -i "/^__git_commit__/ s/= .*/= \"${git_commit}\"/g" ${version_file_pylibwholegraph} rapids-conda-retry mambabuild \ --no-test \ --channel "${CPP_CHANNEL}" \ diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh index 6e2c9f73c..0c502bb78 100755 --- a/ci/build_wheel.sh +++ b/ci/build_wheel.sh @@ -9,9 +9,8 @@ package_dir="python/pylibwholegraph" source rapids-configure-sccache source rapids-date-string -# Use gha-tools rapids-pip-wheel-version to generate wheel version then -# update the necessary files -version_override="$(rapids-pip-wheel-version ${RAPIDS_DATE_STRING})" +version=$(rapids-generate-version) +git_commit=$(git rev-parse HEAD) RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})" @@ -21,9 +20,11 @@ PACKAGE_CUDA_SUFFIX="-${RAPIDS_PY_CUDA_SUFFIX}" # Patch project metadata files to include the CUDA version suffix and version override. pyproject_file="${package_dir}/pyproject.toml" +version_file="${package_dir}/${package_name}/_version.py" -sed -i "s/^version = .*/version = \"${version_override}\"/g" ${pyproject_file} sed -i "s/name = \"${package_name}\"/name = \"${package_name}${PACKAGE_CUDA_SUFFIX}\"/g" ${pyproject_file} +sed -i "/^__version__ / s/= .*/= ${version}/g" ${version_file} +sed -i "/^__git_commit__ / s/= .*/= \"${git_commit}\"/g" ${version_file} # For nightlies we want to ensure that we're pulling in alphas as well. The # easiest way to do so is to augment the spec with a constraint containing a diff --git a/conda/recipes/libwholegraph/meta.yaml b/conda/recipes/libwholegraph/meta.yaml index c3551fc62..4ac82d1d5 100644 --- a/conda/recipes/libwholegraph/meta.yaml +++ b/conda/recipes/libwholegraph/meta.yaml @@ -1,6 +1,6 @@ # Copyright (c) 2019-2023, NVIDIA CORPORATION. -{% set version = environ.get('GIT_DESCRIBE_TAG', '0.0.0.dev').lstrip('v') %} +{% set version = environ.get('RAPIDS_PACKAGE_VERSION', '0.0.0.dev').strip('"').lstrip('v') + environ.get('VERSION_SUFFIX', '') %} {% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %} {% set cuda_version = '.'.join(environ['RAPIDS_CUDA_VERSION'].split('.')[:2]) %} {% set cuda_major = cuda_version.split('.')[0] %} @@ -11,7 +11,7 @@ package: name: libwholegraph-split source: - git_url: ../../.. + path: ../../.. build: script_env: diff --git a/conda/recipes/pylibwholegraph/meta.yaml b/conda/recipes/pylibwholegraph/meta.yaml index 7237eb3df..497ae7191 100644 --- a/conda/recipes/pylibwholegraph/meta.yaml +++ b/conda/recipes/pylibwholegraph/meta.yaml @@ -1,6 +1,6 @@ # Copyright (c) 2022-2023, NVIDIA CORPORATION. -{% set version = environ.get('GIT_DESCRIBE_TAG', '0.0.0.dev').lstrip('v') %} +{% set version = environ.get('RAPIDS_PACKAGE_VERSION', '0.0.0.dev').strip('"').lstrip('v') + environ.get('VERSION_SUFFIX', '') %} {% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %} {% set cuda_version = '.'.join(environ['RAPIDS_CUDA_VERSION'].split('.')[:2]) %} {% set cuda_major = cuda_version.split('.')[0] %} @@ -12,7 +12,7 @@ package: version: {{ version }} source: - git_url: ../../.. + path: ../../.. build: number: {{ GIT_DESCRIBE_NUMBER }} diff --git a/python/pylibwholegraph/pylibwholegraph/__init__.py b/python/pylibwholegraph/pylibwholegraph/__init__.py index d3184e8d0..f416c96cf 100644 --- a/python/pylibwholegraph/pylibwholegraph/__init__.py +++ b/python/pylibwholegraph/pylibwholegraph/__init__.py @@ -11,4 +11,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "23.12.00" +from pylibwholegraph._version import __git_commit__, __version__ diff --git a/python/pylibwholegraph/pylibwholegraph/_version.py b/python/pylibwholegraph/pylibwholegraph/_version.py new file mode 100644 index 000000000..ae559168f --- /dev/null +++ b/python/pylibwholegraph/pylibwholegraph/_version.py @@ -0,0 +1,18 @@ +# Copyright (c) 2023, 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. +# + +# Version configuration +__version__ = "23.12.00" +__git_commit__ = "" diff --git a/python/pylibwholegraph/pyproject.toml b/python/pylibwholegraph/pyproject.toml index 0e3cf966e..572341584 100644 --- a/python/pylibwholegraph/pyproject.toml +++ b/python/pylibwholegraph/pyproject.toml @@ -24,7 +24,7 @@ requires = [ [project] name = "pylibwholegraph" -version = "23.12.00" +dynamic = ["version"] description = "pylibwholegraph - GPU Graph Storage for GNN feature and graph structure" authors = [ { name = "NVIDIA Corporation" }, @@ -45,3 +45,6 @@ classifiers = [ [tool.setuptools] license-files = ["LICENSE"] + +[tool.setuptools.dynamic] +version = {attr = "pylibwholegraph._version.__version__"} From 656a656b2e64d08859e6b72eb6f135b1fe32fb08 Mon Sep 17 00:00:00 2001 From: divyegala Date: Thu, 12 Oct 2023 18:09:47 -0700 Subject: [PATCH 02/13] remove explicit libwholegraph install from build_python.sh --- ci/build_python.sh | 7 ------- 1 file changed, 7 deletions(-) diff --git a/ci/build_python.sh b/ci/build_python.sh index 1f2110958..83f94fa89 100755 --- a/ci/build_python.sh +++ b/ci/build_python.sh @@ -17,13 +17,6 @@ version=$(rapids-generate-version) git_commit=$(git rev-parse HEAD) export RAPIDS_PACKAGE_VERSION=${version} -version_file_libwholegraph="python/libwholegraph/libwholegraph/_version.py" -sed -i "/^__version__/ s/= .*/= ${version}/g" ${version_file_libwholegraph} -sed -i "/^__git_commit__/ s/= .*/= \"${git_commit}\"/g" ${version_file_libwholegraph} -rapids-mamba-retry install \ - --channel "${CPP_CHANNEL}" \ - "${PACKAGES}" - rapids-logger "Begin py build" # TODO: Remove `--no-test` flags once importing on a CPU From 89e1bcf7126cb0622b6eb568796631d8958c9260 Mon Sep 17 00:00:00 2001 From: divyegala Date: Tue, 17 Oct 2023 07:41:40 -0700 Subject: [PATCH 03/13] update update_version --- ci/release/update-version.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ci/release/update-version.sh b/ci/release/update-version.sh index 850a180a3..e809aa4e8 100755 --- a/ci/release/update-version.sh +++ b/ci/release/update-version.sh @@ -58,10 +58,7 @@ sed_runner 's/version = .*/version = '"'${NEXT_SHORT_TAG}'"'/g' docs/wholegraph/ sed_runner 's/release = .*/release = '"'${NEXT_FULL_TAG}'"'/g' docs/wholegraph/source/conf.py # Python __init__.py updates -sed_runner "s/__version__ = .*/__version__ = \"${NEXT_FULL_TAG}\"/g" python/pylibwholegraph/pylibwholegraph/__init__.py - -# Python pyproject.toml updates -sed_runner "s/^version = .*/version = \"${NEXT_FULL_TAG}\"/g" python/pylibwholegraph/pyproject.toml +sed_runner "/__version__ / s/= .*/= \"${NEXT_FULL_TAG}\"/g" python/pylibwholegraph/pylibwholegraph/_version.py DEPENDENCIES=( libraft From c3c075635a8fcbf5c9c02aeb36cb2f4e61bc9a22 Mon Sep 17 00:00:00 2001 From: divyegala Date: Tue, 17 Oct 2023 07:46:39 -0700 Subject: [PATCH 04/13] correct comment --- ci/release/update-version.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/release/update-version.sh b/ci/release/update-version.sh index e809aa4e8..1f40ef12d 100755 --- a/ci/release/update-version.sh +++ b/ci/release/update-version.sh @@ -57,7 +57,7 @@ sed_runner '/set(RAPIDS_VERSION/ s/".*"/'\"${NEXT_SHORT_TAG}\"'/g' python/pylibw sed_runner 's/version = .*/version = '"'${NEXT_SHORT_TAG}'"'/g' docs/wholegraph/source/conf.py sed_runner 's/release = .*/release = '"'${NEXT_FULL_TAG}'"'/g' docs/wholegraph/source/conf.py -# Python __init__.py updates +# Python _version.py updates sed_runner "/__version__ / s/= .*/= \"${NEXT_FULL_TAG}\"/g" python/pylibwholegraph/pylibwholegraph/_version.py DEPENDENCIES=( From 2b414ed8fe67d421f5878299cb7438d0694dafb4 Mon Sep 17 00:00:00 2001 From: divyegala Date: Wed, 18 Oct 2023 16:48:35 -0700 Subject: [PATCH 05/13] remove default conda ver --- conda/recipes/libwholegraph/meta.yaml | 2 +- conda/recipes/pylibwholegraph/meta.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/conda/recipes/libwholegraph/meta.yaml b/conda/recipes/libwholegraph/meta.yaml index 4ac82d1d5..c0f16994f 100644 --- a/conda/recipes/libwholegraph/meta.yaml +++ b/conda/recipes/libwholegraph/meta.yaml @@ -1,6 +1,6 @@ # Copyright (c) 2019-2023, NVIDIA CORPORATION. -{% set version = environ.get('RAPIDS_PACKAGE_VERSION', '0.0.0.dev').strip('"').lstrip('v') + environ.get('VERSION_SUFFIX', '') %} +{% set version = environ['RAPIDS_PACKAGE_VERSION'].strip('"').lstrip('v') + environ.get('VERSION_SUFFIX', '') %} {% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %} {% set cuda_version = '.'.join(environ['RAPIDS_CUDA_VERSION'].split('.')[:2]) %} {% set cuda_major = cuda_version.split('.')[0] %} diff --git a/conda/recipes/pylibwholegraph/meta.yaml b/conda/recipes/pylibwholegraph/meta.yaml index 497ae7191..1ccdb4a28 100644 --- a/conda/recipes/pylibwholegraph/meta.yaml +++ b/conda/recipes/pylibwholegraph/meta.yaml @@ -1,6 +1,6 @@ # Copyright (c) 2022-2023, NVIDIA CORPORATION. -{% set version = environ.get('RAPIDS_PACKAGE_VERSION', '0.0.0.dev').strip('"').lstrip('v') + environ.get('VERSION_SUFFIX', '') %} +{% set version = environ['RAPIDS_PACKAGE_VERSION'].strip('"').lstrip('v') + environ.get('VERSION_SUFFIX', '') %} {% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %} {% set cuda_version = '.'.join(environ['RAPIDS_CUDA_VERSION'].split('.')[:2]) %} {% set cuda_major = cuda_version.split('.')[0] %} From 90751e86001bf7c571af2c891611df5ab91811a4 Mon Sep 17 00:00:00 2001 From: divyegala Date: Fri, 20 Oct 2023 09:49:40 -0700 Subject: [PATCH 06/13] use anchor in sed regex --- ci/release/update-version.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/release/update-version.sh b/ci/release/update-version.sh index bc2289ada..9722896d7 100755 --- a/ci/release/update-version.sh +++ b/ci/release/update-version.sh @@ -58,7 +58,7 @@ sed_runner 's/version = .*/version = '"'${NEXT_SHORT_TAG}'"'/g' docs/wholegraph/ sed_runner 's/release = .*/release = '"'${NEXT_FULL_TAG}'"'/g' docs/wholegraph/source/conf.py # Python _version.py updates -sed_runner "/__version__ / s/= .*/= \"${NEXT_FULL_TAG}\"/g" python/pylibwholegraph/pylibwholegraph/_version.py +sed_runner "/^__version__ / s/= .*/= \"${NEXT_FULL_TAG}\"/g" python/pylibwholegraph/pylibwholegraph/_version.py DEPENDENCIES=( libraft From fb25710fc88df5d99422c43564f797c9bc5a584c Mon Sep 17 00:00:00 2001 From: divyegala Date: Wed, 25 Oct 2023 14:10:02 -0700 Subject: [PATCH 07/13] VERSION txt file --- python/pylibwholegraph/pylibwholegraph/VERSION | 1 + python/pylibwholegraph/pylibwholegraph/_version.py | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 120000 python/pylibwholegraph/pylibwholegraph/VERSION diff --git a/python/pylibwholegraph/pylibwholegraph/VERSION b/python/pylibwholegraph/pylibwholegraph/VERSION new file mode 120000 index 000000000..d62dc733e --- /dev/null +++ b/python/pylibwholegraph/pylibwholegraph/VERSION @@ -0,0 +1 @@ +../../../VERSION \ No newline at end of file diff --git a/python/pylibwholegraph/pylibwholegraph/_version.py b/python/pylibwholegraph/pylibwholegraph/_version.py index ae559168f..7d38ef9dc 100644 --- a/python/pylibwholegraph/pylibwholegraph/_version.py +++ b/python/pylibwholegraph/pylibwholegraph/_version.py @@ -13,6 +13,8 @@ # limitations under the License. # -# Version configuration -__version__ = "23.12.00" +import os.path + +with open(os.path.join(os.path.dirname(__file__), 'VERSION')) as version_file: + __version__ = version_file.read().strip() __git_commit__ = "" From 77220ad30e42676bd470120a8cd80b00119b27ac Mon Sep 17 00:00:00 2001 From: divyegala Date: Wed, 25 Oct 2023 14:21:21 -0700 Subject: [PATCH 08/13] missed files --- VERSION | 1 + ci/build_python.sh | 2 +- ci/build_wheel.sh | 2 +- ci/release/update-version.sh | 4 ++-- python/pylibwholegraph/pyproject.toml | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 VERSION diff --git a/VERSION b/VERSION new file mode 100644 index 000000000..a193fff41 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +23.12.00 diff --git a/ci/build_python.sh b/ci/build_python.sh index 83f94fa89..528ee40d3 100755 --- a/ci/build_python.sh +++ b/ci/build_python.sh @@ -16,6 +16,7 @@ CPP_CHANNEL=$(rapids-download-conda-from-s3 cpp) version=$(rapids-generate-version) git_commit=$(git rev-parse HEAD) export RAPIDS_PACKAGE_VERSION=${version} +echo "${version}" | tr -d '"' > VERSION rapids-logger "Begin py build" @@ -23,7 +24,6 @@ rapids-logger "Begin py build" # node works correctly rapids-logger "Begin pylibwholegraph build" version_file_pylibwholegraph="python/pylibwholegraph/pylibwholegraph/_version.py" -sed -i "/^__version__/ s/= .*/= ${version}/g" ${version_file_pylibwholegraph} sed -i "/^__git_commit__/ s/= .*/= \"${git_commit}\"/g" ${version_file_pylibwholegraph} rapids-conda-retry mambabuild \ --no-test \ diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh index 0c502bb78..2ea0bef18 100755 --- a/ci/build_wheel.sh +++ b/ci/build_wheel.sh @@ -23,7 +23,7 @@ pyproject_file="${package_dir}/pyproject.toml" version_file="${package_dir}/${package_name}/_version.py" sed -i "s/name = \"${package_name}\"/name = \"${package_name}${PACKAGE_CUDA_SUFFIX}\"/g" ${pyproject_file} -sed -i "/^__version__ / s/= .*/= ${version}/g" ${version_file} +echo "${version}" | tr -d '"' > VERSION sed -i "/^__git_commit__ / s/= .*/= \"${git_commit}\"/g" ${version_file} # For nightlies we want to ensure that we're pulling in alphas as well. The diff --git a/ci/release/update-version.sh b/ci/release/update-version.sh index 9722896d7..f06d21f06 100755 --- a/ci/release/update-version.sh +++ b/ci/release/update-version.sh @@ -57,8 +57,8 @@ sed_runner '/set(RAPIDS_VERSION/ s/".*"/'\"${NEXT_SHORT_TAG}\"'/g' python/pylibw sed_runner 's/version = .*/version = '"'${NEXT_SHORT_TAG}'"'/g' docs/wholegraph/source/conf.py sed_runner 's/release = .*/release = '"'${NEXT_FULL_TAG}'"'/g' docs/wholegraph/source/conf.py -# Python _version.py updates -sed_runner "/^__version__ / s/= .*/= \"${NEXT_FULL_TAG}\"/g" python/pylibwholegraph/pylibwholegraph/_version.py +# Centralized version file update +echo "${NEXT_FULL_TAG}" | tr -d '"' > VERSION DEPENDENCIES=( libraft diff --git a/python/pylibwholegraph/pyproject.toml b/python/pylibwholegraph/pyproject.toml index 572341584..ccb14b831 100644 --- a/python/pylibwholegraph/pyproject.toml +++ b/python/pylibwholegraph/pyproject.toml @@ -47,4 +47,4 @@ classifiers = [ license-files = ["LICENSE"] [tool.setuptools.dynamic] -version = {attr = "pylibwholegraph._version.__version__"} +version = {file = "pylibwholegraph/VERSION"} From 4a24a84d5c21985af79576ab08ffa3a789aad735 Mon Sep 17 00:00:00 2001 From: divyegala Date: Wed, 25 Oct 2023 15:12:58 -0700 Subject: [PATCH 09/13] VERSION to setup.py --- python/pylibwholegraph/setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/pylibwholegraph/setup.py b/python/pylibwholegraph/setup.py index 64b20e762..f9781af01 100644 --- a/python/pylibwholegraph/setup.py +++ b/python/pylibwholegraph/setup.py @@ -53,7 +53,8 @@ def run(self): ] ), package_data={ - "pylibwholegraph": ["torch_cpp_ext/*.cpp", "torch_cpp_ext/*.h"], + "pylibwholegraph": ["VERSION", "torch_cpp_ext/*.cpp", + "torch_cpp_ext/*.h"], }, include_package_data=True, cmdclass=cmdclass, From c400bff8a55b1608dd19c6f18a4b612189f4052a Mon Sep 17 00:00:00 2001 From: divyegala Date: Wed, 25 Oct 2023 15:19:42 -0700 Subject: [PATCH 10/13] style fix --- python/pylibwholegraph/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/pylibwholegraph/setup.py b/python/pylibwholegraph/setup.py index f9781af01..0a1f3fa42 100644 --- a/python/pylibwholegraph/setup.py +++ b/python/pylibwholegraph/setup.py @@ -53,7 +53,7 @@ def run(self): ] ), package_data={ - "pylibwholegraph": ["VERSION", "torch_cpp_ext/*.cpp", + "pylibwholegraph": ["VERSION", "torch_cpp_ext/*.cpp", "torch_cpp_ext/*.h"], }, include_package_data=True, From 0a48203e19a7686a8f06689a088550acc47d547b Mon Sep 17 00:00:00 2001 From: divyegala Date: Wed, 25 Oct 2023 15:23:25 -0700 Subject: [PATCH 11/13] double quotes --- python/pylibwholegraph/pylibwholegraph/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/pylibwholegraph/pylibwholegraph/_version.py b/python/pylibwholegraph/pylibwholegraph/_version.py index 7d38ef9dc..a614ca002 100644 --- a/python/pylibwholegraph/pylibwholegraph/_version.py +++ b/python/pylibwholegraph/pylibwholegraph/_version.py @@ -15,6 +15,6 @@ import os.path -with open(os.path.join(os.path.dirname(__file__), 'VERSION')) as version_file: +with open(os.path.join(os.path.dirname(__file__), "VERSION")) as version_file: __version__ = version_file.read().strip() __git_commit__ = "" From 52a13ae480a29ce981829ca5a061d90f0f335f6e Mon Sep 17 00:00:00 2001 From: divyegala Date: Thu, 26 Oct 2023 14:53:33 -0700 Subject: [PATCH 12/13] use importlib --- python/pylibwholegraph/pylibwholegraph/_version.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/python/pylibwholegraph/pylibwholegraph/_version.py b/python/pylibwholegraph/pylibwholegraph/_version.py index a614ca002..394252fd0 100644 --- a/python/pylibwholegraph/pylibwholegraph/_version.py +++ b/python/pylibwholegraph/pylibwholegraph/_version.py @@ -13,8 +13,9 @@ # limitations under the License. # -import os.path +import importlib.resources -with open(os.path.join(os.path.dirname(__file__), "VERSION")) as version_file: - __version__ = version_file.read().strip() +__version__ = ( + importlib.resources.files("pylibwholegraph").joinpath("VERSION").read_text().strip() +) __git_commit__ = "" From 146bf71f81192cb58ccfb52f7f76f361f3d8efcc Mon Sep 17 00:00:00 2001 From: divyegala Date: Tue, 31 Oct 2023 09:45:05 -0700 Subject: [PATCH 13/13] remove unneeded strip --- ci/build_python.sh | 2 +- ci/build_wheel.sh | 2 +- ci/release/update-version.sh | 2 +- conda/recipes/libwholegraph/meta.yaml | 2 +- conda/recipes/pylibwholegraph/meta.yaml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ci/build_python.sh b/ci/build_python.sh index 528ee40d3..b79ba92b1 100755 --- a/ci/build_python.sh +++ b/ci/build_python.sh @@ -16,7 +16,7 @@ CPP_CHANNEL=$(rapids-download-conda-from-s3 cpp) version=$(rapids-generate-version) git_commit=$(git rev-parse HEAD) export RAPIDS_PACKAGE_VERSION=${version} -echo "${version}" | tr -d '"' > VERSION +echo "${version}" > VERSION rapids-logger "Begin py build" diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh index 2ea0bef18..dd7ce7737 100755 --- a/ci/build_wheel.sh +++ b/ci/build_wheel.sh @@ -23,7 +23,7 @@ pyproject_file="${package_dir}/pyproject.toml" version_file="${package_dir}/${package_name}/_version.py" sed -i "s/name = \"${package_name}\"/name = \"${package_name}${PACKAGE_CUDA_SUFFIX}\"/g" ${pyproject_file} -echo "${version}" | tr -d '"' > VERSION +echo "${version}" > VERSION sed -i "/^__git_commit__ / s/= .*/= \"${git_commit}\"/g" ${version_file} # For nightlies we want to ensure that we're pulling in alphas as well. The diff --git a/ci/release/update-version.sh b/ci/release/update-version.sh index f06d21f06..0f64b213e 100755 --- a/ci/release/update-version.sh +++ b/ci/release/update-version.sh @@ -58,7 +58,7 @@ sed_runner 's/version = .*/version = '"'${NEXT_SHORT_TAG}'"'/g' docs/wholegraph/ sed_runner 's/release = .*/release = '"'${NEXT_FULL_TAG}'"'/g' docs/wholegraph/source/conf.py # Centralized version file update -echo "${NEXT_FULL_TAG}" | tr -d '"' > VERSION +echo "${NEXT_FULL_TAG}" > VERSION DEPENDENCIES=( libraft diff --git a/conda/recipes/libwholegraph/meta.yaml b/conda/recipes/libwholegraph/meta.yaml index c0f16994f..624c78bd5 100644 --- a/conda/recipes/libwholegraph/meta.yaml +++ b/conda/recipes/libwholegraph/meta.yaml @@ -1,6 +1,6 @@ # Copyright (c) 2019-2023, NVIDIA CORPORATION. -{% set version = environ['RAPIDS_PACKAGE_VERSION'].strip('"').lstrip('v') + environ.get('VERSION_SUFFIX', '') %} +{% set version = environ['RAPIDS_PACKAGE_VERSION'].lstrip('v') + environ.get('VERSION_SUFFIX', '') %} {% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %} {% set cuda_version = '.'.join(environ['RAPIDS_CUDA_VERSION'].split('.')[:2]) %} {% set cuda_major = cuda_version.split('.')[0] %} diff --git a/conda/recipes/pylibwholegraph/meta.yaml b/conda/recipes/pylibwholegraph/meta.yaml index 1ccdb4a28..0c7d57dc3 100644 --- a/conda/recipes/pylibwholegraph/meta.yaml +++ b/conda/recipes/pylibwholegraph/meta.yaml @@ -1,6 +1,6 @@ # Copyright (c) 2022-2023, NVIDIA CORPORATION. -{% set version = environ['RAPIDS_PACKAGE_VERSION'].strip('"').lstrip('v') + environ.get('VERSION_SUFFIX', '') %} +{% set version = environ['RAPIDS_PACKAGE_VERSION'].lstrip('v') + environ.get('VERSION_SUFFIX', '') %} {% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %} {% set cuda_version = '.'.join(environ['RAPIDS_CUDA_VERSION'].split('.')[:2]) %} {% set cuda_major = cuda_version.split('.')[0] %}