From 72837978df5a783aef5b5fcaedb1bff0ffe0aebf Mon Sep 17 00:00:00 2001 From: galipremsagar Date: Fri, 27 Oct 2023 12:17:52 -0700 Subject: [PATCH] Change versioning in dask_cuda --- VERSION | 1 + ci/build_python.sh | 11 ++++++++++- ci/build_python_pypi.sh | 6 ++++-- conda/recipes/dask-cuda/meta.yaml | 4 ++-- dask_cuda/VERSION | 1 + dask_cuda/__init__.py | 2 +- dask_cuda/_version.py | 20 ++++++++++++++++++++ pyproject.toml | 5 ++++- 8 files changed, 43 insertions(+), 7 deletions(-) create mode 100644 VERSION create mode 100644 dask_cuda/VERSION create mode 100644 dask_cuda/_version.py 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 d4a28497d..eeeafc5cf 100755 --- a/ci/build_python.sh +++ b/ci/build_python.sh @@ -9,9 +9,18 @@ export CMAKE_GENERATOR=Ninja rapids-print-env +package_name="dask_cuda" +package_dir="python" + +version=$(rapids-generate-version) +commit=$(git rev-parse HEAD) + +echo "${version}" | tr -d '"' > VERSION +sed -i "/^__git_commit__/ s/= .*/= \"${commit}\"/g" "${package_dir}/${package_name}/_version.py" + rapids-logger "Begin py build" -rapids-conda-retry mambabuild \ +RAPIDS_PACKAGE_VERSION=${version} rapids-conda-retry mambabuild \ conda/recipes/dask-cuda rapids-upload-conda-to-s3 python diff --git a/ci/build_python_pypi.sh b/ci/build_python_pypi.sh index 6b72b96d7..50362fa33 100755 --- a/ci/build_python_pypi.sh +++ b/ci/build_python_pypi.sh @@ -3,6 +3,9 @@ python -m pip install build --user + +version=$(rapids-generate-version) +commit=$(git rev-parse HEAD) # While conda provides these during conda-build, they are also necessary during # the setup.py build for PyPI export GIT_DESCRIBE_TAG=$(git describe --abbrev=0 --tags) @@ -11,8 +14,7 @@ export GIT_DESCRIBE_NUMBER=$(git rev-list ${GIT_DESCRIBE_TAG}..HEAD --count) # Build date for PyPI pre-releases using version from `pyproject.toml` as source. TOML_VERSION=$(grep "version = .*" pyproject.toml | grep -o '".*"' | sed 's/"//g') if ! rapids-is-release-build; then - export BUILD_DATE=$(date +%y%m%d) - export PACKAGE_VERSION_NUMBER="${TOML_VERSION}a${BUILD_DATE}" + export PACKAGE_VERSION_NUMBER="${version}" fi # Compute/export RAPIDS_DATE_STRING diff --git a/conda/recipes/dask-cuda/meta.yaml b/conda/recipes/dask-cuda/meta.yaml index 3b0c15626..6804b1ce4 100644 --- a/conda/recipes/dask-cuda/meta.yaml +++ b/conda/recipes/dask-cuda/meta.yaml @@ -4,7 +4,7 @@ # conda build -c conda-forge . {% set data = load_file_data("pyproject.toml") %} -{% set version = environ.get('GIT_DESCRIBE_TAG', '0.0.0.dev').lstrip('v') %} +{% set version = environ['RAPIDS_PACKAGE_VERSION'].strip('""').lstrip('v') %} {% set py_version = environ['CONDA_PY'] %} {% set date_string = environ['RAPIDS_DATE_STRING'] %} @@ -13,7 +13,7 @@ package: version: {{ version }} source: - git_url: ../../.. + path: ../../.. build: number: {{ GIT_DESCRIBE_NUMBER }} diff --git a/dask_cuda/VERSION b/dask_cuda/VERSION new file mode 100644 index 000000000..eb4bc9cb6 --- /dev/null +++ b/dask_cuda/VERSION @@ -0,0 +1 @@ +../VERSION diff --git a/dask_cuda/__init__.py b/dask_cuda/__init__.py index 9d6917ef6..dbbb1f7fb 100644 --- a/dask_cuda/__init__.py +++ b/dask_cuda/__init__.py @@ -11,6 +11,7 @@ import dask.dataframe.multi import dask.bag.core +from ._version import __git_commit__, __version__ from .cuda_worker import CUDAWorker from .explicit_comms.dataframe.shuffle import ( get_rearrange_by_column_wrapper, @@ -19,7 +20,6 @@ from .local_cuda_cluster import LocalCUDACluster from .proxify_device_objects import proxify_decorator, unproxify_decorator -__version__ = "23.12.00" # Monkey patching Dask to make use of explicit-comms when `DASK_EXPLICIT_COMMS=True` dask.dataframe.shuffle.rearrange_by_column = get_rearrange_by_column_wrapper( diff --git a/dask_cuda/_version.py b/dask_cuda/_version.py new file mode 100644 index 000000000..c54072ba5 --- /dev/null +++ b/dask_cuda/_version.py @@ -0,0 +1,20 @@ +# 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. + +import importlib.resources + +__version__ = ( + importlib.resources.files("dask_cuda").joinpath("VERSION").read_text().strip() +) +__git_commit__ = "" diff --git a/pyproject.toml b/pyproject.toml index 2ebe09bc7..c240e61b7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ requires = [ [project] name = "dask-cuda" -version = "23.12.00" +dynamic = ["version"] description = "Utilities for Dask and CUDA interactions" readme = { file = "README.md", content-type = "text/markdown" } authors = [ @@ -123,6 +123,9 @@ filterwarnings = [ [tool.setuptools] license-files = ["LICENSE"] +[tool.setuptools.dynamic] +version = {file = "dask_cuda/VERSION"} + [tool.setuptools.packages.find] exclude = [ "docs",