From fa8c755a6fa7346b20f0cb22159e57030ef0e869 Mon Sep 17 00:00:00 2001 From: Sing_chan <51314274+betterpig@users.noreply.github.com> Date: Wed, 18 May 2022 11:15:46 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90CI=E3=80=91support=20py3.6=20in=20wind?= =?UTF-8?q?ows-ci=20pipeline=20(#42711)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * set scipy and numpy version suit for py3.6 * pynacl1.5.0 which is needed by PyGithub built failed in python36, change it to 1.4.0 also works;test=document_fix;test=windows_ci * np.corrcoef support parameter since 1.20 * delete test code --- paddle/scripts/paddle_build.bat | 1 - python/paddle/fluid/tests/unittests/test_corr.py | 6 ++++++ python/unittest_py/requirements.txt | 6 ++++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/paddle/scripts/paddle_build.bat b/paddle/scripts/paddle_build.bat index 36154b23f3..326da03b0b 100644 --- a/paddle/scripts/paddle_build.bat +++ b/paddle/scripts/paddle_build.bat @@ -88,7 +88,6 @@ set UPLOAD_TP_FILE=OFF rem ------initialize set git config------ git config --global core.longpaths true - rem ------initialize the python environment------ set PYTHON_EXECUTABLE=%PYTHON_ROOT%\python.exe set PATH=%PYTHON_ROOT%\Scripts;%PYTHON_ROOT%;%PATH% diff --git a/python/paddle/fluid/tests/unittests/test_corr.py b/python/paddle/fluid/tests/unittests/test_corr.py index 99fd21c047..1e1dd3b369 100644 --- a/python/paddle/fluid/tests/unittests/test_corr.py +++ b/python/paddle/fluid/tests/unittests/test_corr.py @@ -18,9 +18,15 @@ import numpy as np import six import paddle import warnings +import sys + +np_minor_version = int((np.__version__).split('.')[1]) def numpy_corr(np_arr, rowvar=True, dtype='float64'): + # np.corrcoef support parameter 'dtype' since 1.20 + if np_minor_version < 20: + return np.corrcoef(np_arr, rowvar=rowvar) return np.corrcoef(np_arr, rowvar=rowvar, dtype=dtype) diff --git a/python/unittest_py/requirements.txt b/python/unittest_py/requirements.txt index ffc4fde7c2..7a48ff0148 100644 --- a/python/unittest_py/requirements.txt +++ b/python/unittest_py/requirements.txt @@ -1,3 +1,4 @@ +pynacl==1.4.0 ; python_version == "3.6" PyGithub coverage==5.5 pycrypto ; platform_system != "Windows" @@ -8,7 +9,8 @@ hypothesis opencv-python<=4.2.0.32 visualdl paddle2onnx>=0.8.2 -scipy>=1.6 +scipy>=1.6; python_version >= "3.7" +scipy>=1.5; python_version == "3.6" prettytable distro -numpy>=1.20,<1.22 +numpy>=1.20,<1.22; python_version >= "3.7" -- GitLab