diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..8de7f6010661be7b2f28f29a8dc3b10039f04ae2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,14 @@ +__pycache__/ +*.py[cod] +\#*\# +.\#* +*~ +.env +*env/ +libclang*so +Dockerfile +build/ +*egg-info/ +*png +test_*/ +git-global-secret \ No newline at end of file diff --git a/cloneall.bash b/cloneall.bash index 84292b0de25d8a989503f37d404f644ee8abd625..c3150be8059b39efcabf2f4ee6e16c04a0916493 100755 --- a/cloneall.bash +++ b/cloneall.bash @@ -10,15 +10,13 @@ while getopts "cptlr:" opt do case "$opt" in c ) clona=1 ;; - p ) pyinsta=1 ;; t ) tmuxa=1 ;; - l ) linka=1 ;; r ) shift $(( OPTIND - 2 )) && REPOS=($@) && break esac done -if [ -z "$clona" ] && [ -z "$pyinsta" ] && [ -z "$tmuxa" ] && [ -z "$linka" ];then - echo 'usage: ./cloneall.bash -c (clone repos) -p (python install and tests) -t (attach to tmux) -l (full tree of links) -r (repos)' +if [ -z "$clona" ] && [ -z "$tmuxa" ]; then + echo 'usage: ./cloneall.bash -c (clone repos) -t (attach to tmux) -r (repos list, e.g. core io octree) ' exit 1 fi @@ -29,37 +27,16 @@ if [ ! -z "$clona" ]; then echo "export DEBUG=1" >> .env fi . .env - [[ ! -d "venv" ]] && python3 -mvenv venv - . venv/bin/activate - pip install --upgrade pip - pip install autopep8 - pip install matplotlib for REPO in "${REPOS[@]}"; do [[ ! -d "$REPO" ]] && git clone ssh://git@git.ia2.inaf.it/hotwheels/$REPO.git pushd $REPO + [[ ! -d "venv" ]] && python3 -mvenv venv && . venv/bin/activate && pip install autopep8 && pip install PyYaml git switch dev || echo no dev branch - if [[ "$REPO" != "gitlab-profile" ]]; then - [ ! -z "$pyinsta" ] && python -mpip install -e .[edit] && python -m hotwheels.checkup hotwheels/ - fi popd done fi -if [ ! -z "$linka" ]; then - mkdir -p full/hotwheels - touch full/hotwheels/__init__.py || echo cant touch - for f in core/hotwheels/*; do - [[ "${f##*/:0:2}" == "__" ]] && continue - ln -sf $PWD/$f full/hotwheels/${f##*/} - done - for REPO in "${REPOS[@]}"; do - if [ "$REPO" != "core" ] && [ "$REPO" != "gitlab-profile" ]; then - ln -sf $PWD/$REPO/hotwheels/$REPO full/hotwheels - fi - done -fi - if [ ! -z "$tmuxa" ]; then if ! tmux has-session -t $SESSION_NAME ; then @@ -77,8 +54,8 @@ if [ ! -z "$tmuxa" ]; then fi # Initialize the environment in the first window tmux send-keys -t $SESSION_NAME:$index ". .env" C-m - tmux send-keys -t $SESSION_NAME:$index ". venv/bin/activate" C-m tmux send-keys -t $SESSION_NAME:$index "cd $PWD/$value" C-m + tmux send-keys -t $SESSION_NAME:$index ". venv/bin/activate" C-m tmux rename-window $value done diff --git a/install_and_test.md b/install_and_test.md index 44eafefe679f0ce834a1ca7af9693bdb884ee83c..4449a02834f6cc7b023cc075c0135a6fd63e3d59 100644 --- a/install_and_test.md +++ b/install_and_test.md @@ -74,7 +74,7 @@ In case you need to work on many modules, you can clone and install all default ```bash wget https://www.ict.inaf.it/gitlab/hotwheels/gitlab-profile/-/raw/main/cloneall.bash -./cloneall.bash -cp # will clone and pip-install all hotwheels modules +bash cloneall.bash -c # will clone all hotwheels modules ``` If you want to create a folder with all the modules soft-linked into the folder `hotwheels/*`, add the flag `-l` to `cloneall.bash` to get this folder tree in a folder named `full/hotwheels/*`. This is helpful in navigating the files with the IDE when development has strong refactoring and one need to edit multiple modules.