Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update versioning strategy #14285

Merged
merged 19 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
23.12.00
4 changes: 3 additions & 1 deletion ci/build_cpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
17 changes: 13 additions & 4 deletions ci/build_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,40 @@ export CMAKE_GENERATOR=Ninja

rapids-print-env

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
sed -i "/^__git_commit__/ s/= .*/= \"${commit}\"/g" ${package_dir}/${package_name}/${package_name}/_version.py
done

rapids-logger "Begin py build"

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}" \
Expand Down
8 changes: 4 additions & 4 deletions ci/build_wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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})"

Expand All @@ -22,8 +21,9 @@ 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"

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}
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
Expand Down
13 changes: 2 additions & 11 deletions ci/release/update-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +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 __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
# 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
Expand Down
4 changes: 2 additions & 2 deletions conda/recipes/cudf/meta.yaml
Original file line number Diff line number Diff line change
@@ -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['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]) %}
Expand All @@ -12,7 +12,7 @@ package:
version: {{ version }}

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

build:
number: {{ GIT_DESCRIBE_NUMBER }}
Expand Down
4 changes: 2 additions & 2 deletions conda/recipes/cudf_kafka/meta.yaml
Original file line number Diff line number Diff line change
@@ -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['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]) %}
Expand All @@ -12,7 +12,7 @@ package:
version: {{ version }}

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

build:
number: {{ GIT_DESCRIBE_NUMBER }}
Expand Down
4 changes: 2 additions & 2 deletions conda/recipes/custreamz/meta.yaml
Original file line number Diff line number Diff line change
@@ -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['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]) %}
Expand All @@ -12,7 +12,7 @@ package:
version: {{ version }}

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

build:
number: {{ GIT_DESCRIBE_NUMBER }}
Expand Down
4 changes: 2 additions & 2 deletions conda/recipes/dask-cudf/meta.yaml
Original file line number Diff line number Diff line change
@@ -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['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]) %}
Expand All @@ -12,7 +12,7 @@ package:
version: {{ version }}

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

build:
number: {{ GIT_DESCRIBE_NUMBER }}
Expand Down
4 changes: 2 additions & 2 deletions conda/recipes/libcudf/meta.yaml
Original file line number Diff line number Diff line change
@@ -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['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] %}
Expand All @@ -11,7 +11,7 @@ package:
name: libcudf-split

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

build:
script_env:
Expand Down
1 change: 1 addition & 0 deletions python/cudf/cudf/VERSION
3 changes: 1 addition & 2 deletions python/cudf/cudf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -99,8 +100,6 @@
rmm.register_reinitialize_hook(clear_cache)


__version__ = "23.12.00"

__all__ = [
"BaseIndex",
"CategoricalDtype",
Expand Down
20 changes: 20 additions & 0 deletions python/cudf/cudf/_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("cudf").joinpath("VERSION").read_text().strip()
)
__git_commit__ = ""
5 changes: 4 additions & 1 deletion python/cudf/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down Expand Up @@ -78,6 +78,9 @@ Documentation = "https://docs.rapids.ai/api/cudf/stable/"
[tool.setuptools]
license-files = ["LICENSE"]

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

[tool.isort]
line_length = 79
multi_line_output = 3
Expand Down
4 changes: 3 additions & 1 deletion python/cudf/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
1 change: 1 addition & 0 deletions python/cudf_kafka/cudf_kafka/VERSION
3 changes: 3 additions & 0 deletions python/cudf_kafka/cudf_kafka/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Copyright (c) 2020-2023, NVIDIA CORPORATION.

from ._version import __git_commit__, __version__
23 changes: 23 additions & 0 deletions python/cudf_kafka/cudf_kafka/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 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("cudf_kafka")
.joinpath("VERSION")
.read_text()
.strip()
)
__git_commit__ = ""
5 changes: 4 additions & 1 deletion python/cudf_kafka/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand All @@ -38,6 +38,9 @@ Documentation = "https://docs.rapids.ai/api/cudf/stable/"
[tool.setuptools]
license-files = ["LICENSE"]

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

[tool.isort]
line_length = 79
multi_line_output = 3
Expand Down
2 changes: 1 addition & 1 deletion python/cudf_kafka/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
1 change: 1 addition & 0 deletions python/custreamz/custreamz/VERSION
3 changes: 2 additions & 1 deletion python/custreamz/custreamz/__init__.py
Original file line number Diff line number Diff line change
@@ -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
23 changes: 23 additions & 0 deletions python/custreamz/custreamz/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 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("custreamz")
.joinpath("VERSION")
.read_text()
.strip()
)
__git_commit__ = ""
5 changes: 4 additions & 1 deletion python/custreamz/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down Expand Up @@ -48,6 +48,9 @@ Homepage = "https://github.com/rapidsai/cudf"
license-files = ["LICENSE"]
zip-safe = false

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

[tools.setuptools.packages.find]
include = [
"custreamz",
Expand Down
4 changes: 3 additions & 1 deletion python/custreamz/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@

from setuptools import setup

setup()
setup(
package_data={"custreamz": ["VERSION"]},
)
1 change: 1 addition & 0 deletions python/dask_cudf/dask_cudf/VERSION
3 changes: 1 addition & 2 deletions python/dask_cudf/dask_cudf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -14,8 +15,6 @@
except ImportError:
pass

__version__ = "23.12.00"

__all__ = [
"DataFrame",
"Series",
Expand Down
Loading
Loading