diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh index c72dd946..e467a698 100755 --- a/ci/build_wheel.sh +++ b/ci/build_wheel.sh @@ -56,4 +56,6 @@ mkdir -p final_dist python -m auditwheel repair -w final_dist dist/* ls -1 final_dist | grep -vqz 'none' +../../ci/validate_wheel.sh final_dist + RAPIDS_PY_WHEEL_NAME="${package_name}_${RAPIDS_PY_CUDA_SUFFIX}" rapids-upload-wheels-to-s3 final_dist diff --git a/ci/validate_wheel.sh b/ci/validate_wheel.sh new file mode 100755 index 00000000..60a80fce --- /dev/null +++ b/ci/validate_wheel.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# Copyright (c) 2024, NVIDIA CORPORATION. + +set -euo pipefail + +wheel_dir_relative_path=$1 + +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/cucim/pyproject.toml b/python/cucim/pyproject.toml index 25248b3b..8b54160a 100644 --- a/python/cucim/pyproject.toml +++ b/python/cucim/pyproject.toml @@ -115,6 +115,14 @@ where = ["src"] [tool.setuptools.package-data] mypkg = ["*.pyi", "*.h", "*.cu", "VERSION"] +[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] # If a pytest section is found in one of the possible config files # (pytest.ini, tox.ini or setup.cfg), then pytest will not look for any others,