From 3a75f6db18c911d93727d12a0cf5abcdad22efda Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Wed, 29 May 2024 15:10:55 -0700 Subject: [PATCH] Use rapids-build-backend. (#15245) This PR uses `rapids-build-backend` to simplify wheel builds and reduce the complexity of various CI/build scripts. See also: - https://github.com/rapidsai/rapids-build-backend - https://github.com/rapidsai/build-planning/issues/31 Authors: - Vyas Ramasubramani (https://github.com/vyasr) - Bradley Dice (https://github.com/bdice) - James Lamb (https://github.com/jameslamb) Approvers: - Lawrence Mitchell (https://github.com/wence-) - Bradley Dice (https://github.com/bdice) URL: https://github.com/rapidsai/cudf/pull/15245 --- .pre-commit-config.yaml | 2 +- build.sh | 2 +- ci/build_python.sh | 17 ++-- ci/build_wheel.sh | 46 +---------- ci/build_wheel_cudf.sh | 2 +- ci/build_wheel_dask_cudf.sh | 2 +- ci/release/update-version.sh | 4 +- .../all_cuda-118_arch-x86_64.yaml | 6 +- .../all_cuda-122_arch-x86_64.yaml | 6 +- conda/recipes/cudf/meta.yaml | 1 + conda/recipes/cudf_kafka/meta.yaml | 1 + conda/recipes/custreamz/meta.yaml | 4 +- conda/recipes/dask-cudf/meta.yaml | 4 +- dependencies.yaml | 79 ++++++++++++------- python/cudf/cudf/_version.py | 19 ++++- python/cudf/cudf/tests/test_version.py | 12 +++ python/cudf/pyproject.toml | 24 ++++-- python/cudf_kafka/cudf_kafka/_version.py | 16 +++- python/cudf_kafka/pyproject.toml | 22 ++++-- python/cudf_polars/cudf_polars/_version.py | 21 +++++ python/cudf_polars/pyproject.toml | 10 ++- python/custreamz/custreamz/_version.py | 16 +++- .../custreamz/custreamz/tests/test_version.py | 12 +++ python/custreamz/pyproject.toml | 12 ++- python/dask_cudf/dask_cudf/_version.py | 16 +++- .../dask_cudf/dask_cudf/tests/test_version.py | 13 +++ python/dask_cudf/pyproject.toml | 14 +++- 27 files changed, 251 insertions(+), 132 deletions(-) create mode 100644 python/cudf/cudf/tests/test_version.py create mode 100644 python/cudf_polars/cudf_polars/_version.py create mode 100644 python/custreamz/custreamz/tests/test_version.py create mode 100644 python/dask_cudf/dask_cudf/tests/test_version.py diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2d3ffc287e9..8865fb48e0d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -129,7 +129,7 @@ repos: ^CHANGELOG.md$ ) - repo: https://github.com/rapidsai/dependency-file-generator - rev: v1.13.4 + rev: v1.13.11 hooks: - id: rapids-dependency-file-generator args: ["--clean"] diff --git a/build.sh b/build.sh index 43bb04f7a18..4291c88ea12 100755 --- a/build.sh +++ b/build.sh @@ -70,7 +70,7 @@ BUILD_PER_THREAD_DEFAULT_STREAM=OFF BUILD_REPORT_METRICS=OFF BUILD_REPORT_INCL_CACHE_STATS=OFF USE_PROPRIETARY_NVCOMP=ON -PYTHON_ARGS_FOR_INSTALL="-m pip install --no-build-isolation --no-deps" +PYTHON_ARGS_FOR_INSTALL="-m pip install --no-build-isolation --no-deps --config-settings rapidsai.disable-cuda=true" # Set defaults for vars that may not have been defined externally # FIXME: if INSTALL_PREFIX is not set, check PREFIX, then check diff --git a/ci/build_python.sh b/ci/build_python.sh index 3c2a7761e1a..79e09432779 100755 --- a/ci/build_python.sh +++ b/ci/build_python.sh @@ -13,14 +13,7 @@ export CMAKE_GENERATOR=Ninja rapids-print-env -package_dir="python" -version=$(rapids-generate-version) -commit=$(git rev-parse HEAD) - -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 +rapids-generate-version > ./VERSION rapids-logger "Begin py build" @@ -29,24 +22,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_PACKAGE_VERSION=${version} rapids-conda-retry mambabuild \ +RAPIDS_PACKAGE_VERSION=$(head -1 ./VERSION) rapids-conda-retry mambabuild \ --no-test \ --channel "${CPP_CHANNEL}" \ conda/recipes/cudf -RAPIDS_PACKAGE_VERSION=${version} rapids-conda-retry mambabuild \ +RAPIDS_PACKAGE_VERSION=$(head -1 ./VERSION) rapids-conda-retry mambabuild \ --no-test \ --channel "${CPP_CHANNEL}" \ --channel "${RAPIDS_CONDA_BLD_OUTPUT_DIR}" \ conda/recipes/dask-cudf -RAPIDS_PACKAGE_VERSION=${version} rapids-conda-retry mambabuild \ +RAPIDS_PACKAGE_VERSION=$(head -1 ./VERSION) rapids-conda-retry mambabuild \ --no-test \ --channel "${CPP_CHANNEL}" \ --channel "${RAPIDS_CONDA_BLD_OUTPUT_DIR}" \ conda/recipes/cudf_kafka -RAPIDS_PACKAGE_VERSION=${version} rapids-conda-retry mambabuild \ +RAPIDS_PACKAGE_VERSION=$(head -1 ./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 c4b794e81f7..7c1fa705faa 100755 --- a/ci/build_wheel.sh +++ b/ci/build_wheel.sh @@ -3,54 +3,12 @@ set -euo pipefail -package_name=$1 -package_dir=$2 +package_dir=$1 source rapids-configure-sccache source rapids-date-string -version=$(rapids-generate-version) -commit=$(git rev-parse HEAD) - -RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})" - -# This is the version of the suffix with a preceding hyphen. It's used -# everywhere except in the final wheel name. -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/^name = \"${package_name}\"/name = \"${package_name}${PACKAGE_CUDA_SUFFIX}\"/g" ${pyproject_file} -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 -# easiest way to do so is to augment the spec with a constraint containing a -# min alpha version that doesn't affect the version bounds but does allow usage -# of alpha versions for that dependency without --pre -alpha_spec='' -if ! rapids-is-release-build; then - alpha_spec=',>=0.0.0a0' -fi - -if [[ ${package_name} == "dask-cudf" ]]; then - sed -r -i "s/cudf==(.*)\"/cudf${PACKAGE_CUDA_SUFFIX}==\1${alpha_spec}\"/g" ${pyproject_file} - sed -r -i "s/dask-cuda==(.*)\"/dask-cuda==\1${alpha_spec}\"/g" ${pyproject_file} - sed -r -i "s/rapids-dask-dependency==(.*)\"/rapids-dask-dependency==\1${alpha_spec}\"/g" ${pyproject_file} -else - sed -r -i "s/rmm(.*)\"/rmm${PACKAGE_CUDA_SUFFIX}\1${alpha_spec}\"/g" ${pyproject_file} - # ptxcompiler and cubinlinker aren't version constrained - sed -r -i "s/ptxcompiler\"/ptxcompiler${PACKAGE_CUDA_SUFFIX}\"/g" ${pyproject_file} - sed -r -i "s/cubinlinker\"/cubinlinker${PACKAGE_CUDA_SUFFIX}\"/g" ${pyproject_file} -fi - -if [[ $PACKAGE_CUDA_SUFFIX == "-cu12" ]]; then - sed -i "s/cuda-python[<=>\.,0-9a]*/cuda-python>=12.0,<13.0a0/g" ${pyproject_file} - sed -i "s/cupy-cuda11x/cupy-cuda12x/g" ${pyproject_file} - sed -i "s/ptxcompiler/pynvjitlink/g" ${pyproject_file} - sed -i "/cubinlinker/d" ${pyproject_file} -fi +rapids-generate-version > ./VERSION cd "${package_dir}" diff --git a/ci/build_wheel_cudf.sh b/ci/build_wheel_cudf.sh index f0886a28fd9..1b563bc499c 100755 --- a/ci/build_wheel_cudf.sh +++ b/ci/build_wheel_cudf.sh @@ -7,7 +7,7 @@ package_dir="python/cudf" export SKBUILD_CMAKE_ARGS="-DUSE_LIBARROW_FROM_PYARROW=ON" -./ci/build_wheel.sh cudf ${package_dir} +./ci/build_wheel.sh ${package_dir} python -m auditwheel repair -w ${package_dir}/final_dist ${package_dir}/dist/* diff --git a/ci/build_wheel_dask_cudf.sh b/ci/build_wheel_dask_cudf.sh index 150fec4e2d7..eb2a91289f7 100755 --- a/ci/build_wheel_dask_cudf.sh +++ b/ci/build_wheel_dask_cudf.sh @@ -5,7 +5,7 @@ set -euo pipefail package_dir="python/dask_cudf" -./ci/build_wheel.sh dask-cudf ${package_dir} +./ci/build_wheel.sh ${package_dir} RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})" RAPIDS_PY_WHEEL_NAME="dask_cudf_${RAPIDS_PY_CUDA_SUFFIX}" RAPIDS_PY_WHEEL_PURE="1" rapids-upload-wheels-to-s3 ${package_dir}/dist diff --git a/ci/release/update-version.sh b/ci/release/update-version.sh index beeb130f0f1..f629de64905 100755 --- a/ci/release/update-version.sh +++ b/ci/release/update-version.sh @@ -58,10 +58,10 @@ DEPENDENCIES=( ) for DEP in "${DEPENDENCIES[@]}"; do for FILE in dependencies.yaml conda/environments/*.yaml; do - sed_runner "/-.* ${DEP}\(-cu[[:digit:]]\{2\}\)\{0,1\}==/ s/==.*/==${NEXT_SHORT_TAG_PEP440}.*/g" "${FILE}" + sed_runner "/-.* ${DEP}\(-cu[[:digit:]]\{2\}\)\{0,1\}==/ s/==.*/==${NEXT_SHORT_TAG_PEP440}.*,>=0.0.0a0/g" "${FILE}" done for FILE in python/*/pyproject.toml; do - sed_runner "/\"${DEP}==/ s/==.*\"/==${NEXT_SHORT_TAG_PEP440}.*\"/g" ${FILE} + sed_runner "/\"${DEP}==/ s/==.*\"/==${NEXT_SHORT_TAG_PEP440}.*,>=0.0.0a0\"/g" ${FILE} done done diff --git a/conda/environments/all_cuda-118_arch-x86_64.yaml b/conda/environments/all_cuda-118_arch-x86_64.yaml index 985f873e5eb..946e2d1cd32 100644 --- a/conda/environments/all_cuda-118_arch-x86_64.yaml +++ b/conda/environments/all_cuda-118_arch-x86_64.yaml @@ -27,6 +27,7 @@ dependencies: - cxx-compiler - cython>=3.0.3 - dask-cuda==24.8.* +- dask-cuda==24.8.*,>=0.0.0a0 - dlpack>=0.8,<1.0 - doxygen=1.9.1 - fastavro>=0.22.9 @@ -76,9 +77,10 @@ dependencies: - python-confluent-kafka>=1.9.0,<1.10.0a0 - python>=3.9,<3.12 - pytorch>=2.1.0 -- rapids-dask-dependency==24.8.* +- rapids-build-backend>=0.3.0,<0.4.0.dev0 +- rapids-dask-dependency==24.8.*,>=0.0.0a0 - rich -- rmm==24.8.* +- rmm==24.8.*,>=0.0.0a0 - s3fs>=2022.3.0 - scikit-build-core>=0.7.0 - scipy diff --git a/conda/environments/all_cuda-122_arch-x86_64.yaml b/conda/environments/all_cuda-122_arch-x86_64.yaml index 3083d1dbb03..f069616ddbe 100644 --- a/conda/environments/all_cuda-122_arch-x86_64.yaml +++ b/conda/environments/all_cuda-122_arch-x86_64.yaml @@ -28,6 +28,7 @@ dependencies: - cxx-compiler - cython>=3.0.3 - dask-cuda==24.8.* +- dask-cuda==24.8.*,>=0.0.0a0 - dlpack>=0.8,<1.0 - doxygen=1.9.1 - fastavro>=0.22.9 @@ -74,9 +75,10 @@ dependencies: - python-confluent-kafka>=1.9.0,<1.10.0a0 - python>=3.9,<3.12 - pytorch>=2.1.0 -- rapids-dask-dependency==24.8.* +- rapids-build-backend>=0.3.0,<0.4.0.dev0 +- rapids-dask-dependency==24.8.*,>=0.0.0a0 - rich -- rmm==24.8.* +- rmm==24.8.*,>=0.0.0a0 - s3fs>=2022.3.0 - scikit-build-core>=0.7.0 - scipy diff --git a/conda/recipes/cudf/meta.yaml b/conda/recipes/cudf/meta.yaml index e7245e67659..3cdc2050631 100644 --- a/conda/recipes/cudf/meta.yaml +++ b/conda/recipes/cudf/meta.yaml @@ -61,6 +61,7 @@ requirements: host: - python - cython >=3.0.3 + - rapids-build-backend >=0.3.0,<0.4.0.dev0 - scikit-build-core >=0.7.0 - dlpack >=0.8,<1.0 - numpy 1.23 diff --git a/conda/recipes/cudf_kafka/meta.yaml b/conda/recipes/cudf_kafka/meta.yaml index 4d91cf6320c..1b0e0e2c236 100644 --- a/conda/recipes/cudf_kafka/meta.yaml +++ b/conda/recipes/cudf_kafka/meta.yaml @@ -60,6 +60,7 @@ requirements: - cuda-version ={{ cuda_version }} - cudf ={{ version }} - libcudf_kafka ={{ version }} + - rapids-build-backend >=0.3.0,<0.4.0.dev0 - scikit-build-core >=0.7.0 {% if cuda_major != "11" %} - cuda-cudart-dev diff --git a/conda/recipes/custreamz/meta.yaml b/conda/recipes/custreamz/meta.yaml index 755394e3936..f5ea426e0b1 100644 --- a/conda/recipes/custreamz/meta.yaml +++ b/conda/recipes/custreamz/meta.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2018-2023, NVIDIA CORPORATION. +# Copyright (c) 2018-2024, NVIDIA CORPORATION. {% set version = environ['RAPIDS_PACKAGE_VERSION'].lstrip('v') %} {% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %} @@ -37,6 +37,8 @@ build: requirements: host: - python + - rapids-build-backend >=0.3.0,<0.4.0.dev0 + - setuptools - python-confluent-kafka >=1.9.0,<1.10.0a0 - cudf_kafka ={{ version }} - cuda-version ={{ cuda_version }} diff --git a/conda/recipes/dask-cudf/meta.yaml b/conda/recipes/dask-cudf/meta.yaml index 16638926492..1e6c0a35a09 100644 --- a/conda/recipes/dask-cudf/meta.yaml +++ b/conda/recipes/dask-cudf/meta.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2018-2023, NVIDIA CORPORATION. +# Copyright (c) 2018-2024, NVIDIA CORPORATION. {% set version = environ['RAPIDS_PACKAGE_VERSION'].lstrip('v') %} {% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %} @@ -37,6 +37,8 @@ build: requirements: host: - python + - rapids-build-backend >=0.3.0,<0.4.0.dev0 + - setuptools - cuda-version ={{ cuda_version }} run: - python diff --git a/dependencies.yaml b/dependencies.yaml index 3df7cb71a78..8bfa3190b3d 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -9,7 +9,6 @@ files: - build_base - build_all - build_cpp - - build_wheels - build_python_common - build_python_cudf - cuda @@ -19,6 +18,8 @@ files: - libarrow_build - notebooks - py_version + - rapids_build_skbuild + - rapids_build_setuptools - run_common - run_cudf - run_dask_cudf @@ -75,11 +76,19 @@ files: - docs - libarrow_run - py_version - py_build_cudf: + py_rapids_build_cudf: output: pyproject pyproject_dir: python/cudf extras: table: build-system + includes: + - rapids_build_skbuild + py_build_cudf: + output: pyproject + pyproject_dir: python/cudf + extras: + table: tool.rapids-build-backend + key: requires includes: - build_base - build_python_common @@ -119,13 +128,13 @@ files: key: cudf-pandas-tests includes: - test_python_cudf_pandas - py_build_cudf_polars: + py_rapids_build_cudf_polars: output: pyproject pyproject_dir: python/cudf_polars extras: table: build-system includes: - - build_wheels + - rapids_build_setuptools py_run_cudf_polars: output: pyproject pyproject_dir: python/cudf_polars @@ -148,7 +157,7 @@ files: extras: table: build-system includes: - - build_wheels + - rapids_build_setuptools py_run_dask_cudf: output: pyproject pyproject_dir: python/dask_cudf @@ -168,11 +177,19 @@ files: includes: - test_python_common - test_python_dask_cudf - py_build_cudf_kafka: + py_rapids_build_cudf_kafka: output: pyproject pyproject_dir: python/cudf_kafka extras: table: build-system + includes: + - rapids_build_skbuild + py_build_cudf_kafka: + output: pyproject + pyproject_dir: python/cudf_kafka + extras: + table: tool.rapids-build-backend + key: requires includes: - build_base - build_python_common @@ -197,7 +214,7 @@ files: extras: table: build-system includes: - - build_wheels + - rapids_build_setuptools py_run_custreamz: output: pyproject pyproject_dir: python/custreamz @@ -276,12 +293,24 @@ dependencies: # Align nvcomp version with rapids-cmake - nvcomp==3.0.6 - spdlog>=1.12.0,<1.13 - build_wheels: + rapids_build_skbuild: + common: + - output_types: [conda, requirements, pyproject] + packages: + - &rapids_build_backend rapids-build-backend>=0.3.0,<0.4.0.dev0 + - output_types: conda + packages: + - scikit-build-core>=0.7.0 + - output_types: [requirements, pyproject] + packages: + - scikit-build-core[pyproject]>=0.7.0 + rapids_build_setuptools: common: - output_types: [requirements, pyproject] packages: - - wheel + - *rapids_build_backend - setuptools + - wheel build_python_common: common: - output_types: [conda, requirements, pyproject] @@ -290,22 +319,16 @@ dependencies: # Hard pin the patch version used during the build. This must be kept # in sync with the version pinned in get_arrow.cmake. - pyarrow==16.1.0.* - - output_types: conda - packages: - - scikit-build-core>=0.7.0 - output_types: pyproject packages: # Hard pin the patch version used during the build. # Sync with conda build constraint & wheel run constraint. - numpy==1.23.* - - output_types: [requirements, pyproject] - packages: - - scikit-build-core[pyproject]>=0.7.0 build_python_cudf: common: - output_types: conda packages: - - &rmm_conda rmm==24.8.* + - &rmm_conda rmm==24.8.*,>=0.0.0a0 - pip - pip: - git+https://github.com/python-streamz/streamz.git@master @@ -321,10 +344,10 @@ dependencies: matrices: - matrix: {cuda: "12.*"} packages: &build_python_packages_cu12 - - &rmm_cu12 rmm-cu12==24.8.* + - rmm-cu12==24.8.*,>=0.0.0a0 - matrix: {cuda: "11.*"} packages: &build_python_packages_cu11 - - &rmm_cu11 rmm-cu11==24.8.* + - rmm-cu11==24.8.*,>=0.0.0a0 - {matrix: null, packages: [*rmm_conda] } libarrow_build: common: @@ -568,11 +591,11 @@ dependencies: matrices: - matrix: {cuda: "12.*"} packages: - - rmm-cu12==24.8.* + - rmm-cu12==24.8.*,>=0.0.0a0 - pynvjitlink-cu12 - matrix: {cuda: "11.*"} packages: - - rmm-cu11==24.8.* + - rmm-cu11==24.8.*,>=0.0.0a0 - cubinlinker-cu11 - ptxcompiler-cu11 - {matrix: null, packages: [cubinlinker, ptxcompiler, *rmm_conda]} @@ -585,7 +608,7 @@ dependencies: common: - output_types: [conda, requirements, pyproject] packages: - - rapids-dask-dependency==24.8.* + - rapids-dask-dependency==24.8.*,>=0.0.0a0 run_custreamz: common: - output_types: conda @@ -671,13 +694,13 @@ dependencies: common: - output_types: [conda, requirements, pyproject] packages: - - dask-cuda==24.8.* + - dask-cuda==24.8.*,>=0.0.0a0 - *numba depends_on_cudf: common: - output_types: conda packages: - - &cudf_conda cudf==24.8.* + - &cudf_conda cudf==24.8.*,>=0.0.0a0 - output_types: requirements packages: # pip recognizes the index as a global option for the requirements.txt file @@ -689,16 +712,16 @@ dependencies: matrices: - matrix: {cuda: "12.*"} packages: - - cudf-cu12==24.8.* + - cudf-cu12==24.8.*,>=0.0.0a0 - matrix: {cuda: "11.*"} packages: - - cudf-cu11==24.8.* + - cudf-cu11==24.8.*,>=0.0.0a0 - {matrix: null, packages: [*cudf_conda]} depends_on_cudf_kafka: common: - output_types: conda packages: - - &cudf_kafka_conda cudf_kafka==24.8.* + - &cudf_kafka_conda cudf_kafka==24.8.*,>=0.0.0a0 - output_types: requirements packages: # pip recognizes the index as a global option for the requirements.txt file @@ -710,10 +733,10 @@ dependencies: matrices: - matrix: {cuda: "12.*"} packages: - - cudf_kafka-cu12==24.8.* + - cudf_kafka-cu12==24.8.*,>=0.0.0a0 - matrix: {cuda: "11.*"} packages: - - cudf_kafka-cu11==24.8.* + - cudf_kafka-cu11==24.8.*,>=0.0.0a0 - {matrix: null, packages: [*cudf_kafka_conda]} depends_on_cupy: common: diff --git a/python/cudf/cudf/_version.py b/python/cudf/cudf/_version.py index ecf6ddd8e3b..7dd732b4905 100644 --- a/python/cudf/cudf/_version.py +++ b/python/cudf/cudf/_version.py @@ -1,4 +1,4 @@ -# Copyright (c) 2023, NVIDIA CORPORATION. +# Copyright (c) 2023-2024, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,6 +15,19 @@ import importlib.resources __version__ = ( - importlib.resources.files("cudf").joinpath("VERSION").read_text().strip() + importlib.resources.files(__package__) + .joinpath("VERSION") + .read_text() + .strip() ) -__git_commit__ = "" +try: + __git_commit__ = ( + importlib.resources.files(__package__) + .joinpath("GIT_COMMIT") + .read_text() + .strip() + ) +except FileNotFoundError: + __git_commit__ = "" + +__all__ = ["__git_commit__", "__version__"] diff --git a/python/cudf/cudf/tests/test_version.py b/python/cudf/cudf/tests/test_version.py new file mode 100644 index 00000000000..8c10cc20a9a --- /dev/null +++ b/python/cudf/cudf/tests/test_version.py @@ -0,0 +1,12 @@ +# Copyright (c) 2024, NVIDIA CORPORATION. + +import cudf + + +def test_version_constants_are_populated(): + # __git_commit__ will only be non-empty in a built distribution + assert isinstance(cudf.__git_commit__, str) + + # __version__ should always be non-empty + assert isinstance(cudf.__version__, str) + assert len(cudf.__version__) > 0 diff --git a/python/cudf/pyproject.toml b/python/cudf/pyproject.toml index e6517825083..9ad02fed044 100644 --- a/python/cudf/pyproject.toml +++ b/python/cudf/pyproject.toml @@ -1,14 +1,9 @@ # Copyright (c) 2021-2024, NVIDIA CORPORATION. [build-system] -build-backend = "scikit_build_core.build" +build-backend = "rapids_build_backend.build" requires = [ - "cmake>=3.26.4", - "cython>=3.0.3", - "ninja", - "numpy==1.23.*", - "pyarrow==16.1.0.*", - "rmm==24.8.*", + "rapids-build-backend>=0.3.0,<0.4.0.dev0", "scikit-build-core[pyproject]>=0.7.0", ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. @@ -36,7 +31,7 @@ dependencies = [ "ptxcompiler", "pyarrow>=16.1.0,<16.2.0a0", "rich", - "rmm==24.8.*", + "rmm==24.8.*,>=0.0.0a0", "typing_extensions>=4.0.0", ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. classifiers = [ @@ -122,6 +117,19 @@ skip = [ "__init__.py", ] +[tool.rapids-build-backend] +build-backend = "scikit_build_core.build" +commit-file = "cudf/GIT_COMMIT" +dependencies-file = "../../dependencies.yaml" +requires = [ + "cmake>=3.26.4", + "cython>=3.0.3", + "ninja", + "numpy==1.23.*", + "pyarrow==16.1.0.*", + "rmm==24.8.*,>=0.0.0a0", +] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. + [tool.scikit-build] build-dir = "build/{wheel_tag}" cmake.build-type = "Release" diff --git a/python/cudf_kafka/cudf_kafka/_version.py b/python/cudf_kafka/cudf_kafka/_version.py index 5adab566da0..7dd732b4905 100644 --- a/python/cudf_kafka/cudf_kafka/_version.py +++ b/python/cudf_kafka/cudf_kafka/_version.py @@ -1,4 +1,4 @@ -# Copyright (c) 2023, NVIDIA CORPORATION. +# Copyright (c) 2023-2024, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,9 +15,19 @@ import importlib.resources __version__ = ( - importlib.resources.files("cudf_kafka") + importlib.resources.files(__package__) .joinpath("VERSION") .read_text() .strip() ) -__git_commit__ = "" +try: + __git_commit__ = ( + importlib.resources.files(__package__) + .joinpath("GIT_COMMIT") + .read_text() + .strip() + ) +except FileNotFoundError: + __git_commit__ = "" + +__all__ = ["__git_commit__", "__version__"] diff --git a/python/cudf_kafka/pyproject.toml b/python/cudf_kafka/pyproject.toml index 9233d0e92dd..1bc04742a73 100644 --- a/python/cudf_kafka/pyproject.toml +++ b/python/cudf_kafka/pyproject.toml @@ -1,13 +1,9 @@ # Copyright (c) 2021-2024, NVIDIA CORPORATION. [build-system] -build-backend = "scikit_build_core.build" +build-backend = "rapids_build_backend.build" requires = [ - "cmake>=3.26.4", - "cython>=3.0.3", - "ninja", - "numpy==1.23.*", - "pyarrow==16.1.0.*", + "rapids-build-backend>=0.3.0,<0.4.0.dev0", "scikit-build-core[pyproject]>=0.7.0", ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. @@ -22,7 +18,7 @@ authors = [ license = { text = "Apache 2.0" } requires-python = ">=3.9" dependencies = [ - "cudf==24.8.*", + "cudf==24.8.*,>=0.0.0a0", ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. [project.optional-dependencies] @@ -100,3 +96,15 @@ wheel.packages = ["cudf_kafka"] provider = "scikit_build_core.metadata.regex" input = "cudf_kafka/VERSION" regex = "(?P.*)" + +[tool.rapids-build-backend] +build-backend = "scikit_build_core.build" +commit-file = "cudf_kafka/GIT_COMMIT" +dependencies-file = "../../dependencies.yaml" +requires = [ + "cmake>=3.26.4", + "cython>=3.0.3", + "ninja", + "numpy==1.23.*", + "pyarrow==16.1.0.*", +] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. diff --git a/python/cudf_polars/cudf_polars/_version.py b/python/cudf_polars/cudf_polars/_version.py new file mode 100644 index 00000000000..d906f11cb00 --- /dev/null +++ b/python/cudf_polars/cudf_polars/_version.py @@ -0,0 +1,21 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +import importlib.resources + +__version__ = ( + importlib.resources.files(__package__).joinpath("VERSION").read_text().strip() +) +try: + __git_commit__ = ( + importlib.resources.files(__package__) + .joinpath("GIT_COMMIT") + .read_text() + .strip() + ) +except FileNotFoundError: + __git_commit__ = "" + +__all__ = ["__git_commit__", "__version__"] diff --git a/python/cudf_polars/pyproject.toml b/python/cudf_polars/pyproject.toml index 00fde6c0e05..86b0ad414fd 100644 --- a/python/cudf_polars/pyproject.toml +++ b/python/cudf_polars/pyproject.toml @@ -1,8 +1,9 @@ # Copyright (c) 2024, NVIDIA CORPORATION. [build-system] -build-backend = "setuptools.build_meta" +build-backend = "rapids_build_backend.build" requires = [ + "rapids-build-backend>=0.3.0,<0.4.0.dev0", "setuptools", "wheel", ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. @@ -18,7 +19,7 @@ authors = [ license = { text = "Apache 2.0" } requires-python = ">=3.9" dependencies = [ - "cudf==24.8.*", + "cudf==24.8.*,>=0.0.0a0", "polars>=0.20.24", ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. classifiers = [ @@ -169,3 +170,8 @@ rapids = ["rmm", "cudf"] [tool.ruff.format] docstring-code-format = true + +[tool.rapids-build-backend] +build-backend = "setuptools.build_meta" +commit-file = "cudf_polars/GIT_COMMIT" +dependencies-file = "../../dependencies.yaml" diff --git a/python/custreamz/custreamz/_version.py b/python/custreamz/custreamz/_version.py index 0f545f95f2b..7dd732b4905 100644 --- a/python/custreamz/custreamz/_version.py +++ b/python/custreamz/custreamz/_version.py @@ -1,4 +1,4 @@ -# Copyright (c) 2023, NVIDIA CORPORATION. +# Copyright (c) 2023-2024, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,9 +15,19 @@ import importlib.resources __version__ = ( - importlib.resources.files("custreamz") + importlib.resources.files(__package__) .joinpath("VERSION") .read_text() .strip() ) -__git_commit__ = "" +try: + __git_commit__ = ( + importlib.resources.files(__package__) + .joinpath("GIT_COMMIT") + .read_text() + .strip() + ) +except FileNotFoundError: + __git_commit__ = "" + +__all__ = ["__git_commit__", "__version__"] diff --git a/python/custreamz/custreamz/tests/test_version.py b/python/custreamz/custreamz/tests/test_version.py new file mode 100644 index 00000000000..cda2dd92155 --- /dev/null +++ b/python/custreamz/custreamz/tests/test_version.py @@ -0,0 +1,12 @@ +# Copyright (c) 2024, NVIDIA CORPORATION. + +import custreamz + + +def test_version_constants_are_populated(): + # __git_commit__ will only be non-empty in a built distribution + assert isinstance(custreamz.__git_commit__, str) + + # __version__ should always be non-empty + assert isinstance(custreamz.__version__, str) + assert len(custreamz.__version__) > 0 diff --git a/python/custreamz/pyproject.toml b/python/custreamz/pyproject.toml index f7e5698900a..e004a8f5219 100644 --- a/python/custreamz/pyproject.toml +++ b/python/custreamz/pyproject.toml @@ -1,8 +1,9 @@ # Copyright (c) 2021-2024, NVIDIA CORPORATION. [build-system] -build-backend = "setuptools.build_meta" +build-backend = "rapids_build_backend.build" requires = [ + "rapids-build-backend>=0.3.0,<0.4.0.dev0", "setuptools", "wheel", ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. @@ -19,8 +20,8 @@ license = { text = "Apache 2.0" } requires-python = ">=3.9" dependencies = [ "confluent-kafka>=1.9.0,<1.10.0a0", - "cudf==24.8.*", - "cudf_kafka==24.8.*", + "cudf==24.8.*,>=0.0.0a0", + "cudf_kafka==24.8.*,>=0.0.0a0", "streamz", ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. classifiers = [ @@ -45,6 +46,11 @@ test = [ [project.urls] Homepage = "https://github.com/rapidsai/cudf" +[tool.rapids-build-backend] +build-backend = "setuptools.build_meta" +commit-file = "custreamz/COMMIT_FILE" +dependencies-file = "../../dependencies.yaml" + [tool.setuptools] license-files = ["LICENSE"] zip-safe = false diff --git a/python/dask_cudf/dask_cudf/_version.py b/python/dask_cudf/dask_cudf/_version.py index 0dd62854a4e..7dd732b4905 100644 --- a/python/dask_cudf/dask_cudf/_version.py +++ b/python/dask_cudf/dask_cudf/_version.py @@ -1,4 +1,4 @@ -# Copyright (c) 2023, NVIDIA CORPORATION. +# Copyright (c) 2023-2024, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,9 +15,19 @@ import importlib.resources __version__ = ( - importlib.resources.files("dask_cudf") + importlib.resources.files(__package__) .joinpath("VERSION") .read_text() .strip() ) -__git_commit__ = "" +try: + __git_commit__ = ( + importlib.resources.files(__package__) + .joinpath("GIT_COMMIT") + .read_text() + .strip() + ) +except FileNotFoundError: + __git_commit__ = "" + +__all__ = ["__git_commit__", "__version__"] diff --git a/python/dask_cudf/dask_cudf/tests/test_version.py b/python/dask_cudf/dask_cudf/tests/test_version.py new file mode 100644 index 00000000000..e2724e530ba --- /dev/null +++ b/python/dask_cudf/dask_cudf/tests/test_version.py @@ -0,0 +1,13 @@ +# Copyright (c) 2024, NVIDIA CORPORATION. + + +import dask_cudf + + +def test_version_constants_are_populated(): + # __git_commit__ will only be non-empty in a built distribution + assert isinstance(dask_cudf.__git_commit__, str) + + # __version__ should always be non-empty + assert isinstance(dask_cudf.__version__, str) + assert len(dask_cudf.__version__) > 0 diff --git a/python/dask_cudf/pyproject.toml b/python/dask_cudf/pyproject.toml index e353eac06b9..6b5d5ccc412 100644 --- a/python/dask_cudf/pyproject.toml +++ b/python/dask_cudf/pyproject.toml @@ -1,8 +1,9 @@ # Copyright (c) 2021-2024, NVIDIA CORPORATION. [build-system] -build-backend = "setuptools.build_meta" +build-backend = "rapids_build_backend.build" requires = [ + "rapids-build-backend>=0.3.0,<0.4.0.dev0", "setuptools", "wheel", ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. @@ -18,12 +19,12 @@ authors = [ license = { text = "Apache 2.0" } requires-python = ">=3.9" dependencies = [ - "cudf==24.8.*", + "cudf==24.8.*,>=0.0.0a0", "cupy-cuda11x>=12.0.0", "fsspec>=0.6.0", "numpy>=1.23,<2.0a0", "pandas>=2.0,<2.2.3dev0", - "rapids-dask-dependency==24.8.*", + "rapids-dask-dependency==24.8.*,>=0.0.0a0", ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. classifiers = [ "Intended Audience :: Developers", @@ -44,7 +45,7 @@ cudf = "dask_cudf.backends:CudfDXBackendEntrypoint" [project.optional-dependencies] test = [ - "dask-cuda==24.8.*", + "dask-cuda==24.8.*,>=0.0.0a0", "numba>=0.57", "pytest-cov", "pytest-xdist", @@ -54,6 +55,11 @@ test = [ [project.urls] Homepage = "https://github.com/rapidsai/cudf" +[tool.rapids-build-backend] +build-backend = "setuptools.build_meta" +commit-file = "dask_cudf/GIT_COMMIT" +dependencies-file = "../../dependencies.yaml" + [tool.setuptools] license-files = ["LICENSE"]