From 7e9148431c3f88fd2864a69e08768b5acf743803 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Tue, 12 Nov 2024 23:38:00 -0600 Subject: [PATCH] enforce wheel size limits, README formatting in CI --- ci/build_wheel_cpp.sh | 2 ++ ci/build_wheel_python.sh | 2 ++ ci/validate_wheel.sh | 21 +++++++++++++++++++++ python/kvikio/pyproject.toml | 8 ++++++++ python/libkvikio/pyproject.toml | 8 ++++++++ 5 files changed, 41 insertions(+) create mode 100755 ci/validate_wheel.sh diff --git a/ci/build_wheel_cpp.sh b/ci/build_wheel_cpp.sh index 0367842a8c..ca27717769 100755 --- a/ci/build_wheel_cpp.sh +++ b/ci/build_wheel_cpp.sh @@ -36,4 +36,6 @@ python -m auditwheel repair \ -w ${package_dir}/final_dist \ ${package_dir}/dist/* +./ci/validate_wheel.sh ${package_dir} final_dist + RAPIDS_PY_WHEEL_NAME="${package_name}_${RAPIDS_PY_CUDA_SUFFIX}" rapids-upload-wheels-to-s3 cpp "${package_dir}/final_dist" diff --git a/ci/build_wheel_python.sh b/ci/build_wheel_python.sh index 0c709f2fe6..088e8e8e8f 100755 --- a/ci/build_wheel_python.sh +++ b/ci/build_wheel_python.sh @@ -25,4 +25,6 @@ python -m auditwheel repair \ -w ${package_dir}/final_dist \ ${package_dir}/dist/* +./ci/validate_wheel.sh ${package_dir} final_dist + RAPIDS_PY_WHEEL_NAME="${package_name}_${RAPIDS_PY_CUDA_SUFFIX}" rapids-upload-wheels-to-s3 python ${package_dir}/final_dist diff --git a/ci/validate_wheel.sh b/ci/validate_wheel.sh new file mode 100755 index 0000000000..5910a5c59f --- /dev/null +++ b/ci/validate_wheel.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# Copyright (c) 2024, NVIDIA CORPORATION. + +set -euo pipefail + +package_dir=$1 +wheel_dir_relative_path=$2 + +cd "${package_dir}" + +rapids-logger "validate packages with 'pydistcheck'" + +pydistcheck \ + --inspect \ + "$(echo ${wheel_dir_relative_path}/*.whl)" + +rapids-logger "validate packages with 'twine'" + +twine check \ + --strict \ + "$(echo ${wheel_dir_relative_path}/*.whl)" diff --git a/python/kvikio/pyproject.toml b/python/kvikio/pyproject.toml index b002569646..cafde598bd 100644 --- a/python/kvikio/pyproject.toml +++ b/python/kvikio/pyproject.toml @@ -139,6 +139,14 @@ provider = "scikit_build_core.metadata.regex" input = "kvikio/VERSION" regex = "(?P.*)" +[tool.pydistcheck] +select = [ + "distro-too-large-compressed", +] + +# PyPI limit is 100 MiB, fail CI before we get too close to that +max_allowed_size_compressed = '75M' + [tool.pytest.ini_options] filterwarnings = [ "error", diff --git a/python/libkvikio/pyproject.toml b/python/libkvikio/pyproject.toml index 3be7cbc0ae..9504cb3755 100644 --- a/python/libkvikio/pyproject.toml +++ b/python/libkvikio/pyproject.toml @@ -59,3 +59,11 @@ requires = [ [project.entry-points."cmake.prefix"] libkvikio = "libkvikio" + +[tool.pydistcheck] +select = [ + "distro-too-large-compressed", +] + +# PyPI limit is 100 MiB, fail CI before we get too close to that +max_allowed_size_compressed = '75M'