diff --git a/.appveyor.yml b/.appveyor.yml index ba85fac817ab..2d279b0f33e3 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -36,6 +36,8 @@ install: build: false test_script: + - conda config --remove channels defaults + - conda config --add channels nodefaults - conda config --add channels conda-forge - conda config --set channel_priority strict - conda init powershell diff --git a/.ci/test_windows.ps1 b/.ci/test_windows.ps1 index 6c0ffb8249f0..79b35faaff10 100644 --- a/.ci/test_windows.ps1 +++ b/.ci/test_windows.ps1 @@ -25,16 +25,6 @@ if ($env:TASK -eq "cpp-tests") { Exit 0 } -# setup for Python -conda init powershell -conda activate -conda config --set always_yes yes --set changeps1 no -conda update -q -y conda -conda create -q -y -n $env:CONDA_ENV "python=$env:PYTHON_VERSION[build=*cpython]" ; Check-Output $? -if ($env:TASK -ne "bdist") { - conda activate $env:CONDA_ENV -} - if ($env:TASK -eq "swig") { $env:JAVA_HOME = $env:JAVA_HOME_8_X64 # there is pre-installed Eclipse Temurin 8 somewhere $ProgressPreference = "SilentlyContinue" # progress bar bug extremely slows down download speed @@ -50,8 +40,27 @@ if ($env:TASK -eq "swig") { Exit 0 } -# re-including python=version[build=*cpython] to ensure that conda doesn't fall back to pypy -conda install -q -y -n $env:CONDA_ENV cloudpickle joblib matplotlib numpy pandas psutil pytest "python=$env:PYTHON_VERSION[build=*cpython]" python-graphviz scikit-learn scipy ; Check-Output $? +# setup for Python +conda init powershell +conda activate +conda config --set always_yes yes --set changeps1 no +conda update -q -y conda +conda create -q -y -n $env:CONDA_ENV ` + cloudpickle ` + joblib ` + matplotlib ` + numpy ` + pandas ` + psutil ` + pytest ` + "python=$env:PYTHON_VERSION[build=*cpython]" ` + python-graphviz ` + scikit-learn ` + scipy ; Check-Output $? + +if ($env:TASK -ne "bdist") { + conda activate $env:CONDA_ENV +} if ($env:TASK -eq "regular") { mkdir $env:BUILD_SOURCESDIRECTORY/build; cd $env:BUILD_SOURCESDIRECTORY/build diff --git a/.vsts-ci.yml b/.vsts-ci.yml index a01e994e0a91..af0d63322004 100644 --- a/.vsts-ci.yml +++ b/.vsts-ci.yml @@ -283,6 +283,8 @@ jobs: condition: eq(variables['TASK'], 'bdist') displayName: 'Install OpenCL' - script: | + cmd /c "conda config --remove channels defaults" + cmd /c "conda config --add channels nodefaults" cmd /c "conda config --add channels conda-forge" cmd /c "conda config --set channel_priority strict" cmd /c "conda init powershell"