-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Add smoke test for pyenv and split base.sh into base and base-t…
…emplate scripts (#315)
- Loading branch information
Showing
4 changed files
with
66 additions
and
50 deletions.
There are no files selected for viewing
1 change: 0 additions & 1 deletion
1
src/scicookie/{{cookiecutter.project_slug}}/virtualenvs/pyenv/requirements.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#!/usr/bin/env bash | ||
echo "-------------------- Smoke test for ${1} -------------------" | ||
set -ex | ||
|
||
export PATH_ORI=${PATH} | ||
export PWD_ORI=$(pwd) | ||
export PROJECT_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && cd ../.. && pwd )" | ||
|
||
export CONDA_PATH=$(ensureconda --conda --no-install | sed 's:/mamba$:/conda:') | ||
export MAMBA_PATH=$(ensureconda --mamba --no-install | sed 's:/conda$:/mamba:') | ||
|
||
if [[ ! -f "$MAMBA_PATH" ]]; then | ||
echo "[EE] 'mamba' not found." | ||
exit 1 | ||
fi | ||
|
||
if [[ ! -f "$CONDA_PATH" ]]; then | ||
echo "[EE] 'conda' not found." | ||
exit 1 | ||
fi | ||
|
||
export input_params="$1" | ||
|
||
if [[ "${input_params}" == *"use_conda=yes"* ]] || [[ "$input_params" == *"use_pyenv=yes"* ]]; then | ||
echo "Virtual environment defined." | ||
else | ||
export input_params="use_conda=yes ${input_params}" | ||
fi | ||
|
||
# NOTE: FOR NOW IT IS JUST USED BY POETRY | ||
export USE_PYENV=0 | ||
|
||
if [[ "${input_params}" == *"use_makim=yes"* ]] || [[ "$input_params" == *"use_make=yes"* ]]; then | ||
echo "Automation task tool defined." | ||
else | ||
export input_params="use_makim=yes ${input_params}" | ||
fi | ||
|
||
if [[ "${input_params}" == *"use_pre_commit=yes"* ]]; then | ||
echo "pre-commit tool defined." | ||
else | ||
export input_params="use_pre_commit=yes ${input_params}" | ||
fi | ||
|
||
export OUTPUT_DIR="/tmp/osl" | ||
rm -rf "${OUTPUT_DIR}" | ||
mkdir -p "${OUTPUT_DIR}" | ||
|
||
cookiecutter --no-input \ | ||
--output-dir "${OUTPUT_DIR}" \ | ||
"${PROJECT_PATH}/src/scicookie" \ | ||
${input_params} | ||
|
||
echo "${OUTPUT_DIR}" | ||
|
||
set +ex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
set -ex | ||
|
||
SMOKE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | ||
|
||
|
||
. ${SMOKE_DIR}/base.sh "use_conda=yes" | ||
. ${SMOKE_DIR}/base.sh "use_pyenv=yes" | ||
|
||
set +ex |