From af02428c68cdff621f8f1b81b8351a12ed2167b3 Mon Sep 17 00:00:00 2001 From: atalman Date: Thu, 6 Oct 2022 14:03:45 -0700 Subject: [PATCH 1/2] Fix upload channell using correct flag --- packaging/pkg_helpers.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packaging/pkg_helpers.bash b/packaging/pkg_helpers.bash index 7cf9113db2..5bdf5dd7c5 100644 --- a/packaging/pkg_helpers.bash +++ b/packaging/pkg_helpers.bash @@ -200,13 +200,13 @@ setup_pip_pytorch_version() { setup_conda_pytorch_constraint() { CONDA_CHANNEL_FLAGS=${CONDA_CHANNEL_FLAGS:-} if [[ -z "$PYTORCH_VERSION" ]]; then - export CONDA_CHANNEL_FLAGS="${CONDA_CHANNEL_FLAGS} -c pytorch-nightly" + export CONDA_CHANNEL_FLAGS="${CONDA_CHANNEL_FLAGS} -c pytorch-${UPLOAD_CHANNEL}" PYTHON="python" # Check if we have python 3 instead and prefer that if python3 --version >/dev/null 2>/dev/null; then PYTHON="python3" fi - export PYTORCH_VERSION="$(conda search --json 'pytorch[channel=pytorch-nightly]' | ${PYTHON} -c "import sys, json, re; print(re.sub(r'\\+.*$', '', json.load(sys.stdin)['pytorch'][-1]['version']))")" + export PYTORCH_VERSION="$(conda search --json 'pytorch[channel=pytorch-${UPLOAD_CHANNEL}]' | ${PYTHON} -c "import sys, json, re; print(re.sub(r'\\+.*$', '', json.load(sys.stdin)['pytorch'][-1]['version']))")" else export CONDA_CHANNEL_FLAGS="${CONDA_CHANNEL_FLAGS} -c pytorch -c pytorch-${UPLOAD_CHANNEL}" fi From 4e807215cf497113d1bd6a51d57d787b60aa4d40 Mon Sep 17 00:00:00 2001 From: atalman Date: Thu, 6 Oct 2022 14:17:34 -0700 Subject: [PATCH 2/2] Fix version extraction --- packaging/pkg_helpers.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/pkg_helpers.bash b/packaging/pkg_helpers.bash index 5bdf5dd7c5..b2f0809d06 100644 --- a/packaging/pkg_helpers.bash +++ b/packaging/pkg_helpers.bash @@ -206,7 +206,7 @@ setup_conda_pytorch_constraint() { if python3 --version >/dev/null 2>/dev/null; then PYTHON="python3" fi - export PYTORCH_VERSION="$(conda search --json 'pytorch[channel=pytorch-${UPLOAD_CHANNEL}]' | ${PYTHON} -c "import sys, json, re; print(re.sub(r'\\+.*$', '', json.load(sys.stdin)['pytorch'][-1]['version']))")" + export PYTORCH_VERSION="$(conda search --json pytorch[channel=pytorch-${UPLOAD_CHANNEL}] | ${PYTHON} -c "import sys, json, re; print(re.sub(r'\\+.*$', '', json.load(sys.stdin)['pytorch'][-1]['version']))")" else export CONDA_CHANNEL_FLAGS="${CONDA_CHANNEL_FLAGS} -c pytorch -c pytorch-${UPLOAD_CHANNEL}" fi