From 6e7241691adfb6429285f01ff13f5c8dd9306e3e Mon Sep 17 00:00:00 2001 From: Eli Uriegas <1700823+seemethere@users.noreply.github.com> Date: Mon, 21 Jun 2021 13:53:06 -0700 Subject: [PATCH] ci: Remove mentions of conda-forge (#4082) (cherry picked from commit d391a0e992a35d7fb01e11110e2ccf8e445ad8a0) Signed-off-by: Eli Uriegas --- .circleci/config.yml | 15 +++++---------- .circleci/config.yml.in | 15 +++++---------- .circleci/unittest/linux/scripts/environment.yml | 2 -- .circleci/unittest/linux/scripts/install.sh | 2 +- .../unittest/windows/scripts/environment.yml | 2 -- .circleci/unittest/windows/scripts/install.sh | 2 +- CONTRIBUTING.md | 2 +- packaging/build_conda.sh | 3 ++- packaging/pkg_helpers.bash | 12 +++--------- packaging/torchvision/meta.yaml | 1 - 10 files changed, 18 insertions(+), 38 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e962a91c78e..d1b5c95c61c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -309,6 +309,10 @@ jobs: eval "$('/C/tools/miniconda3/Scripts/conda.exe' 'shell.bash' 'hook')" conda activate base conda install -yq conda-build "conda-package-handling!=1.5.0" + # cudatoolkit >= 11 isn't available for windows in the nvidia channel + if [[ "${CU_VERSION}" =~ cu11.* ]]; then + export CONDA_CHANNEL_FLAGS="-c conda-forge" + fi packaging/build_conda.sh rm /C/tools/miniconda3/conda-bld/win-64/vs${VC_YEAR}*.tar.bz2 - store_artifacts: @@ -580,11 +584,7 @@ jobs: set -x eval "$('/C/tools/miniconda3/Scripts/conda.exe' 'shell.bash' 'hook')" conda env remove -n python${PYTHON_VERSION} || true - CONDA_CHANNEL_FLAGS="" - if [[ "${PYTHON_VERSION}" = 3.9 ]]; then - CONDA_CHANNEL_FLAGS="-c=conda-forge" - fi - conda create ${CONDA_CHANNEL_FLAGS} -yn python${PYTHON_VERSION} python=${PYTHON_VERSION} + conda create -yn python${PYTHON_VERSION} python=${PYTHON_VERSION} conda activate python${PYTHON_VERSION} conda install Pillow>=5.3.0 conda install -v -y -c pytorch-nightly pytorch @@ -609,11 +609,6 @@ jobs: command: | set -x eval "$('/C/tools/miniconda3/Scripts/conda.exe' 'shell.bash' 'hook')" - CONDA_CHANNEL_FLAGS="" - if [[ "${PYTHON_VERSION}" = 3.9 ]]; then - CONDA_CHANNEL_FLAGS="-c=conda-forge" - fi - conda create ${CONDA_CHANNEL_FLAGS} -yn python${PYTHON_VERSION} python=${PYTHON_VERSION} conda create -yn python${PYTHON_VERSION} python=${PYTHON_VERSION} conda activate python${PYTHON_VERSION} pip install $(ls ~/workspace/torchvision*.whl) --pre -f https://download.pytorch.org/whl/nightly/torch_nightly.html diff --git a/.circleci/config.yml.in b/.circleci/config.yml.in index 65f668e1b37..b5465e02cf3 100644 --- a/.circleci/config.yml.in +++ b/.circleci/config.yml.in @@ -309,6 +309,10 @@ jobs: eval "$('/C/tools/miniconda3/Scripts/conda.exe' 'shell.bash' 'hook')" conda activate base conda install -yq conda-build "conda-package-handling!=1.5.0" + # cudatoolkit >= 11 isn't available for windows in the nvidia channel + if [[ "${CU_VERSION}" =~ cu11.* ]]; then + export CONDA_CHANNEL_FLAGS="-c conda-forge" + fi packaging/build_conda.sh rm /C/tools/miniconda3/conda-bld/win-64/vs${VC_YEAR}*.tar.bz2 - store_artifacts: @@ -580,11 +584,7 @@ jobs: set -x eval "$('/C/tools/miniconda3/Scripts/conda.exe' 'shell.bash' 'hook')" conda env remove -n python${PYTHON_VERSION} || true - CONDA_CHANNEL_FLAGS="" - if [[ "${PYTHON_VERSION}" = 3.9 ]]; then - CONDA_CHANNEL_FLAGS="-c=conda-forge" - fi - conda create ${CONDA_CHANNEL_FLAGS} -yn python${PYTHON_VERSION} python=${PYTHON_VERSION} + conda create -yn python${PYTHON_VERSION} python=${PYTHON_VERSION} conda activate python${PYTHON_VERSION} conda install Pillow>=5.3.0 conda install -v -y -c pytorch-nightly pytorch @@ -609,11 +609,6 @@ jobs: command: | set -x eval "$('/C/tools/miniconda3/Scripts/conda.exe' 'shell.bash' 'hook')" - CONDA_CHANNEL_FLAGS="" - if [[ "${PYTHON_VERSION}" = 3.9 ]]; then - CONDA_CHANNEL_FLAGS="-c=conda-forge" - fi - conda create ${CONDA_CHANNEL_FLAGS} -yn python${PYTHON_VERSION} python=${PYTHON_VERSION} conda create -yn python${PYTHON_VERSION} python=${PYTHON_VERSION} conda activate python${PYTHON_VERSION} pip install $(ls ~/workspace/torchvision*.whl) --pre -f https://download.pytorch.org/whl/nightly/torch_nightly.html diff --git a/.circleci/unittest/linux/scripts/environment.yml b/.circleci/unittest/linux/scripts/environment.yml index fcf61a6e2f8..b2efb93de75 100644 --- a/.circleci/unittest/linux/scripts/environment.yml +++ b/.circleci/unittest/linux/scripts/environment.yml @@ -1,8 +1,6 @@ channels: - pytorch - defaults - # using conda-forge for python v3.9 - - conda-forge dependencies: - pytest - pytest-cov diff --git a/.circleci/unittest/linux/scripts/install.sh b/.circleci/unittest/linux/scripts/install.sh index 7058e4d7095..e9b9e80c077 100755 --- a/.circleci/unittest/linux/scripts/install.sh +++ b/.circleci/unittest/linux/scripts/install.sh @@ -24,7 +24,7 @@ else fi printf "Installing PyTorch with %s\n" "${cudatoolkit}" -conda install -y -c "pytorch-${UPLOAD_CHANNEL}" -c conda-forge "pytorch-${UPLOAD_CHANNEL}"::pytorch "${cudatoolkit}" pytest +conda install -y -c "pytorch-${UPLOAD_CHANNEL}" "pytorch-${UPLOAD_CHANNEL}"::pytorch "${cudatoolkit}" pytest if [ $PYTHON_VERSION == "3.6" ]; then printf "Installing minimal PILLOW version\n" diff --git a/.circleci/unittest/windows/scripts/environment.yml b/.circleci/unittest/windows/scripts/environment.yml index 9a916a27d07..da2f502f3fe 100644 --- a/.circleci/unittest/windows/scripts/environment.yml +++ b/.circleci/unittest/windows/scripts/environment.yml @@ -1,8 +1,6 @@ channels: - pytorch - defaults - # use conda-forge for python v3.9+ - - conda-forge dependencies: - pytest - pytest-cov diff --git a/.circleci/unittest/windows/scripts/install.sh b/.circleci/unittest/windows/scripts/install.sh index a90e88a71d4..45e381c775b 100644 --- a/.circleci/unittest/windows/scripts/install.sh +++ b/.circleci/unittest/windows/scripts/install.sh @@ -26,7 +26,7 @@ else fi printf "Installing PyTorch with %s\n" "${cudatoolkit}" -conda install -y -c "pytorch-${UPLOAD_CHANNEL}" -c conda-forge "pytorch-${UPLOAD_CHANNEL}"::pytorch "${cudatoolkit}" pytest +conda install -y -c "pytorch-${UPLOAD_CHANNEL}" "pytorch-${UPLOAD_CHANNEL}"::pytorch "${cudatoolkit}" pytest if [ $PYTHON_VERSION == "3.6" ]; then printf "Installing minimal PILLOW version\n" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 748dc50df9e..0f8a6bd83b8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -33,7 +33,7 @@ clear and has sufficient instructions to be able to reproduce the issue. ### Install PyTorch Nightly ```bash -conda install pytorch -c pytorch-nightly -c conda-forge +conda install pytorch -c pytorch-nightly # or with pip (see https://pytorch.org/get-started/locally/) # pip install numpy # pip install --pre torch -f https://download.pytorch.org/whl/nightly/cu102/torch_nightly.html diff --git a/packaging/build_conda.sh b/packaging/build_conda.sh index 5f2239aae7e..ffdec1f3849 100755 --- a/packaging/build_conda.sh +++ b/packaging/build_conda.sh @@ -11,4 +11,5 @@ setup_conda_pytorch_constraint setup_conda_cudatoolkit_constraint setup_visual_studio_constraint setup_junit_results_folder -conda build $CONDA_CHANNEL_FLAGS -c defaults -c conda-forge --no-anaconda-upload --python "$PYTHON_VERSION" packaging/torchvision +# nvidia channel included for cudatoolkit >= 11 +conda build -c defaults -c nvidia $CONDA_CHANNEL_FLAGS --no-anaconda-upload --python "$PYTHON_VERSION" packaging/torchvision diff --git a/packaging/pkg_helpers.bash b/packaging/pkg_helpers.bash index 48f7588594a..dfde11b707a 100644 --- a/packaging/pkg_helpers.bash +++ b/packaging/pkg_helpers.bash @@ -180,13 +180,10 @@ setup_wheel_python() { if [[ "$(uname)" == Darwin || "$OSTYPE" == "msys" ]]; then eval "$(conda shell.bash hook)" conda env remove -n "env$PYTHON_VERSION" || true - if [[ "$PYTHON_VERSION" == 3.9 ]]; then - export CONDA_CHANNEL_FLAGS="${CONDA_CHANNEL_FLAGS} -c=conda-forge" - fi conda create ${CONDA_CHANNEL_FLAGS} -yn "env$PYTHON_VERSION" python="$PYTHON_VERSION" conda activate "env$PYTHON_VERSION" # Install libpng from Anaconda (defaults) - conda install ${CONDA_CHANNEL_FLAGS} -c conda-forge libpng "jpeg<=9b" -y + conda install ${CONDA_CHANNEL_FLAGS} libpng "jpeg<=9b" -y else # Install native CentOS libJPEG, LAME, freetype and GnuTLS yum install -y libjpeg-turbo-devel lame freetype gnutls @@ -250,7 +247,7 @@ setup_pip_pytorch_version() { # You MUST have populated PYTORCH_VERSION_SUFFIX before hand. setup_conda_pytorch_constraint() { if [[ -z "$PYTORCH_VERSION" ]]; then - export CONDA_CHANNEL_FLAGS="-c pytorch-nightly -c pytorch" + export CONDA_CHANNEL_FLAGS="${CONDA_CHANNEL_FLAGS} -c pytorch-nightly -c pytorch" export PYTORCH_VERSION="$(conda search --json 'pytorch[channel=pytorch-nightly]' | \ python -c "import os, sys, json, re; cuver = os.environ.get('CU_VERSION'); \ cuver_1 = cuver.replace('cu', 'cuda') if cuver != 'cpu' else cuver; \ @@ -265,7 +262,7 @@ setup_conda_pytorch_constraint() { exit 1 fi else - export CONDA_CHANNEL_FLAGS="-c pytorch -c pytorch-${UPLOAD_CHANNEL}" + export CONDA_CHANNEL_FLAGS="${CONDA_CHANNEL_FLAGS} -c pytorch -c pytorch-${UPLOAD_CHANNEL}" fi if [[ "$CU_VERSION" == cpu ]]; then export CONDA_PYTORCH_BUILD_CONSTRAINT="- pytorch==$PYTORCH_VERSION${PYTORCH_VERSION_SUFFIX}" @@ -277,9 +274,6 @@ setup_conda_pytorch_constraint() { if [[ "$OSTYPE" == msys && "$CU_VERSION" == cu92 ]]; then export CONDA_CHANNEL_FLAGS="${CONDA_CHANNEL_FLAGS} -c defaults -c numba/label/dev" fi - if [[ "$PYTHON_VERSION" == 3.9 ]]; then - export CONDA_CHANNEL_FLAGS="${CONDA_CHANNEL_FLAGS} -c=conda-forge" - fi } # Translate CUDA_VERSION into CUDA_CUDATOOLKIT_CONSTRAINT diff --git a/packaging/torchvision/meta.yaml b/packaging/torchvision/meta.yaml index c9b6d04fdc7..222071ede93 100644 --- a/packaging/torchvision/meta.yaml +++ b/packaging/torchvision/meta.yaml @@ -52,7 +52,6 @@ test: requires: - pytest - scipy - - av # NOTE: Pinned to fix issues with size_t on Windows - jpeg <=9b - ca-certificates