Skip to content

Commit

Permalink
Merge pull request #692 from douglasjacobsen/fix-long-paths
Browse files Browse the repository at this point in the history
Set RAMBLE_PYTHON when setup-env is sourced
  • Loading branch information
linsword13 authored Oct 15, 2024
2 parents 0fef52f + be8471c commit 3f9a04f
Show file tree
Hide file tree
Showing 17 changed files with 126 additions and 25 deletions.
7 changes: 6 additions & 1 deletion share/ramble/cloud-build/ramble-pr-software-conflicts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,15 @@ steps:
git branch develop origin/develop
. /opt/spack/share/spack/setup-env.sh
. /workspace/share/ramble/setup-env.sh
spack load py-pip ^python
pip install -r /workspace/requirements-dev.txt
export SPACK_PYTHON=`which python3`
. /workspace/share/ramble/setup-env.sh
echo "Spack version is $(spack --version)"
echo "Python version is $(python3 --version)"
Expand Down
9 changes: 7 additions & 2 deletions share/ramble/cloud-build/ramble-pr-style.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,15 @@ steps:
git branch develop origin/develop
. /opt/spack/share/spack/setup-env.sh
. /workspace/share/ramble/setup-env.sh
spack load py-pip ^python
pip install -r /workspace/requirements-dev.txt
export SPACK_PYTHON=`which python3`
. /workspace/share/ramble/setup-env.sh
echo "Spack version is $(spack --version)"
echo "Python version is $(python3 --version)"
Expand All @@ -50,7 +55,7 @@ steps:
license_err=$$?
# Test removing a dependency
conda uninstall -qy pytest
pip uninstall -y pytest
ramble help
# $$ characters are required for cloud-build:
Expand Down
7 changes: 6 additions & 1 deletion share/ramble/cloud-build/ramble-pr-unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,15 @@ steps:
git branch develop origin/develop
. /opt/spack/share/spack/setup-env.sh
. /workspace/share/ramble/setup-env.sh
spack load py-pip ^python
pip install -r /workspace/requirements-dev.txt
export SPACK_PYTHON=`which python3`
. /workspace/share/ramble/setup-env.sh
echo "Spack version is $(spack --version)"
echo "Python version is $(python3 --version)"
Expand Down
7 changes: 6 additions & 1 deletion share/ramble/cloud-build/tutorials/ramble-tutorial-1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,15 @@ steps:
cd /workspace
. /opt/spack/share/spack/setup-env.sh
. /workspace/share/ramble/setup-env.sh
spack load py-pip ^python
pip install -r /workspace/requirements-dev.txt
export SPACK_PYTHON=`which python3`
. /workspace/share/ramble/setup-env.sh
echo "Spack version is $(spack --version)"
echo "Python version is $(python3 --version)"
Expand Down
9 changes: 7 additions & 2 deletions share/ramble/cloud-build/tutorials/ramble-tutorial-10.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,14 @@ steps:
- |
cd /workspace
export PATH=$$(. /opt/spack/share/spack/setup-env.sh && spack location -i miniconda3)/bin:$${PATH}
. /opt/spack/share/spack/setup-env.sh
spack load py-pip ^python
pip install -r /workspace/requirements-dev.txt
export SPACK_PYTHON=`which python3`
. /workspace/share/ramble/setup-env.sh
echo "Spack version is $(spack --version)"
Expand Down
9 changes: 7 additions & 2 deletions share/ramble/cloud-build/tutorials/ramble-tutorial-11.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,14 @@ steps:
- |
cd /workspace
export PATH=$$(. /opt/spack/share/spack/setup-env.sh && spack location -i miniconda3)/bin:$${PATH}
. /opt/spack/share/spack/setup-env.sh
spack load py-pip ^python
pip install -r /workspace/requirements-dev.txt
export SPACK_PYTHON=`which python3`
. /workspace/share/ramble/setup-env.sh
echo "Spack version is $(spack --version)"
Expand Down
9 changes: 7 additions & 2 deletions share/ramble/cloud-build/tutorials/ramble-tutorial-2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,14 @@ steps:
- |
cd /workspace
export PATH=$$(. /opt/spack/share/spack/setup-env.sh && spack location -i miniconda3)/bin:$${PATH}
. /opt/spack/share/spack/setup-env.sh
spack load py-pip ^python
pip install -r /workspace/requirements-dev.txt
export SPACK_PYTHON=`which python3`
. /workspace/share/ramble/setup-env.sh
echo "Spack version is $(spack --version)"
Expand Down
9 changes: 7 additions & 2 deletions share/ramble/cloud-build/tutorials/ramble-tutorial-3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,14 @@ steps:
- |
cd /workspace
export PATH=$$(. /opt/spack/share/spack/setup-env.sh && spack location -i miniconda3)/bin:$${PATH}
. /opt/spack/share/spack/setup-env.sh
spack load py-pip ^python
pip install -r /workspace/requirements-dev.txt
export SPACK_PYTHON=`which python3`
. /workspace/share/ramble/setup-env.sh
echo "Spack version is $(spack --version)"
Expand Down
9 changes: 7 additions & 2 deletions share/ramble/cloud-build/tutorials/ramble-tutorial-4.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,14 @@ steps:
- |
cd /workspace
export PATH=$$(. /opt/spack/share/spack/setup-env.sh && spack location -i miniconda3)/bin:$${PATH}
. /opt/spack/share/spack/setup-env.sh
spack load py-pip ^python
pip install -r /workspace/requirements-dev.txt
export SPACK_PYTHON=`which python3`
. /workspace/share/ramble/setup-env.sh
echo "Spack version is $(spack --version)"
Expand Down
9 changes: 7 additions & 2 deletions share/ramble/cloud-build/tutorials/ramble-tutorial-5.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,14 @@ steps:
- |
cd /workspace
export PATH=$$(. /opt/spack/share/spack/setup-env.sh && spack location -i miniconda3)/bin:$${PATH}
. /opt/spack/share/spack/setup-env.sh
spack load py-pip ^python
pip install -r /workspace/requirements-dev.txt
export SPACK_PYTHON=`which python3`
. /workspace/share/ramble/setup-env.sh
echo "Spack version is $(spack --version)"
Expand Down
9 changes: 7 additions & 2 deletions share/ramble/cloud-build/tutorials/ramble-tutorial-6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,14 @@ steps:
- |
cd /workspace
export PATH=$$(. /opt/spack/share/spack/setup-env.sh && spack location -i miniconda3)/bin:$${PATH}
. /opt/spack/share/spack/setup-env.sh
spack load py-pip ^python
pip install -r /workspace/requirements-dev.txt
export SPACK_PYTHON=`which python3`
. /workspace/share/ramble/setup-env.sh
echo "Spack version is $(spack --version)"
Expand Down
9 changes: 7 additions & 2 deletions share/ramble/cloud-build/tutorials/ramble-tutorial-7.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,14 @@ steps:
- |
cd /workspace
export PATH=$$(. /opt/spack/share/spack/setup-env.sh && spack location -i miniconda3)/bin:$${PATH}
. /opt/spack/share/spack/setup-env.sh
spack load py-pip ^python
pip install -r /workspace/requirements-dev.txt
export SPACK_PYTHON=`which python3`
. /workspace/share/ramble/setup-env.sh
echo "Spack version is $(spack --version)"
Expand Down
9 changes: 7 additions & 2 deletions share/ramble/cloud-build/tutorials/ramble-tutorial-8.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,14 @@ steps:
- |
cd /workspace
export PATH=$$(. /opt/spack/share/spack/setup-env.sh && spack location -i miniconda3)/bin:$${PATH}
. /opt/spack/share/spack/setup-env.sh
spack load py-pip ^python
pip install -r /workspace/requirements-dev.txt
export SPACK_PYTHON=`which python3`
. /workspace/share/ramble/setup-env.sh
echo "Spack version is $(spack --version)"
Expand Down
9 changes: 7 additions & 2 deletions share/ramble/cloud-build/tutorials/ramble-tutorial-9.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,14 @@ steps:
- |
cd /workspace
export PATH=$$(. /opt/spack/share/spack/setup-env.sh && spack location -i miniconda3)/bin:$${PATH}
. /opt/spack/share/spack/setup-env.sh
spack load py-pip ^python
pip install -r /workspace/requirements-dev.txt
export SPACK_PYTHON=`which python3`
. /workspace/share/ramble/setup-env.sh
echo "Spack version is $(spack --version)"
Expand Down
12 changes: 12 additions & 0 deletions share/ramble/setup-env.csh
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,18 @@ set _ramble_share_dir = $RAMBLE_ROOT/share/ramble
alias ramble 'set _rmb_args = (\!*); source $_ramble_share_dir/csh/ramble.csh'
alias _ramble_pathadd 'set _pa_args = (\!*) && source $_ramble_share_dir/csh/pathadd.csh'

