Skip to content

Commit

Permalink
Change versioning in dask_cuda
Browse files Browse the repository at this point in the history
  • Loading branch information
galipremsagar committed Oct 27, 2023
1 parent a0c6da3 commit 7283797
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 7 deletions.
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
23.12.00
11 changes: 10 additions & 1 deletion ci/build_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 4 additions & 2 deletions ci/build_python_pypi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions conda/recipes/dask-cuda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'] %}

Expand All @@ -13,7 +13,7 @@ package:
version: {{ version }}

source:
git_url: ../../..
path: ../../..

build:
number: {{ GIT_DESCRIBE_NUMBER }}
Expand Down
1 change: 1 addition & 0 deletions dask_cuda/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
../VERSION
2 changes: 1 addition & 1 deletion dask_cuda/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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(
Expand Down
20 changes: 20 additions & 0 deletions dask_cuda/_version.py
Original file line number Diff line number Diff line change
@@ -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__ = ""
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down Expand Up @@ -123,6 +123,9 @@ filterwarnings = [
[tool.setuptools]
license-files = ["LICENSE"]

[tool.setuptools.dynamic]
version = {file = "dask_cuda/VERSION"}

[tool.setuptools.packages.find]
exclude = [
"docs",
Expand Down

0 comments on commit 7283797

Please sign in to comment.