From a0f53fc9b3fd97b0fab091c2554d0390a5b28568 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Tue, 18 Apr 2023 20:57:56 -0500 Subject: [PATCH 01/11] [ci] [python-package] check distributions with pydistcheck --- .ci/check_python_dists.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.ci/check_python_dists.sh b/.ci/check_python_dists.sh index e7e4a86b47e4..a3c6786f62d6 100644 --- a/.ci/check_python_dists.sh +++ b/.ci/check_python_dists.sh @@ -7,6 +7,7 @@ echo "checking Python package distributions in '${DIST_DIR}'" pip install \ -qq \ check-wheel-contents \ + pydistcheck \ twine || exit -1 echo "twine check..." @@ -17,4 +18,9 @@ if { test "${TASK}" = "bdist" || test "${METHOD}" = "wheel"; }; then check-wheel-contents ${DIST_DIR}/*.whl || exit -1 fi +echo "pydistcheck..." +pydistcheck \ + --inspect \ + ${DIST_DIR}/* + echo "done checking Python package distributions" From d4349bbf3496d848a1eb0414113916cc0a2b6682 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Tue, 18 Apr 2023 21:08:35 -0500 Subject: [PATCH 02/11] add limits on size and files --- .ci/check_python_dists.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.ci/check_python_dists.sh b/.ci/check_python_dists.sh index a3c6786f62d6..d8aabdd53994 100644 --- a/.ci/check_python_dists.sh +++ b/.ci/check_python_dists.sh @@ -21,6 +21,9 @@ fi echo "pydistcheck..." pydistcheck \ --inspect \ + --max-allow-size-compressed '5M' \ + --max-allow-size-uncompressed '15M' \ + --max-allowed-files 800 \ ${DIST_DIR}/* echo "done checking Python package distributions" From b7cce129a184e7c3dd53280b75f843cdfa1620d0 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Tue, 18 Apr 2023 21:18:33 -0500 Subject: [PATCH 03/11] ensure failures fail CI --- .ci/check_python_dists.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.ci/check_python_dists.sh b/.ci/check_python_dists.sh index d8aabdd53994..48b29d21172b 100644 --- a/.ci/check_python_dists.sh +++ b/.ci/check_python_dists.sh @@ -21,9 +21,9 @@ fi echo "pydistcheck..." pydistcheck \ --inspect \ - --max-allow-size-compressed '5M' \ - --max-allow-size-uncompressed '15M' \ + --max-allowed-size-compressed '5M' \ + --max-allowed-size-uncompressed '15M' \ --max-allowed-files 800 \ - ${DIST_DIR}/* + ${DIST_DIR}/* || exit -1 echo "done checking Python package distributions" From 93462dfc64bf7699a8550445f7a52ebcfa7a7d7d Mon Sep 17 00:00:00 2001 From: James Lamb Date: Tue, 18 Apr 2023 23:03:20 -0500 Subject: [PATCH 04/11] skip on Python 3.7 --- .ci/check_python_dists.sh | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/.ci/check_python_dists.sh b/.ci/check_python_dists.sh index 48b29d21172b..2427e7ac53a9 100644 --- a/.ci/check_python_dists.sh +++ b/.ci/check_python_dists.sh @@ -7,7 +7,7 @@ echo "checking Python package distributions in '${DIST_DIR}'" pip install \ -qq \ check-wheel-contents \ - pydistcheck \ + 'pydistcheck; python_version>=3.8' \ twine || exit -1 echo "twine check..." @@ -18,12 +18,17 @@ if { test "${TASK}" = "bdist" || test "${METHOD}" = "wheel"; }; then check-wheel-contents ${DIST_DIR}/*.whl || exit -1 fi -echo "pydistcheck..." -pydistcheck \ - --inspect \ - --max-allowed-size-compressed '5M' \ - --max-allowed-size-uncompressed '15M' \ - --max-allowed-files 800 \ - ${DIST_DIR}/* || exit -1 +PY_MINOR_VER=$(python -c "import sys; print(sys.version_info.minor)") +if [ $PY_MINOR_VER -gt 7 ]; then + echo "pydistcheck..." + pydistcheck \ + --inspect \ + --max-allowed-size-compressed '5M' \ + --max-allowed-size-uncompressed '15M' \ + --max-allowed-files 800 \ + ${DIST_DIR}/* || exit -1 +else + echo "skipping pydistcheck (does not support Python 3.${PY_MINOR_VER})" +fi echo "done checking Python package distributions" From 8449ff45834988fd73a58d68074efce5802ef753 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Tue, 18 Apr 2023 23:13:40 -0500 Subject: [PATCH 05/11] more Python 3.7 fixes --- .ci/check_python_dists.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/check_python_dists.sh b/.ci/check_python_dists.sh index 2427e7ac53a9..08a848f31d0f 100644 --- a/.ci/check_python_dists.sh +++ b/.ci/check_python_dists.sh @@ -7,7 +7,6 @@ echo "checking Python package distributions in '${DIST_DIR}'" pip install \ -qq \ check-wheel-contents \ - 'pydistcheck; python_version>=3.8' \ twine || exit -1 echo "twine check..." @@ -21,6 +20,7 @@ fi PY_MINOR_VER=$(python -c "import sys; print(sys.version_info.minor)") if [ $PY_MINOR_VER -gt 7 ]; then echo "pydistcheck..." + pip install pydistcheck pydistcheck \ --inspect \ --max-allowed-size-compressed '5M' \ From ce8e43097bd2341885a88aa8953c6416d3fefc68 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Thu, 20 Apr 2023 23:18:44 -0500 Subject: [PATCH 06/11] add exceptions for CUDA and QEMU builds --- .ci/check_python_dists.sh | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/.ci/check_python_dists.sh b/.ci/check_python_dists.sh index 08a848f31d0f..929d5b9d58ca 100644 --- a/.ci/check_python_dists.sh +++ b/.ci/check_python_dists.sh @@ -21,12 +21,29 @@ PY_MINOR_VER=$(python -c "import sys; print(sys.version_info.minor)") if [ $PY_MINOR_VER -gt 7 ]; then echo "pydistcheck..." pip install pydistcheck - pydistcheck \ - --inspect \ - --max-allowed-size-compressed '5M' \ - --max-allowed-size-uncompressed '15M' \ - --max-allowed-files 800 \ - ${DIST_DIR}/* || exit -1 + if [ $TASK == "CUDA" ] && [ $METHOD == "wheel" ]; then + pydistcheck \ + --inspect \ + --ignore 'compiled-objects-have-debug-symbols,max-allowed-size-compressed' \ + --max-allowed-size-uncompressed '60M' \ + --max-allowed-files 800 \ + ${DIST_DIR}/* || exit -1 + elif [ $ARCH == "aarch64" ]; then + pydistcheck \ + --inspect \ + --ignore 'compiled-objects-have-debug-symbols' \ + --max-allowed-size-compressed '5M' \ + --max-allowed-size-uncompressed '15M' \ + --max-allowed-files 800 \ + ${DIST_DIR}/* || exit -1 + else + pydistcheck \ + --inspect \ + --max-allowed-size-compressed '5M' \ + --max-allowed-size-uncompressed '15M' \ + --max-allowed-files 800 \ + ${DIST_DIR}/* || exit -1 + fi else echo "skipping pydistcheck (does not support Python 3.${PY_MINOR_VER})" fi From a0c10fef7fb65b13ff2e70dd46212ffd308f8389 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Thu, 20 Apr 2023 23:51:25 -0500 Subject: [PATCH 07/11] lowercase cuda --- .ci/check_python_dists.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/check_python_dists.sh b/.ci/check_python_dists.sh index 929d5b9d58ca..f84099670e21 100644 --- a/.ci/check_python_dists.sh +++ b/.ci/check_python_dists.sh @@ -21,7 +21,7 @@ PY_MINOR_VER=$(python -c "import sys; print(sys.version_info.minor)") if [ $PY_MINOR_VER -gt 7 ]; then echo "pydistcheck..." pip install pydistcheck - if [ $TASK == "CUDA" ] && [ $METHOD == "wheel" ]; then + if [ $TASK == "cuda" ] && [ $METHOD == "wheel" ]; then pydistcheck \ --inspect \ --ignore 'compiled-objects-have-debug-symbols,max-allowed-size-compressed' \ From a0f055652920462618e92046f3ca5378d2932b4f Mon Sep 17 00:00:00 2001 From: James Lamb Date: Fri, 21 Apr 2023 00:18:50 -0500 Subject: [PATCH 08/11] fix conditions --- .ci/check_python_dists.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/check_python_dists.sh b/.ci/check_python_dists.sh index f84099670e21..053a03d99021 100644 --- a/.ci/check_python_dists.sh +++ b/.ci/check_python_dists.sh @@ -21,14 +21,14 @@ PY_MINOR_VER=$(python -c "import sys; print(sys.version_info.minor)") if [ $PY_MINOR_VER -gt 7 ]; then echo "pydistcheck..." pip install pydistcheck - if [ $TASK == "cuda" ] && [ $METHOD == "wheel" ]; then + if [[ "${TASK}" = "cuda" ]] && [[ "${METHOD}" = "wheel" ]]; then pydistcheck \ --inspect \ --ignore 'compiled-objects-have-debug-symbols,max-allowed-size-compressed' \ --max-allowed-size-uncompressed '60M' \ --max-allowed-files 800 \ ${DIST_DIR}/* || exit -1 - elif [ $ARCH == "aarch64" ]; then + elif [[ $(uname -m) == "aarch64" ]]; then pydistcheck \ --inspect \ --ignore 'compiled-objects-have-debug-symbols' \ From 497ed7cd930259479c449a2e53d04939320407f5 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Fri, 21 Apr 2023 09:34:31 -0500 Subject: [PATCH 09/11] fix conditions --- .ci/check_python_dists.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/check_python_dists.sh b/.ci/check_python_dists.sh index 053a03d99021..cb995e039ad9 100644 --- a/.ci/check_python_dists.sh +++ b/.ci/check_python_dists.sh @@ -21,7 +21,7 @@ PY_MINOR_VER=$(python -c "import sys; print(sys.version_info.minor)") if [ $PY_MINOR_VER -gt 7 ]; then echo "pydistcheck..." pip install pydistcheck - if [[ "${TASK}" = "cuda" ]] && [[ "${METHOD}" = "wheel" ]]; then + if [[ "${TASK}" == "cuda" ]] && [[ "${METHOD}" == "wheel" ]]; then pydistcheck \ --inspect \ --ignore 'compiled-objects-have-debug-symbols,max-allowed-size-compressed' \ From 8bb51b0b3797e5307e84ab249202168c237d01d5 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Fri, 21 Apr 2023 11:23:25 -0500 Subject: [PATCH 10/11] sh not bash-style syntax --- .ci/check_python_dists.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/check_python_dists.sh b/.ci/check_python_dists.sh index cb995e039ad9..0fd6de0c12b1 100644 --- a/.ci/check_python_dists.sh +++ b/.ci/check_python_dists.sh @@ -21,14 +21,14 @@ PY_MINOR_VER=$(python -c "import sys; print(sys.version_info.minor)") if [ $PY_MINOR_VER -gt 7 ]; then echo "pydistcheck..." pip install pydistcheck - if [[ "${TASK}" == "cuda" ]] && [[ "${METHOD}" == "wheel" ]]; then + if { test "${TASK}" = "cuda" || test "${METHOD}" = "wheel"; }; then pydistcheck \ --inspect \ --ignore 'compiled-objects-have-debug-symbols,max-allowed-size-compressed' \ --max-allowed-size-uncompressed '60M' \ --max-allowed-files 800 \ ${DIST_DIR}/* || exit -1 - elif [[ $(uname -m) == "aarch64" ]]; then + elif { test $(uname -m) = "aarch64"; }; then pydistcheck \ --inspect \ --ignore 'compiled-objects-have-debug-symbols' \ From f0f382ac1ad24d8d085aa9c21344643d6ac1787c Mon Sep 17 00:00:00 2001 From: James Lamb Date: Fri, 21 Apr 2023 14:37:40 -0500 Subject: [PATCH 11/11] fix condition --- .ci/check_python_dists.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/check_python_dists.sh b/.ci/check_python_dists.sh index 0fd6de0c12b1..cb0bbae79fa9 100644 --- a/.ci/check_python_dists.sh +++ b/.ci/check_python_dists.sh @@ -24,7 +24,7 @@ if [ $PY_MINOR_VER -gt 7 ]; then if { test "${TASK}" = "cuda" || test "${METHOD}" = "wheel"; }; then pydistcheck \ --inspect \ - --ignore 'compiled-objects-have-debug-symbols,max-allowed-size-compressed' \ + --ignore 'compiled-objects-have-debug-symbols,distro-too-large-compressed' \ --max-allowed-size-uncompressed '60M' \ --max-allowed-files 800 \ ${DIST_DIR}/* || exit -1