New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Created development install script #67
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/usr/bin/env bash | ||
|
||
# References | ||
# http://kvz.io/blog/2013/11/21/bash-best-practices/ | ||
# http://jvns.ca/blog/2017/03/26/bash-quirks/ | ||
|
||
# exit when a command fails | ||
set -o errexit | ||
|
||
# exit if any pipe commands fail | ||
set -o pipefail | ||
|
||
set -E | ||
set -o functrace | ||
function handle_error { | ||
local retval=$? | ||
local line=${last_lineno:-$1} | ||
echo "Failed at $line: $BASH_COMMAND" | ||
echo "Trace: " "$@" | ||
echo "return code: " "$?" | ||
exit $retval | ||
} | ||
trap 'handle_error $LINENO ${BASH_LINENO[@]}' ERR | ||
|
||
CONDA_EXE="$(which conda)" | ||
$CONDA_EXE create -y -n jupyter-vcdat3 -c cdat/label/v81 -c conda-forge nodejs "python>3" vcs jupyterlab pip nb_conda nb_conda_kernels plumbum | ||
CONDA_BASE=$(conda info --base) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure what these line do since There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I had to source the conda.sh as a workaround because the conda executable was not being found in the child process that the script was running in. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @William-Hill that's my point, how can There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess it can find the executable, but not the activate function as mentioned here: conda/conda#7980 (comment) That's what I used as a reference for my workaround. Sourcing conda.sh makes the activate function available to the process that the script is running in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thanks for the explanation, let's merge. |
||
source $CONDA_BASE/etc/profile.d/conda.sh | ||
conda activate jupyter-vcdat3 | ||
|
||
# Install lazy_import | ||
python -m pip install lazy_import | ||
# Install sidecar | ||
python -m pip install sidecar | ||
jupyter labextension install @jupyter-widgets/jupyterlab-manager | ||
jupyter labextension install @jupyter-widgets/jupyterlab-sidecar | ||
|
||
|
||
if [[ ! -d "jupyter-vcdat" ]]; then | ||
git clone https://github.com/CDAT/jupyter-vcdat.git | ||
cd jupyter-vcdat | ||
fi | ||
|
||
python setup.py install | ||
|
||
npm install | ||
npm run build | ||
jupyter lab build | ||
jupyter-labextension install . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@William-Hill does this work if conda is a function rather than a actual executable (remember issue you had where
cdat_info
couldn't find yourconda
executable for provenance?