Skip to content

Commit

Permalink
swancustomenvironments: Stop at the first error found
Browse files Browse the repository at this point in the history
Stop the env creation process when the first error on the requirements installation is found
  • Loading branch information
rodrigo-sobral authored and etejedor committed Nov 25, 2024
1 parent 445d7ee commit 84a7253
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ eval "${ACTIVATE_ENV_CMD}"
# Install packages in the environment and the same ipykernel that the Jupyter server uses
_log "Installing packages from ${REQ_PATH}..."
pip install -r "${REQ_PATH}" "ipykernel==${IPYKERNEL_VERSION}" ${NXCALS} ${SPARKMONITOR} ${SPARKCONNECTOR_DEPENDENCIES} 2>&1 # TODO
if [ $? -ne 0 ]; then
exit 1
fi


# -------------- HACK SECTION --------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

# Create the environment, install packages and the same ipykernel that the Jupyter server uses
mamba create -p ${ENV_PATH} --file ${REQ_PATH} "ipykernel==${IPYKERNEL_VERSION}" -y
if [ $? -ne 0 ]; then
exit 1
fi

# Activate the environment
_log "Setting up the environment..."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ eval "${ACTIVATE_ENV_CMD}"
# Install packages in the environment and the same ipykernel that the Jupyter server uses
_log "Installing packages from ${REQ_PATH}..."
pip install -r "${REQ_PATH}" "ipykernel==${IPYKERNEL_VERSION}" 2>&1
if [ $? -ne 0 ]; then
exit 1
fi

0 comments on commit 84a7253

Please sign in to comment.