From e6871d0d580666da939bcd34941c79e7d3da3abc Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Fri, 13 Oct 2023 14:47:10 -0700 Subject: [PATCH 01/14] Update versioning strategy --- ci/build_cpp.sh | 4 +++- ci/build_python.sh | 18 ++++++++++++++---- ci/build_wheel.sh | 9 +++++---- conda/recipes/cudf/meta.yaml | 2 +- conda/recipes/cudf_kafka/meta.yaml | 2 +- conda/recipes/custreamz/meta.yaml | 2 +- conda/recipes/dask-cudf/meta.yaml | 2 +- conda/recipes/libcudf/meta.yaml | 2 +- python/cudf/cudf/__init__.py | 3 +-- python/cudf/cudf/_version.py | 16 ++++++++++++++++ python/cudf/pyproject.toml | 5 ++++- python/cudf_kafka/cudf_kafka/__init__.py | 3 +++ python/cudf_kafka/cudf_kafka/_version.py | 16 ++++++++++++++++ python/cudf_kafka/pyproject.toml | 5 ++++- python/custreamz/custreamz/__init__.py | 3 ++- python/custreamz/custreamz/_version.py | 16 ++++++++++++++++ python/custreamz/pyproject.toml | 5 ++++- python/dask_cudf/dask_cudf/__init__.py | 3 +-- python/dask_cudf/dask_cudf/_version.py | 16 ++++++++++++++++ python/dask_cudf/pyproject.toml | 6 ++++-- 20 files changed, 114 insertions(+), 24 deletions(-) create mode 100644 python/cudf/cudf/_version.py create mode 100644 python/cudf_kafka/cudf_kafka/_version.py create mode 100644 python/custreamz/custreamz/_version.py create mode 100644 python/dask_cudf/dask_cudf/_version.py diff --git a/ci/build_cpp.sh b/ci/build_cpp.sh index 8b757fecf5a..f1ad8ee7778 100755 --- a/ci/build_cpp.sh +++ b/ci/build_cpp.sh @@ -9,10 +9,12 @@ export CMAKE_GENERATOR=Ninja rapids-print-env +version=$(rapids-generate-version) + rapids-logger "Begin cpp build" # With boa installed conda build forward to boa -rapids-conda-retry mambabuild \ +RAPIDS_PACKAGE_VERSION=${version} rapids-conda-retry mambabuild \ conda/recipes/libcudf rapids-upload-conda-to-s3 cpp diff --git a/ci/build_python.sh b/ci/build_python.sh index 61f160b25f5..9ccb224e9b7 100755 --- a/ci/build_python.sh +++ b/ci/build_python.sh @@ -9,6 +9,16 @@ export CMAKE_GENERATOR=Ninja rapids-print-env +package_dir="python" +version=$(rapids-generate-version) +commit=$(git rev-parse HEAD) + +for pkg in cudf dask_cudf cudf_kafka custreamz; do + version_file="${package_dir}/${package_name}/_version.py" + sed -i "/^__version__/ s/= .*/= ${version}/g" ${version_file} + sed -i "/^__git_commit__/ s/= .*/= \"${commit}\"/g" ${version_file} +done + rapids-logger "Begin py build" CPP_CHANNEL=$(rapids-download-conda-from-s3 cpp) @@ -16,24 +26,24 @@ CPP_CHANNEL=$(rapids-download-conda-from-s3 cpp) # TODO: Remove `--no-test` flag once importing on a CPU # node works correctly # With boa installed conda build forwards to the boa builder -rapids-conda-retry mambabuild \ +RAPIDS_PACKAGE_VERSION=${version} rapids-conda-retry mambabuild \ --no-test \ --channel "${CPP_CHANNEL}" \ conda/recipes/cudf -rapids-conda-retry mambabuild \ +RAPIDS_PACKAGE_VERSION=${version} rapids-conda-retry mambabuild \ --no-test \ --channel "${CPP_CHANNEL}" \ --channel "${RAPIDS_CONDA_BLD_OUTPUT_DIR}" \ conda/recipes/dask-cudf -rapids-conda-retry mambabuild \ +RAPIDS_PACKAGE_VERSION=${version} rapids-conda-retry mambabuild \ --no-test \ --channel "${CPP_CHANNEL}" \ --channel "${RAPIDS_CONDA_BLD_OUTPUT_DIR}" \ conda/recipes/cudf_kafka -rapids-conda-retry mambabuild \ +RAPIDS_PACKAGE_VERSION=${version} rapids-conda-retry mambabuild \ --no-test \ --channel "${CPP_CHANNEL}" \ --channel "${RAPIDS_CONDA_BLD_OUTPUT_DIR}" \ diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh index 06d0c3c7a56..3118fec010a 100755 --- a/ci/build_wheel.sh +++ b/ci/build_wheel.sh @@ -9,9 +9,8 @@ package_dir=$2 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) +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/= .*/= \"${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/cudf/meta.yaml b/conda/recipes/cudf/meta.yaml index 54b687faa69..668a5468ad2 100644 --- a/conda/recipes/cudf/meta.yaml +++ b/conda/recipes/cudf/meta.yaml @@ -1,6 +1,6 @@ # Copyright (c) 2018-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') %} {% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %} {% set py_version = environ['CONDA_PY'] %} {% set cuda_version = '.'.join(environ['RAPIDS_CUDA_VERSION'].split('.')[:2]) %} diff --git a/conda/recipes/cudf_kafka/meta.yaml b/conda/recipes/cudf_kafka/meta.yaml index ec0cc402511..8d3e234a6bb 100644 --- a/conda/recipes/cudf_kafka/meta.yaml +++ b/conda/recipes/cudf_kafka/meta.yaml @@ -1,6 +1,6 @@ # Copyright (c) 2020-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') %} {% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %} {% set py_version = environ['CONDA_PY'] %} {% set cuda_version = '.'.join(environ['RAPIDS_CUDA_VERSION'].split('.')[:2]) %} diff --git a/conda/recipes/custreamz/meta.yaml b/conda/recipes/custreamz/meta.yaml index 233d51baf31..b153564fc9d 100644 --- a/conda/recipes/custreamz/meta.yaml +++ b/conda/recipes/custreamz/meta.yaml @@ -1,6 +1,6 @@ # Copyright (c) 2018-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') %} {% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %} {% set py_version = environ['CONDA_PY'] %} {% set cuda_version = '.'.join(environ['RAPIDS_CUDA_VERSION'].split('.')[:2]) %} diff --git a/conda/recipes/dask-cudf/meta.yaml b/conda/recipes/dask-cudf/meta.yaml index 4c8af071074..fb01388d962 100644 --- a/conda/recipes/dask-cudf/meta.yaml +++ b/conda/recipes/dask-cudf/meta.yaml @@ -1,6 +1,6 @@ # Copyright (c) 2018-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') %} {% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %} {% set py_version = environ['CONDA_PY'] %} {% set cuda_version = '.'.join(environ['RAPIDS_CUDA_VERSION'].split('.')[:2]) %} diff --git a/conda/recipes/libcudf/meta.yaml b/conda/recipes/libcudf/meta.yaml index 28357f0d96d..d6ed233a543 100644 --- a/conda/recipes/libcudf/meta.yaml +++ b/conda/recipes/libcudf/meta.yaml @@ -1,6 +1,6 @@ # Copyright (c) 2018-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') %} {% 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/python/cudf/cudf/__init__.py b/python/cudf/cudf/__init__.py index 8d25d478676..02274a5fdd1 100644 --- a/python/cudf/cudf/__init__.py +++ b/python/cudf/cudf/__init__.py @@ -17,6 +17,7 @@ from rmm.allocators.numba import RMMNumbaManager from cudf import api, core, datasets, testing +from cudf._version import __git_commit__, __version__ from cudf.api.extensions import ( register_dataframe_accessor, register_index_accessor, @@ -99,8 +100,6 @@ rmm.register_reinitialize_hook(clear_cache) -__version__ = "23.12.00" - __all__ = [ "BaseIndex", "CategoricalDtype", diff --git a/python/cudf/cudf/_version.py b/python/cudf/cudf/_version.py new file mode 100644 index 00000000000..bdafc7e4570 --- /dev/null +++ b/python/cudf/cudf/_version.py @@ -0,0 +1,16 @@ +# 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__ = "23.12.00" +__git_commit__ = "" diff --git a/python/cudf/pyproject.toml b/python/cudf/pyproject.toml index 39a8dca0267..e8d73c1afd3 100644 --- a/python/cudf/pyproject.toml +++ b/python/cudf/pyproject.toml @@ -17,7 +17,7 @@ requires = [ [project] name = "cudf" -version = "23.12.00" +dynamic = ["version"] description = "cuDF - GPU Dataframe" readme = { file = "README.md", content-type = "text/markdown" } authors = [ @@ -78,6 +78,9 @@ Documentation = "https://docs.rapids.ai/api/cudf/stable/" [tool.setuptools] license-files = ["LICENSE"] +[tool.setuptools.dynamic] +version = {attr = "cudf._version.__version__"} + [tool.isort] line_length = 79 multi_line_output = 3 diff --git a/python/cudf_kafka/cudf_kafka/__init__.py b/python/cudf_kafka/cudf_kafka/__init__.py index e69de29bb2d..43a91af9cf5 100644 --- a/python/cudf_kafka/cudf_kafka/__init__.py +++ b/python/cudf_kafka/cudf_kafka/__init__.py @@ -0,0 +1,3 @@ +# Copyright (c) 2020-2023, NVIDIA CORPORATION. + +from ._version import __git_commit__, __version__ diff --git a/python/cudf_kafka/cudf_kafka/_version.py b/python/cudf_kafka/cudf_kafka/_version.py new file mode 100644 index 00000000000..bdafc7e4570 --- /dev/null +++ b/python/cudf_kafka/cudf_kafka/_version.py @@ -0,0 +1,16 @@ +# 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__ = "23.12.00" +__git_commit__ = "" diff --git a/python/cudf_kafka/pyproject.toml b/python/cudf_kafka/pyproject.toml index 78a7a83ac3a..109596e5594 100644 --- a/python/cudf_kafka/pyproject.toml +++ b/python/cudf_kafka/pyproject.toml @@ -12,7 +12,7 @@ requires = [ [project] name = "cudf_kafka" -version = "23.12.00" +dynamic = ["version"] description = "cuDF Kafka Datasource" readme = { file = "README.md", content-type = "text/markdown" } authors = [ @@ -38,6 +38,9 @@ Documentation = "https://docs.rapids.ai/api/cudf/stable/" [tool.setuptools] license-files = ["LICENSE"] +[tool.setuptools.dynamic] +version = {attr = "cudf_kafka._version.__version__"} + [tool.isort] line_length = 79 multi_line_output = 3 diff --git a/python/custreamz/custreamz/__init__.py b/python/custreamz/custreamz/__init__.py index 52be76aab1f..3f11da14684 100644 --- a/python/custreamz/custreamz/__init__.py +++ b/python/custreamz/custreamz/__init__.py @@ -1,3 +1,4 @@ -# Copyright (c) 2020, NVIDIA CORPORATION. +# Copyright (c) 2020-2023, NVIDIA CORPORATION. +from ._version import __git_commit__, __version__ from .kafka import Consumer diff --git a/python/custreamz/custreamz/_version.py b/python/custreamz/custreamz/_version.py new file mode 100644 index 00000000000..bdafc7e4570 --- /dev/null +++ b/python/custreamz/custreamz/_version.py @@ -0,0 +1,16 @@ +# 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__ = "23.12.00" +__git_commit__ = "" diff --git a/python/custreamz/pyproject.toml b/python/custreamz/pyproject.toml index e6328ed045d..2a6498502d9 100644 --- a/python/custreamz/pyproject.toml +++ b/python/custreamz/pyproject.toml @@ -9,7 +9,7 @@ requires = [ [project] name = "custreamz" -version = "23.12.00" +dynamic = ["version"] description = "cuStreamz - GPU Accelerated Streaming" readme = { file = "README.md", content-type = "text/markdown" } authors = [ @@ -48,6 +48,9 @@ Homepage = "https://github.com/rapidsai/cudf" license-files = ["LICENSE"] zip-safe = false +[tool.setuptools.dynamic] +version = {attr = "custreamz._version.__version__"} + [tools.setuptools.packages.find] include = [ "custreamz", diff --git a/python/dask_cudf/dask_cudf/__init__.py b/python/dask_cudf/dask_cudf/__init__.py index 7c81f5da481..c152a9e6a81 100644 --- a/python/dask_cudf/dask_cudf/__init__.py +++ b/python/dask_cudf/dask_cudf/__init__.py @@ -5,6 +5,7 @@ import cudf from . import backends +from ._version import __git_commit__, __version__ from .core import DataFrame, Series, concat, from_cudf, from_dask_dataframe from .groupby import groupby_agg from .io import read_csv, read_json, read_orc, read_text, to_orc @@ -14,8 +15,6 @@ except ImportError: pass -__version__ = "23.12.00" - __all__ = [ "DataFrame", "Series", diff --git a/python/dask_cudf/dask_cudf/_version.py b/python/dask_cudf/dask_cudf/_version.py new file mode 100644 index 00000000000..bdafc7e4570 --- /dev/null +++ b/python/dask_cudf/dask_cudf/_version.py @@ -0,0 +1,16 @@ +# 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__ = "23.12.00" +__git_commit__ = "" diff --git a/python/dask_cudf/pyproject.toml b/python/dask_cudf/pyproject.toml index 0a6e776e0f9..9f3765749eb 100644 --- a/python/dask_cudf/pyproject.toml +++ b/python/dask_cudf/pyproject.toml @@ -9,7 +9,7 @@ requires = [ [project] name = "dask_cudf" -version = "23.12.00" +dynamic = ["version", "entry-points"] description = "Utilities for Dask and cuDF interactions" readme = { file = "README.md", content-type = "text/markdown" } authors = [ @@ -35,7 +35,6 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", ] -dynamic = ["entry-points"] [project.optional-dependencies] test = [ @@ -52,6 +51,9 @@ Homepage = "https://github.com/rapidsai/cudf" [tool.setuptools] license-files = ["LICENSE"] +[tool.setuptools.dynamic] +version = {attr = "dask_cudf._version.__version__"} + [tool.isort] line_length = 79 multi_line_output = 3 From e03e1004e52f51af0e93e9d0df2a9056122bc27e Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Fri, 13 Oct 2023 14:57:41 -0700 Subject: [PATCH 02/14] Switch git_url to path --- conda/recipes/cudf/meta.yaml | 2 +- conda/recipes/cudf_kafka/meta.yaml | 2 +- conda/recipes/custreamz/meta.yaml | 2 +- conda/recipes/dask-cudf/meta.yaml | 2 +- conda/recipes/libcudf/meta.yaml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/conda/recipes/cudf/meta.yaml b/conda/recipes/cudf/meta.yaml index 668a5468ad2..687f459546f 100644 --- a/conda/recipes/cudf/meta.yaml +++ b/conda/recipes/cudf/meta.yaml @@ -12,7 +12,7 @@ package: version: {{ version }} source: - git_url: ../../.. + path: ../../.. build: number: {{ GIT_DESCRIBE_NUMBER }} diff --git a/conda/recipes/cudf_kafka/meta.yaml b/conda/recipes/cudf_kafka/meta.yaml index 8d3e234a6bb..c8ab03cba5d 100644 --- a/conda/recipes/cudf_kafka/meta.yaml +++ b/conda/recipes/cudf_kafka/meta.yaml @@ -12,7 +12,7 @@ package: version: {{ version }} source: - git_url: ../../.. + path: ../../.. build: number: {{ GIT_DESCRIBE_NUMBER }} diff --git a/conda/recipes/custreamz/meta.yaml b/conda/recipes/custreamz/meta.yaml index b153564fc9d..c2ca6ac1206 100644 --- a/conda/recipes/custreamz/meta.yaml +++ b/conda/recipes/custreamz/meta.yaml @@ -12,7 +12,7 @@ package: version: {{ version }} source: - git_url: ../../.. + path: ../../.. build: number: {{ GIT_DESCRIBE_NUMBER }} diff --git a/conda/recipes/dask-cudf/meta.yaml b/conda/recipes/dask-cudf/meta.yaml index fb01388d962..dd92df32ef8 100644 --- a/conda/recipes/dask-cudf/meta.yaml +++ b/conda/recipes/dask-cudf/meta.yaml @@ -12,7 +12,7 @@ package: version: {{ version }} source: - git_url: ../../.. + path: ../../.. build: number: {{ GIT_DESCRIBE_NUMBER }} diff --git a/conda/recipes/libcudf/meta.yaml b/conda/recipes/libcudf/meta.yaml index d6ed233a543..6082600b6cb 100644 --- a/conda/recipes/libcudf/meta.yaml +++ b/conda/recipes/libcudf/meta.yaml @@ -11,7 +11,7 @@ package: name: libcudf-split source: - git_url: ../../.. + path: ../../.. build: script_env: From 2cbe2b4002e8fd32ad88e6245e25d2de3c4378fd Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Fri, 13 Oct 2023 15:25:14 -0700 Subject: [PATCH 03/14] Fix typo --- ci/build_python.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/build_python.sh b/ci/build_python.sh index 9ccb224e9b7..e0f22446152 100755 --- a/ci/build_python.sh +++ b/ci/build_python.sh @@ -13,7 +13,7 @@ package_dir="python" version=$(rapids-generate-version) commit=$(git rev-parse HEAD) -for pkg in cudf dask_cudf cudf_kafka custreamz; do +for package_name in cudf dask_cudf cudf_kafka custreamz; do version_file="${package_dir}/${package_name}/_version.py" sed -i "/^__version__/ s/= .*/= ${version}/g" ${version_file} sed -i "/^__git_commit__/ s/= .*/= \"${commit}\"/g" ${version_file} From 0ebef749c9e9a2bf3dad1bd0be2130723e9e1c47 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Mon, 16 Oct 2023 15:37:16 -0700 Subject: [PATCH 04/14] Update update-version.sh --- ci/release/update-version.sh | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/ci/release/update-version.sh b/ci/release/update-version.sh index 5e735a71994..a563c52b87a 100755 --- a/ci/release/update-version.sh +++ b/ci/release/update-version.sh @@ -51,16 +51,10 @@ sed_runner 's/'"VERSION ${CURRENT_SHORT_TAG}.*"'/'"VERSION ${NEXT_FULL_TAG}"'/g' sed_runner 's/'"VERSION ${CURRENT_SHORT_TAG}.*"'/'"VERSION ${NEXT_FULL_TAG}"'/g' java/src/main/native/CMakeLists.txt # Python __init__.py updates -sed_runner "s/__version__ = .*/__version__ = \"${NEXT_FULL_TAG}\"/g" python/cudf/cudf/__init__.py -sed_runner "s/__version__ = .*/__version__ = \"${NEXT_FULL_TAG}\"/g" python/dask_cudf/dask_cudf/__init__.py -sed_runner "s/__version__ = .*/__version__ = \"${NEXT_FULL_TAG}\"/g" python/cudf_kafka/cudf_kafka/__init__.py -sed_runner "s/__version__ = .*/__version__ = \"${NEXT_FULL_TAG}\"/g" python/custreamz/custreamz/__init__.py - -# Python pyproject.toml updates -sed_runner "s/^version = .*/version = \"${NEXT_FULL_TAG}\"/g" python/cudf/pyproject.toml -sed_runner "s/^version = .*/version = \"${NEXT_FULL_TAG}\"/g" python/dask_cudf/pyproject.toml -sed_runner "s/^version = .*/version = \"${NEXT_FULL_TAG}\"/g" python/cudf_kafka/pyproject.toml -sed_runner "s/^version = .*/version = \"${NEXT_FULL_TAG}\"/g" python/custreamz/pyproject.toml +sed_runner "/__version__ / s/= .*/= \"${NEXT_FULL_TAG}\"/g" python/cudf/cudf/_version.py +sed_runner "/__version__ / s/= .*/= \"${NEXT_FULL_TAG}\"/g" python/dask_cudf/dask_cudf/_version.py +sed_runner "/__version__ / s/= .*/= \"${NEXT_FULL_TAG}\"/g" python/cudf_kafka/cudf_kafka/_version.py +sed_runner "/__version__ / s/= .*/= \"${NEXT_FULL_TAG}\"/g" python/custreamz/custreamz/_version.py # Wheel testing script sed_runner "s/branch-.*/branch-${NEXT_SHORT_TAG}/g" ci/test_wheel_dask_cudf.sh From 360633a1ddd177247008fdb208627ae5af98126b Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Mon, 16 Oct 2023 17:33:57 -0700 Subject: [PATCH 05/14] Typo --- 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 a563c52b87a..401157b923e 100755 --- a/ci/release/update-version.sh +++ b/ci/release/update-version.sh @@ -50,7 +50,7 @@ sed_runner 's/'"VERSION ${CURRENT_SHORT_TAG}.*"'/'"VERSION ${NEXT_FULL_TAG}"'/g' # cpp cudf_jni update sed_runner 's/'"VERSION ${CURRENT_SHORT_TAG}.*"'/'"VERSION ${NEXT_FULL_TAG}"'/g' java/src/main/native/CMakeLists.txt -# Python __init__.py updates +# Python _version.py updates sed_runner "/__version__ / s/= .*/= \"${NEXT_FULL_TAG}\"/g" python/cudf/cudf/_version.py sed_runner "/__version__ / s/= .*/= \"${NEXT_FULL_TAG}\"/g" python/dask_cudf/dask_cudf/_version.py sed_runner "/__version__ / s/= .*/= \"${NEXT_FULL_TAG}\"/g" python/cudf_kafka/cudf_kafka/_version.py From 1abd4ca7e64197eafb354c1c60399fc15860e6dd Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Tue, 17 Oct 2023 10:51:34 -0700 Subject: [PATCH 06/14] Fix path --- ci/build_python.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/build_python.sh b/ci/build_python.sh index e0f22446152..edc89de6358 100755 --- a/ci/build_python.sh +++ b/ci/build_python.sh @@ -14,7 +14,7 @@ version=$(rapids-generate-version) commit=$(git rev-parse HEAD) for package_name in cudf dask_cudf cudf_kafka custreamz; do - version_file="${package_dir}/${package_name}/_version.py" + version_file="${package_dir}/${package_name}/${package_name}/_version.py" sed -i "/^__version__/ s/= .*/= ${version}/g" ${version_file} sed -i "/^__git_commit__/ s/= .*/= \"${commit}\"/g" ${version_file} done From 11184540ae6eeb8306178cde45902e6552120131 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Tue, 17 Oct 2023 13:43:10 -0700 Subject: [PATCH 07/14] Require package version env var in conda builds --- conda/recipes/cudf/meta.yaml | 2 +- conda/recipes/cudf_kafka/meta.yaml | 2 +- conda/recipes/custreamz/meta.yaml | 2 +- conda/recipes/dask-cudf/meta.yaml | 2 +- conda/recipes/libcudf/meta.yaml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/conda/recipes/cudf/meta.yaml b/conda/recipes/cudf/meta.yaml index 687f459546f..a88b34c59e0 100644 --- a/conda/recipes/cudf/meta.yaml +++ b/conda/recipes/cudf/meta.yaml @@ -1,6 +1,6 @@ # Copyright (c) 2018-2023, NVIDIA CORPORATION. -{% set version = environ.get('RAPIDS_PACKAGE_VERSION', '0.0.0.dev').strip('"').lstrip('v') %} +{% set version = environ['RAPIDS_PACKAGE_VERSION'].strip('"').lstrip('v') %} {% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %} {% set py_version = environ['CONDA_PY'] %} {% set cuda_version = '.'.join(environ['RAPIDS_CUDA_VERSION'].split('.')[:2]) %} diff --git a/conda/recipes/cudf_kafka/meta.yaml b/conda/recipes/cudf_kafka/meta.yaml index c8ab03cba5d..fb5ed4beaa1 100644 --- a/conda/recipes/cudf_kafka/meta.yaml +++ b/conda/recipes/cudf_kafka/meta.yaml @@ -1,6 +1,6 @@ # Copyright (c) 2020-2023, NVIDIA CORPORATION. -{% set version = environ.get('RAPIDS_PACKAGE_VERSION', '0.0.0.dev').strip('"').lstrip('v') %} +{% set version = environ['RAPIDS_PACKAGE_VERSION'].strip('"').lstrip('v') %} {% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %} {% set py_version = environ['CONDA_PY'] %} {% set cuda_version = '.'.join(environ['RAPIDS_CUDA_VERSION'].split('.')[:2]) %} diff --git a/conda/recipes/custreamz/meta.yaml b/conda/recipes/custreamz/meta.yaml index c2ca6ac1206..f3c22cecf2c 100644 --- a/conda/recipes/custreamz/meta.yaml +++ b/conda/recipes/custreamz/meta.yaml @@ -1,6 +1,6 @@ # Copyright (c) 2018-2023, NVIDIA CORPORATION. -{% set version = environ.get('RAPIDS_PACKAGE_VERSION', '0.0.0.dev').strip('"').lstrip('v') %} +{% set version = environ['RAPIDS_PACKAGE_VERSION'].strip('"').lstrip('v') %} {% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %} {% set py_version = environ['CONDA_PY'] %} {% set cuda_version = '.'.join(environ['RAPIDS_CUDA_VERSION'].split('.')[:2]) %} diff --git a/conda/recipes/dask-cudf/meta.yaml b/conda/recipes/dask-cudf/meta.yaml index dd92df32ef8..f175c8716b0 100644 --- a/conda/recipes/dask-cudf/meta.yaml +++ b/conda/recipes/dask-cudf/meta.yaml @@ -1,6 +1,6 @@ # Copyright (c) 2018-2023, NVIDIA CORPORATION. -{% set version = environ.get('RAPIDS_PACKAGE_VERSION', '0.0.0.dev').strip('"').lstrip('v') %} +{% set version = environ['RAPIDS_PACKAGE_VERSION'].strip('"').lstrip('v') %} {% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %} {% set py_version = environ['CONDA_PY'] %} {% set cuda_version = '.'.join(environ['RAPIDS_CUDA_VERSION'].split('.')[:2]) %} diff --git a/conda/recipes/libcudf/meta.yaml b/conda/recipes/libcudf/meta.yaml index 6082600b6cb..e200035bbd1 100644 --- a/conda/recipes/libcudf/meta.yaml +++ b/conda/recipes/libcudf/meta.yaml @@ -1,6 +1,6 @@ # Copyright (c) 2018-2023, NVIDIA CORPORATION. -{% set version = environ.get('RAPIDS_PACKAGE_VERSION', '0.0.0.dev').strip('"').lstrip('v') %} +{% set version = environ['RAPIDS_PACKAGE_VERSION'].strip('"').lstrip('v') %} {% 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 8dfe66e3a0945a160acb9c17019d4d433313f6f2 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Tue, 17 Oct 2023 14:31:44 -0700 Subject: [PATCH 08/14] Fix one more path --- ci/build_wheel.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh index 3118fec010a..06cb5fdfe27 100755 --- a/ci/build_wheel.sh +++ b/ci/build_wheel.sh @@ -20,7 +20,7 @@ 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" +version_file="${package_dir}/${package_name}/${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} From 94461f522ac4a638366309c42569878fda7d5706 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Tue, 17 Oct 2023 14:50:37 -0700 Subject: [PATCH 09/14] Revert "Fix one more path" This reverts commit 8dfe66e3a0945a160acb9c17019d4d433313f6f2. --- ci/build_wheel.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh index 06cb5fdfe27..3118fec010a 100755 --- a/ci/build_wheel.sh +++ b/ci/build_wheel.sh @@ -20,7 +20,7 @@ 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}/${package_name}/_version.py" +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} From a83d038843ddd21562434d270220f28adc544a36 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Thu, 19 Oct 2023 14:45:36 -0700 Subject: [PATCH 10/14] Anchor the regex --- ci/release/update-version.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ci/release/update-version.sh b/ci/release/update-version.sh index 0352da507fc..3fd809576e2 100755 --- a/ci/release/update-version.sh +++ b/ci/release/update-version.sh @@ -51,10 +51,10 @@ sed_runner 's/'"VERSION ${CURRENT_SHORT_TAG}.*"'/'"VERSION ${NEXT_FULL_TAG}"'/g' sed_runner 's/'"VERSION ${CURRENT_SHORT_TAG}.*"'/'"VERSION ${NEXT_FULL_TAG}"'/g' java/src/main/native/CMakeLists.txt # Python _version.py updates -sed_runner "/__version__ / s/= .*/= \"${NEXT_FULL_TAG}\"/g" python/cudf/cudf/_version.py -sed_runner "/__version__ / s/= .*/= \"${NEXT_FULL_TAG}\"/g" python/dask_cudf/dask_cudf/_version.py -sed_runner "/__version__ / s/= .*/= \"${NEXT_FULL_TAG}\"/g" python/cudf_kafka/cudf_kafka/_version.py -sed_runner "/__version__ / s/= .*/= \"${NEXT_FULL_TAG}\"/g" python/custreamz/custreamz/_version.py +sed_runner "/^__version__ / s/= .*/= \"${NEXT_FULL_TAG}\"/g" python/cudf/cudf/_version.py +sed_runner "/^__version__ / s/= .*/= \"${NEXT_FULL_TAG}\"/g" python/dask_cudf/dask_cudf/_version.py +sed_runner "/^__version__ / s/= .*/= \"${NEXT_FULL_TAG}\"/g" python/cudf_kafka/cudf_kafka/_version.py +sed_runner "/^__version__ / s/= .*/= \"${NEXT_FULL_TAG}\"/g" python/custreamz/custreamz/_version.py # Wheel testing script sed_runner "s/branch-.*/branch-${NEXT_SHORT_TAG}/g" ci/test_wheel_dask_cudf.sh From 063eb95731437b3c4aa0205646d727795f0901b3 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Tue, 24 Oct 2023 11:55:00 -0700 Subject: [PATCH 11/14] Switch to VERSION file --- VERSION | 1 + ci/build_python.sh | 5 ++--- ci/build_wheel.sh | 5 ++--- python/cudf/cudf/VERSION | 1 + python/cudf/cudf/_version.py | 5 ++++- python/cudf/pyproject.toml | 2 +- python/cudf/setup.py | 4 +++- python/cudf_kafka/cudf_kafka/VERSION | 1 + python/cudf_kafka/cudf_kafka/_version.py | 5 ++++- python/cudf_kafka/pyproject.toml | 2 +- python/cudf_kafka/setup.py | 2 +- python/custreamz/custreamz/VERSION | 1 + python/custreamz/custreamz/_version.py | 5 ++++- python/custreamz/pyproject.toml | 2 +- python/custreamz/setup.py | 4 +++- python/dask_cudf/dask_cudf/VERSION | 1 + python/dask_cudf/dask_cudf/_version.py | 5 ++++- python/dask_cudf/pyproject.toml | 2 +- python/dask_cudf/setup.py | 5 ++++- 19 files changed, 40 insertions(+), 18 deletions(-) create mode 100644 VERSION create mode 120000 python/cudf/cudf/VERSION create mode 120000 python/cudf_kafka/cudf_kafka/VERSION create mode 120000 python/custreamz/custreamz/VERSION create mode 120000 python/dask_cudf/dask_cudf/VERSION diff --git a/VERSION b/VERSION new file mode 100644 index 00000000000..a193fff41e8 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +23.12.00 diff --git a/ci/build_python.sh b/ci/build_python.sh index edc89de6358..9b04a9676e5 100755 --- a/ci/build_python.sh +++ b/ci/build_python.sh @@ -13,10 +13,9 @@ package_dir="python" version=$(rapids-generate-version) commit=$(git rev-parse HEAD) +echo "${version}" | tr -d '"' > VERSION for package_name in cudf dask_cudf cudf_kafka custreamz; do - version_file="${package_dir}/${package_name}/${package_name}/_version.py" - sed -i "/^__version__/ s/= .*/= ${version}/g" ${version_file} - sed -i "/^__git_commit__/ s/= .*/= \"${commit}\"/g" ${version_file} + sed -i "/^__git_commit__/ s/= .*/= \"${commit}\"/g" ${package_dir}/${package_name}/${package_name}/_version.py done rapids-logger "Begin py build" diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh index 3118fec010a..ac11ca37e84 100755 --- a/ci/build_wheel.sh +++ b/ci/build_wheel.sh @@ -20,11 +20,10 @@ 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/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/= .*/= \"${commit}\"/g" ${version_file} +echo "${version}" | tr -d '"' > VERSION +sed -i "/^__git_commit__/ s/= .*/= \"${commit}\"/g" "${package_dir}/${package_name}/_version.py" # 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/python/cudf/cudf/VERSION b/python/cudf/cudf/VERSION new file mode 120000 index 00000000000..d62dc733efd --- /dev/null +++ b/python/cudf/cudf/VERSION @@ -0,0 +1 @@ +../../../VERSION \ No newline at end of file diff --git a/python/cudf/cudf/_version.py b/python/cudf/cudf/_version.py index bdafc7e4570..f38ca7adda1 100644 --- a/python/cudf/cudf/_version.py +++ b/python/cudf/cudf/_version.py @@ -12,5 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -__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__ = "" diff --git a/python/cudf/pyproject.toml b/python/cudf/pyproject.toml index 2919b07a416..bdad830883a 100644 --- a/python/cudf/pyproject.toml +++ b/python/cudf/pyproject.toml @@ -79,7 +79,7 @@ Documentation = "https://docs.rapids.ai/api/cudf/stable/" license-files = ["LICENSE"] [tool.setuptools.dynamic] -version = {attr = "cudf._version.__version__"} +version = {file = "cudf/VERSION"} [tool.isort] line_length = 79 diff --git a/python/cudf/setup.py b/python/cudf/setup.py index 96b91b4ccc0..984cd63a7c9 100644 --- a/python/cudf/setup.py +++ b/python/cudf/setup.py @@ -6,6 +6,8 @@ packages = find_packages(include=["cudf*", "udf_cpp*"]) setup( packages=packages, - package_data={key: ["*.pxd", "*.hpp", "*.cuh"] for key in packages}, + package_data={ + key: ["VERSION", "*.pxd", "*.hpp", "*.cuh"] for key in packages + }, zip_safe=False, ) diff --git a/python/cudf_kafka/cudf_kafka/VERSION b/python/cudf_kafka/cudf_kafka/VERSION new file mode 120000 index 00000000000..d62dc733efd --- /dev/null +++ b/python/cudf_kafka/cudf_kafka/VERSION @@ -0,0 +1 @@ +../../../VERSION \ No newline at end of file diff --git a/python/cudf_kafka/cudf_kafka/_version.py b/python/cudf_kafka/cudf_kafka/_version.py index bdafc7e4570..f38ca7adda1 100644 --- a/python/cudf_kafka/cudf_kafka/_version.py +++ b/python/cudf_kafka/cudf_kafka/_version.py @@ -12,5 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -__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__ = "" diff --git a/python/cudf_kafka/pyproject.toml b/python/cudf_kafka/pyproject.toml index 949016b819e..e9a11ff3186 100644 --- a/python/cudf_kafka/pyproject.toml +++ b/python/cudf_kafka/pyproject.toml @@ -39,7 +39,7 @@ Documentation = "https://docs.rapids.ai/api/cudf/stable/" license-files = ["LICENSE"] [tool.setuptools.dynamic] -version = {attr = "cudf_kafka._version.__version__"} +version = {file = "cudf_kafka/VERSION"} [tool.isort] line_length = 79 diff --git a/python/cudf_kafka/setup.py b/python/cudf_kafka/setup.py index d955d95858a..6f3909d4528 100644 --- a/python/cudf_kafka/setup.py +++ b/python/cudf_kafka/setup.py @@ -91,6 +91,6 @@ ), ), packages=packages, - package_data={key: ["*.pxd"] for key in packages}, + package_data={key: ["VERSION", "*.pxd"] for key in packages}, zip_safe=False, ) diff --git a/python/custreamz/custreamz/VERSION b/python/custreamz/custreamz/VERSION new file mode 120000 index 00000000000..d62dc733efd --- /dev/null +++ b/python/custreamz/custreamz/VERSION @@ -0,0 +1 @@ +../../../VERSION \ No newline at end of file diff --git a/python/custreamz/custreamz/_version.py b/python/custreamz/custreamz/_version.py index bdafc7e4570..f38ca7adda1 100644 --- a/python/custreamz/custreamz/_version.py +++ b/python/custreamz/custreamz/_version.py @@ -12,5 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -__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__ = "" diff --git a/python/custreamz/pyproject.toml b/python/custreamz/pyproject.toml index 2a6498502d9..2d0059d5aa9 100644 --- a/python/custreamz/pyproject.toml +++ b/python/custreamz/pyproject.toml @@ -49,7 +49,7 @@ license-files = ["LICENSE"] zip-safe = false [tool.setuptools.dynamic] -version = {attr = "custreamz._version.__version__"} +version = {file = "custreamz/VERSION"} [tools.setuptools.packages.find] include = [ diff --git a/python/custreamz/setup.py b/python/custreamz/setup.py index 2fa45ac8087..04943bf88e2 100644 --- a/python/custreamz/setup.py +++ b/python/custreamz/setup.py @@ -2,4 +2,6 @@ from setuptools import setup -setup() +setup( + package_data={"custreamz": ["VERSION"]}, +) diff --git a/python/dask_cudf/dask_cudf/VERSION b/python/dask_cudf/dask_cudf/VERSION new file mode 120000 index 00000000000..d62dc733efd --- /dev/null +++ b/python/dask_cudf/dask_cudf/VERSION @@ -0,0 +1 @@ +../../../VERSION \ No newline at end of file diff --git a/python/dask_cudf/dask_cudf/_version.py b/python/dask_cudf/dask_cudf/_version.py index bdafc7e4570..f38ca7adda1 100644 --- a/python/dask_cudf/dask_cudf/_version.py +++ b/python/dask_cudf/dask_cudf/_version.py @@ -12,5 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -__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__ = "" diff --git a/python/dask_cudf/pyproject.toml b/python/dask_cudf/pyproject.toml index 9f3765749eb..bf97c584ef4 100644 --- a/python/dask_cudf/pyproject.toml +++ b/python/dask_cudf/pyproject.toml @@ -52,7 +52,7 @@ Homepage = "https://github.com/rapidsai/cudf" license-files = ["LICENSE"] [tool.setuptools.dynamic] -version = {attr = "dask_cudf._version.__version__"} +version = {file = "dask_cudf/VERSION"} [tool.isort] line_length = 79 diff --git a/python/dask_cudf/setup.py b/python/dask_cudf/setup.py index 3fa0f257834..c6ce219d32f 100644 --- a/python/dask_cudf/setup.py +++ b/python/dask_cudf/setup.py @@ -2,9 +2,12 @@ from setuptools import find_packages, setup +packages = find_packages(exclude=["tests", "tests.*"]) + setup( include_package_data=True, - packages=find_packages(exclude=["tests", "tests.*"]), + packages=packages, + package_data={key: ["VERSION"] for key in packages}, entry_points={ "dask.dataframe.backends": [ "cudf = dask_cudf.backends:CudfBackendEntrypoint", From 19125a6fa86a2f3729b3fba906de42911b0c2093 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Tue, 24 Oct 2023 12:03:06 -0700 Subject: [PATCH 12/14] update-version.sh --- ci/release/update-version.sh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ci/release/update-version.sh b/ci/release/update-version.sh index 3fd809576e2..00a56071442 100755 --- a/ci/release/update-version.sh +++ b/ci/release/update-version.sh @@ -50,11 +50,8 @@ sed_runner 's/'"VERSION ${CURRENT_SHORT_TAG}.*"'/'"VERSION ${NEXT_FULL_TAG}"'/g' # cpp cudf_jni update sed_runner 's/'"VERSION ${CURRENT_SHORT_TAG}.*"'/'"VERSION ${NEXT_FULL_TAG}"'/g' java/src/main/native/CMakeLists.txt -# Python _version.py updates -sed_runner "/^__version__ / s/= .*/= \"${NEXT_FULL_TAG}\"/g" python/cudf/cudf/_version.py -sed_runner "/^__version__ / s/= .*/= \"${NEXT_FULL_TAG}\"/g" python/dask_cudf/dask_cudf/_version.py -sed_runner "/^__version__ / s/= .*/= \"${NEXT_FULL_TAG}\"/g" python/cudf_kafka/cudf_kafka/_version.py -sed_runner "/^__version__ / s/= .*/= \"${NEXT_FULL_TAG}\"/g" python/custreamz/custreamz/_version.py +# Centralized version file update +echo "${NEXT_FULL_TAG}" | tr -d '"' > VERSION # Wheel testing script sed_runner "s/branch-.*/branch-${NEXT_SHORT_TAG}/g" ci/test_wheel_dask_cudf.sh From 7c4436216ccf069db93c06ad00c01d8012dd8347 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Thu, 26 Oct 2023 11:29:37 -0700 Subject: [PATCH 13/14] Switch to using importlib.resources --- python/cudf/cudf/_version.py | 7 ++++--- python/cudf_kafka/cudf_kafka/_version.py | 10 +++++++--- python/custreamz/custreamz/_version.py | 10 +++++++--- python/dask_cudf/dask_cudf/_version.py | 10 +++++++--- 4 files changed, 25 insertions(+), 12 deletions(-) diff --git a/python/cudf/cudf/_version.py b/python/cudf/cudf/_version.py index f38ca7adda1..ecf6ddd8e3b 100644 --- a/python/cudf/cudf/_version.py +++ b/python/cudf/cudf/_version.py @@ -12,8 +12,9 @@ # See the License for the specific language governing permissions and # 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("cudf").joinpath("VERSION").read_text().strip() +) __git_commit__ = "" diff --git a/python/cudf_kafka/cudf_kafka/_version.py b/python/cudf_kafka/cudf_kafka/_version.py index f38ca7adda1..5adab566da0 100644 --- a/python/cudf_kafka/cudf_kafka/_version.py +++ b/python/cudf_kafka/cudf_kafka/_version.py @@ -12,8 +12,12 @@ # See the License for the specific language governing permissions and # 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("cudf_kafka") + .joinpath("VERSION") + .read_text() + .strip() +) __git_commit__ = "" diff --git a/python/custreamz/custreamz/_version.py b/python/custreamz/custreamz/_version.py index f38ca7adda1..0f545f95f2b 100644 --- a/python/custreamz/custreamz/_version.py +++ b/python/custreamz/custreamz/_version.py @@ -12,8 +12,12 @@ # See the License for the specific language governing permissions and # 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("custreamz") + .joinpath("VERSION") + .read_text() + .strip() +) __git_commit__ = "" diff --git a/python/dask_cudf/dask_cudf/_version.py b/python/dask_cudf/dask_cudf/_version.py index f38ca7adda1..0dd62854a4e 100644 --- a/python/dask_cudf/dask_cudf/_version.py +++ b/python/dask_cudf/dask_cudf/_version.py @@ -12,8 +12,12 @@ # See the License for the specific language governing permissions and # 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("dask_cudf") + .joinpath("VERSION") + .read_text() + .strip() +) __git_commit__ = "" From 084fc4704857e6138530e09707ef16791c8ddd12 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Mon, 30 Oct 2023 10:30:13 -0700 Subject: [PATCH 14/14] Remove now unnecessary quote stripping --- ci/build_python.sh | 2 +- ci/build_wheel.sh | 2 +- ci/release/update-version.sh | 2 +- conda/recipes/cudf/meta.yaml | 2 +- conda/recipes/cudf_kafka/meta.yaml | 2 +- conda/recipes/custreamz/meta.yaml | 2 +- conda/recipes/dask-cudf/meta.yaml | 2 +- conda/recipes/libcudf/meta.yaml | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ci/build_python.sh b/ci/build_python.sh index 9b04a9676e5..32fe7b6b3ce 100755 --- a/ci/build_python.sh +++ b/ci/build_python.sh @@ -13,7 +13,7 @@ package_dir="python" version=$(rapids-generate-version) commit=$(git rev-parse HEAD) -echo "${version}" | tr -d '"' > VERSION +echo "${version}" > VERSION for package_name in cudf dask_cudf cudf_kafka custreamz; do sed -i "/^__git_commit__/ s/= .*/= \"${commit}\"/g" ${package_dir}/${package_name}/${package_name}/_version.py done diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh index ac11ca37e84..a770c260bef 100755 --- a/ci/build_wheel.sh +++ b/ci/build_wheel.sh @@ -22,7 +22,7 @@ PACKAGE_CUDA_SUFFIX="-${RAPIDS_PY_CUDA_SUFFIX}" pyproject_file="${package_dir}/pyproject.toml" 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/= .*/= \"${commit}\"/g" "${package_dir}/${package_name}/_version.py" # 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 00a56071442..7574b4174e9 100755 --- a/ci/release/update-version.sh +++ b/ci/release/update-version.sh @@ -51,7 +51,7 @@ sed_runner 's/'"VERSION ${CURRENT_SHORT_TAG}.*"'/'"VERSION ${NEXT_FULL_TAG}"'/g' sed_runner 's/'"VERSION ${CURRENT_SHORT_TAG}.*"'/'"VERSION ${NEXT_FULL_TAG}"'/g' java/src/main/native/CMakeLists.txt # Centralized version file update -echo "${NEXT_FULL_TAG}" | tr -d '"' > VERSION +echo "${NEXT_FULL_TAG}" > VERSION # Wheel testing script sed_runner "s/branch-.*/branch-${NEXT_SHORT_TAG}/g" ci/test_wheel_dask_cudf.sh diff --git a/conda/recipes/cudf/meta.yaml b/conda/recipes/cudf/meta.yaml index 4686b2ea70e..1ed07a85b88 100644 --- a/conda/recipes/cudf/meta.yaml +++ b/conda/recipes/cudf/meta.yaml @@ -1,6 +1,6 @@ # Copyright (c) 2018-2023, NVIDIA CORPORATION. -{% set version = environ['RAPIDS_PACKAGE_VERSION'].strip('"').lstrip('v') %} +{% set version = environ['RAPIDS_PACKAGE_VERSION'].lstrip('v') %} {% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %} {% set py_version = environ['CONDA_PY'] %} {% set cuda_version = '.'.join(environ['RAPIDS_CUDA_VERSION'].split('.')[:2]) %} diff --git a/conda/recipes/cudf_kafka/meta.yaml b/conda/recipes/cudf_kafka/meta.yaml index d58534327d7..cdc547b4d68 100644 --- a/conda/recipes/cudf_kafka/meta.yaml +++ b/conda/recipes/cudf_kafka/meta.yaml @@ -1,6 +1,6 @@ # Copyright (c) 2020-2023, NVIDIA CORPORATION. -{% set version = environ['RAPIDS_PACKAGE_VERSION'].strip('"').lstrip('v') %} +{% set version = environ['RAPIDS_PACKAGE_VERSION'].lstrip('v') %} {% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %} {% set py_version = environ['CONDA_PY'] %} {% set cuda_version = '.'.join(environ['RAPIDS_CUDA_VERSION'].split('.')[:2]) %} diff --git a/conda/recipes/custreamz/meta.yaml b/conda/recipes/custreamz/meta.yaml index 6d4a15e5f61..fb6efabffd4 100644 --- a/conda/recipes/custreamz/meta.yaml +++ b/conda/recipes/custreamz/meta.yaml @@ -1,6 +1,6 @@ # Copyright (c) 2018-2023, NVIDIA CORPORATION. -{% set version = environ['RAPIDS_PACKAGE_VERSION'].strip('"').lstrip('v') %} +{% set version = environ['RAPIDS_PACKAGE_VERSION'].lstrip('v') %} {% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %} {% set py_version = environ['CONDA_PY'] %} {% set cuda_version = '.'.join(environ['RAPIDS_CUDA_VERSION'].split('.')[:2]) %} diff --git a/conda/recipes/dask-cudf/meta.yaml b/conda/recipes/dask-cudf/meta.yaml index 905754183e0..9dc9f76d9f5 100644 --- a/conda/recipes/dask-cudf/meta.yaml +++ b/conda/recipes/dask-cudf/meta.yaml @@ -1,6 +1,6 @@ # Copyright (c) 2018-2023, NVIDIA CORPORATION. -{% set version = environ['RAPIDS_PACKAGE_VERSION'].strip('"').lstrip('v') %} +{% set version = environ['RAPIDS_PACKAGE_VERSION'].lstrip('v') %} {% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %} {% set py_version = environ['CONDA_PY'] %} {% set cuda_version = '.'.join(environ['RAPIDS_CUDA_VERSION'].split('.')[:2]) %} diff --git a/conda/recipes/libcudf/meta.yaml b/conda/recipes/libcudf/meta.yaml index 06e490ac61f..0459908fd00 100644 --- a/conda/recipes/libcudf/meta.yaml +++ b/conda/recipes/libcudf/meta.yaml @@ -1,6 +1,6 @@ # Copyright (c) 2018-2023, NVIDIA CORPORATION. -{% set version = environ['RAPIDS_PACKAGE_VERSION'].strip('"').lstrip('v') %} +{% set version = environ['RAPIDS_PACKAGE_VERSION'].lstrip('v') %} {% 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] %}