Skip to content

Commit

Permalink
Stop using versioneer to manage versions (#1190)
Browse files Browse the repository at this point in the history
This PR replaces usage of versioneer with hard-coded version numbers in setup.py and __init__.py. Since rmm needs to manage versions across a wide range of file types (CMake, C++, Sphinx and doxygen docs, etc), versioneer cannot be relied on as a single source of truth and therefore does not allow us to single-source our versioning to the Git repo as is intended. Additionally, since the primary means of installing rmm is via conda packages (or now, pip packages), information from the package manager tends to be far more informative than the version strings for troubleshooting and debugging purposes. Conversely, the nonstandard version strings that it produces tend to be problematic for other tools, which at best will ignore such versions but at worst will simply fail.

Relies on rapidsai/shared-workflows#38

Authors:
  - Vyas Ramasubramani (https://github.com/vyasr)

Approvers:
  - Bradley Dice (https://github.com/bdice)
  - Sevag H (https://github.com/sevagh)

URL: #1190
  • Loading branch information
vyasr authored Feb 16, 2023
1 parent c9c83ab commit 82e184f
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 2,503 deletions.
1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

1 change: 1 addition & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ jobs:
package-name: rmm
package-dir: python
skbuild-configure-options: "-DRMM_BUILD_WHEELS=ON"
uses-versioneer: false
wheel-publish:
needs: wheel-build
secrets: inherit
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ jobs:
package-dir: python
package-name: rmm
skbuild-configure-options: "-DRMM_BUILD_WHEELS=ON"
uses-versioneer: false
wheel-tests:
needs: wheel-build
secrets: inherit
Expand Down
2 changes: 1 addition & 1 deletion ci/check_style.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ rapids-dependency-file-generator \
rapids-mamba-retry env create --force -f env.yaml -n checks
conda activate checks

FORMAT_FILE_URL=https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-23.02/cmake-format-rapids-cmake.json
FORMAT_FILE_URL=https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-23.04/cmake-format-rapids-cmake.json
export RAPIDS_CMAKE_FORMAT_FILE=/tmp/rapids_cmake_ci/cmake-formats-rapids-cmake.json
mkdir -p $(dirname ${RAPIDS_CMAKE_FORMAT_FILE})
wget -O ${RAPIDS_CMAKE_FORMAT_FILE} ${FORMAT_FILE_URL}
Expand Down
9 changes: 9 additions & 0 deletions ci/release/apply_wheel_modifications.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
# Copyright (c) 2023, NVIDIA CORPORATION.
#
# Usage: bash apply_wheel_modifications.sh <new_version>

VERSION=${1}

sed -i "s/__version__ = .*/__version__ = \"${VERSION}\"/g" python/rmm/__init__.py
sed -i "s/version=.*,/version=\"${VERSION}\",/g" python/setup.py
2 changes: 2 additions & 0 deletions ci/release/update-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ sed_runner 's/'"branch-.*\/RAPIDS.cmake"'/'"branch-${NEXT_SHORT_TAG}\/RAPIDS.cma
# Python update
sed_runner 's/'"rmm_version .*)"'/'"rmm_version ${NEXT_FULL_TAG})"'/g' python/CMakeLists.txt
sed_runner 's/'"branch-.*\/RAPIDS.cmake"'/'"branch-${NEXT_SHORT_TAG}\/RAPIDS.cmake"'/g' python/CMakeLists.txt
sed_runner "s/__version__ = .*/__version__ = \"${NEXT_FULL_TAG}\"/g" python/rmm/__init__.py
sed_runner "s/version=.*,/version=\"${NEXT_FULL_TAG}\",/g" python/setup.py

# cmake-format rapids-cmake definitions
sed_runner 's/'"branch-.*\/cmake-format-rapids-cmake.json"'/'"branch-${NEXT_SHORT_TAG}\/cmake-format-rapids-cmake.json"'/g' ci/check_style.sh
Expand Down
5 changes: 1 addition & 4 deletions python/rmm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@
# 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 weakref

from rmm import mr
from rmm._lib.device_buffer import DeviceBuffer
from rmm._version import get_versions
from rmm.mr import disable_logging, enable_logging, get_log_filenames
from rmm.rmm import (
RMMError,
Expand All @@ -36,7 +34,6 @@
"disable_logging",
"enable_logging",
"get_log_filenames",
"get_versions",
"is_initialized",
"mr",
"register_reinitialize_hook",
Expand All @@ -45,4 +42,4 @@
"unregister_reinitialize_hook",
]

__version__ = get_versions()["version"]
__version__ = "23.04.00"
Loading

0 comments on commit 82e184f

Please sign in to comment.