Skip to content

Commit

Permalink
Add constraint for version to conda build when in test channel (#4806)
Browse files Browse the repository at this point in the history
Cherry Pick of: #4805
Fixes conda prioritizing latest version rather then required version
  • Loading branch information
atalman authored Dec 13, 2023
1 parent d0f7bc9 commit 5c9a8cd
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/build_conda_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -181,14 +181,19 @@ jobs:
CONSTRAINTS="cpuonly"
fi
CONSTRAINT_BUILD=""
if [[ "${CHANNEL}" = "test" ]]; then
CONSTRAINT_BUILD="=${BUILD_VERSION}"
fi
${CONDA_RUN_SMOKE} conda install \
--yes \
--quiet \
-c "${CONDA_LOCAL_CHANNEL}" \
-c pytorch-"${CHANNEL}" \
-c nvidia \
-c defaults \
"${PACKAGE_NAME}" \
"${PACKAGE_NAME}${CONSTRAINT_BUILD}" \
${CONSTRAINTS} \
--override-channels
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/build_conda_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,18 @@ jobs:
export PATH="${CONDA_ENV_SMOKE}/bin:${PATH}"
CONDA_LOCAL_CHANNEL="file://$(readlink -f ${{ inputs.repository }}/distr)"
CONSTRAINT_BUILD=""
if [[ "${CHANNEL}" = "test" ]]; then
CONSTRAINT_BUILD="=${BUILD_VERSION}"
fi
${CONDA_RUN_SMOKE} conda install \
--quiet \
--yes \
-c "${CONDA_LOCAL_CHANNEL}" \
-c pytorch-${CHANNEL} \
-c defaults \
"${PACKAGE_NAME}" \
"${PACKAGE_NAME}${CONSTRAINT_BUILD}" \
"--override-channels"
# check for installed package channel
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/build_conda_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,14 +206,19 @@ jobs:
CONSTRAINTS="cpuonly"
fi
CONSTRAINT_BUILD=""
if [[ "${CHANNEL}" = "test" ]]; then
CONSTRAINT_BUILD="=${BUILD_VERSION}"
fi
${CONDA_RUN_SMOKE} conda install \
--quiet \
--yes \
-c "${CONDA_LOCAL_CHANNEL}" \
-c pytorch-"${CHANNEL}" \
-c nvidia \
-c defaults \
"${PACKAGE_NAME}" \
"${PACKAGE_NAME}${CONSTRAINT_BUILD}" \
${CONSTRAINTS} \
--override-channels
Expand Down

0 comments on commit 5c9a8cd

Please sign in to comment.