Skip to content

Commit

Permalink
Updated setup.py for hyperoptsklearn as it no longer uses PyPi (als…
Browse files Browse the repository at this point in the history
…o now accepts shas) (#410)

* Updated hyper opt not to use PyPi and accept shas

* case-sensitive PIP command in setup

Co-authored-by: Sebastien Poirier <sebastien@h2o.ai>
  • Loading branch information
eddiebergman and Sebastien Poirier authored Aug 16, 2022
1 parent 88186b3 commit f55cd0b
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions frameworks/hyperoptsklearn/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,27 @@ HERE=$(dirname "$0")
VERSION=${1:-"stable"}
REPO=${2:-"https://github.com/hyperopt/hyperopt-sklearn.git"}
PKG=${3:-"hyperopt-sklearn"}
if [[ "$VERSION" == "latest" ]]; then

if [[ "$VERSION" == "latest" || "$VERSION" == "stable" ]]; then
VERSION="master"
fi

. ${HERE}/../shared/setup.sh ${HERE} true

if [[ "$VERSION" == "stable" ]]; then
PIP install --no-cache-dir -U ${PKG}
elif [[ "$VERSION" =~ ^[0-9] ]]; then
PIP install --no-cache-dir -U ${PKG}==${VERSION}
if [[ "$VERSION" =~ ^[0-9] ]]; then
PIP install git+https://github.com/hyperopt/hyperopt-sklearn@${VERSION}
else
# PIP install --no-cache-dir -e git+${REPO}@${VERSION}#egg=${PKG}
LIB=$(echo ${PKG} | sed "s/\[.*\]//")
TARGET_DIR="${HERE}/lib/${LIB}"
rm -Rf ${TARGET_DIR}
git clone --depth 1 --single-branch --branch ${VERSION} --recurse-submodules ${REPO} ${TARGET_DIR}
if [[ "$VERSION" =~ ^# ]]; then
git clone --recurse-submodules --shallow-submodules ${REPO} ${TARGET_DIR}
cd ${TARGET_DIR}
git checkout "${VERSION:1}"
cd ${HERE}
else
git clone --depth 1 --single-branch --branch ${VERSION} --recurse-submodules ${REPO} ${TARGET_DIR}
fi
PIP install -U -e ${HERE}/lib/${PKG}
fi

0 comments on commit f55cd0b

Please sign in to comment.