# Identify and lock the python interpreter
if (! $?RAMBLE_PYTHON) then
setenv RAMBLE_PYTHON ""
endif
foreach cmd ("$RAMBLE_PYTHON" python3 python python2)
command -v "$cmd" >& /dev/null
if ($status == 0) then
setenv RAMBLE_PYTHON `command -v "$cmd"`
break
endif
end

# Set variables needed by this script
_ramble_pathadd PATH "$RAMBLE_ROOT/bin"
eval `ramble --print-shell-vars csh`
Expand Down
11 changes: 11 additions & 0 deletions share/ramble/setup-env.fish
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,17 @@ end
#
set -l rmb_source_file (status -f) # name of current file

#
# Identify and lock the python interpreter
#
for cmd in "$RAMBLE_PYTHON" python3 python python2
set -l _rmb_python (command -v "$cmd")
if test $status -eq 0
set -x RAMBLE_PYTHON $_rmb_python
break
end
end



#
Expand Down
8 changes: 8 additions & 0 deletions share/ramble/setup-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,14 @@ if [ "$_rmb_shell" = bash ]; then
export -f _ramble_shell_wrapper
fi

# Identify and lock the python interpreter
for cmd in "${RAMBLE_PYTHON:-}" python3 python python2; do
if command -v > /dev/null "$cmd"; then
export RAMBLE_PYTHON="$(command -v "$cmd")"
break
fi
done

# Add programmable tab completion for Bash
#
if [ "$_rmb_shell" = bash ]; then
Expand Down

0 comments on commit 3f9a04f

Please sign in to comment.