Skip to content

Commit

Permalink
Merge pull request #177 from vincentcasseau/main
Browse files Browse the repository at this point in the history
PyPI - Github Actions: adding prodmode 2 for install on azure
  • Loading branch information
vincentcasseau authored Sep 11, 2024
2 parents 8f5bf5e + a87268c commit f4b3e24
Show file tree
Hide file tree
Showing 22 changed files with 124 additions and 230 deletions.
18 changes: 7 additions & 11 deletions Cassiopee/Apps/install
Original file line number Diff line number Diff line change
Expand Up @@ -23,33 +23,29 @@ else
echo 'install <dir>: install in directory <dir>.'
exit 1
fi
if [ -z "${CLEAN_WHEELS_CASSIOPEE+x}" ]; then
CLEAN_WHEELS_CASSIOPEE=1
fi

# if specific python exe name
if [ "$PYTHONEXE" != "" ]; then
alias python=$PYTHONEXE
fi

# set production mode (0: scons+setup, 1: scons+pip, 2: setup legacy)
# set production mode (0: scons+setup, 1: scons+pip, 2: scons+pip+wheel)
if [ "$PRODMODE" = "" ]; then
PRODMODE=0
fi

# Compilation et installation
if [ $PRODMODE -eq 0 ]; then
if [ $PRODMODE -eq 0 ]; then # setup
python setup.py install --prefix="$INSTALLPATH"
[ $? != 0 ] && exit 1;
elif [ $PRODMODE -eq 1 ]; then
elif [ $PRODMODE -eq 1 ]; then # pip
python -m pip install --ignore-installed --upgrade --prefix="$INSTALLPATH" .
[ $? != 0 ] && exit 1;
elif [ $PRODMODE -eq 2 ]; then # pip+wheel
# wheels in $INSTALLPATH
TMPDIR=$INSTALLPATH python -m pip install --ignore-installed --upgrade --prefix="$INSTALLPATH" --no-clean .
[ $? != 0 ] && exit 1;
fi

# Clean temporary folder containing wheels
if [ "$CLEAN_WHEELS_CASSIOPEE" -eq 1 ]; then
rm -rf "$INSTALLPATH"/pip-*
fi

# Check installation
python test/t1.py
18 changes: 6 additions & 12 deletions Cassiopee/CPlot/install
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,13 @@ else
echo 'install <dir>: install in directory <dir>.'
exit 1
fi
if [ -z "${CLEAN_WHEELS_CASSIOPEE+x}" ]; then
CLEAN_WHEELS_CASSIOPEE=1
fi

# if specific python exe name
if [ "$PYTHONEXE" != "" ]; then
alias python=$PYTHONEXE
fi

# set production mode (0: scons+setup, 1: scons+pip, 2: setup legacy)
# set production mode (0: scons+setup, 1: scons+pip, 2: scons+pip+wheel)
if [ "$PRODMODE" = "" ]; then
PRODMODE=0
fi
Expand Down Expand Up @@ -60,11 +57,13 @@ if [ $PRODMODE -le 1 ]; then
rm -f build/lib.*/CPlot/cplot-*.*
rm -f build/lib.*/CPlot/cplotOSMesa.*
rm -f build/lib.*/CPlot/cplotOSMesa-*.*

if [ $PRODMODE -eq 0 ]; then
if [ $PRODMODE -eq 0 ]; then # setup
python setup.py install --prefix="$INSTALLPATH"
[ $? != 0 ] && exit 1;
elif [ $PRODMODE -eq 1 ]; then
elif [ $PRODMODE -eq 1 ]; then # pip
python -m pip install --ignore-installed --upgrade --prefix="$INSTALLPATH" .
[ $? != 0 ] && exit 1;
elif [ $PRODMODE -eq 2 ]; then # pip+wheel
TMPDIR=$INSTALLPATH python -m pip install --ignore-installed --upgrade --prefix="$INSTALLPATH" --no-clean .
[ $? != 0 ] && exit 1;
fi
Expand All @@ -73,11 +72,6 @@ else
[ $? != 0 ] && exit 1;
fi

# Clean temporary folder containing wheels
if [ "$CLEAN_WHEELS_CASSIOPEE" -eq 1 ]; then
rm -rf "$INSTALLPATH"/pip-*
fi

cp test/cplot "$INSTALLPATH"
cp test/cplot.py "$INSTALLPATH"
# Copie les applications
Expand Down
15 changes: 5 additions & 10 deletions Cassiopee/Compressor/install
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,13 @@ else
echo 'install <dir>: install in directory <dir>.'
exit 1
fi
if [ -z "${CLEAN_WHEELS_CASSIOPEE+x}" ]; then
CLEAN_WHEELS_CASSIOPEE=1
fi

# if specific python exe name
if [ "$PYTHONEXE" != "" ]; then
alias python=$PYTHONEXE
fi

# set production mode (0: scons+setup, 1: scons+pip, 2: setup legacy)
# set production mode (0: scons+setup, 1: scons+pip, 2: scons+pip+wheel)
if [ "$PRODMODE" = "" ]; then
PRODMODE=0
fi
Expand Down Expand Up @@ -63,7 +60,10 @@ if [ $PRODMODE -le 1 ]; then
if [ $PRODMODE -eq 0 ]; then # setup
python setup.py install --prefix="$INSTALLPATH"
[ $? != 0 ] && exit 1;
elif [ $PRODMODE -eq 1 ]; then # pip+wheel
elif [ $PRODMODE -eq 1 ]; then # pip
python -m pip install --ignore-installed --upgrade --prefix="$INSTALLPATH" .
[ $? != 0 ] && exit 1;
elif [ $PRODMODE -eq 2 ]; then # pip+wheel
TMPDIR=$INSTALLPATH python -m pip install --ignore-installed --upgrade --prefix="$INSTALLPATH" --no-clean .
[ $? != 0 ] && exit 1;
fi
Expand All @@ -72,10 +72,5 @@ else
[ $? != 0 ] && exit 1;
fi

# Clean temporary folder containing wheels
if [ "$CLEAN_WHEELS_CASSIOPEE" -eq 1 ]; then
rm -rf "$INSTALLPATH"/pip-*
fi

# Test l'installation
python test/t1.py
19 changes: 7 additions & 12 deletions Cassiopee/Connector/install
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,13 @@ else
echo 'install <dir>: install in directory <dir>.'
exit 1
fi
if [ -z "${CLEAN_WHEELS_CASSIOPEE+x}" ]; then
CLEAN_WHEELS_CASSIOPEE=1
fi

# if specific python exe name
if [ "$PYTHONEXE" != "" ]; then
alias python=$PYTHONEXE
fi

# set production mode (0: scons+setup, 1: scons+pip, 2: setup legacy)
# set production mode (0: scons+setup, 1: scons+pip, 2: scons+pip+wheel)
if [ "$PRODMODE" = "" ]; then
PRODMODE=0
fi
Expand All @@ -61,23 +58,21 @@ if [ $PRODMODE -le 1 ]; then
#touch Connector/connector.cpp
rm -f build/lib.*/Connector/connector.*
rm -f build/lib.*/Connector/connector-*.*
if [ $PRODMODE -eq 0 ]; then
if [ $PRODMODE -eq 0 ]; then # setup
python setup.py install --prefix="$INSTALLPATH"
[ $? != 0 ] && exit 1;
elif [ $PRODMODE -eq 1 ]; then # pip+wheel
elif [ $PRODMODE -eq 1 ]; then # pip
python -m pip install --ignore-installed --upgrade --prefix="$INSTALLPATH" .
[ $? != 0 ] && exit 1;
elif [ $PRODMODE -eq 2 ]; then # pip+wheel
TMPDIR=$INSTALLPATH python -m pip install --ignore-installed --upgrade --prefix="$INSTALLPATH" --no-clean .
[ $? != 0 ] && exit 1;
[ $? != 0 ] && exit 1;
fi
else
python setupLegacy.py install --prefix="$INSTALLPATH"
[ $? != 0 ] && exit 1;
fi

# Clean temporary folder containing wheels
if [ "$CLEAN_WHEELS_CASSIOPEE" -eq 1 ]; then
rm -rf "$INSTALLPATH"/pip-*
fi

# Install libconnector
python installLib.py

Expand Down
17 changes: 6 additions & 11 deletions Cassiopee/Converter/install
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,13 @@ else
echo 'install <dir>: install in directory <dir>.'
exit 1
fi
if [ -z "${CLEAN_WHEELS_CASSIOPEE+x}" ]; then
CLEAN_WHEELS_CASSIOPEE=1
fi

# if specific python exe name
if [ "$PYTHONEXE" != "" ]; then
alias python=$PYTHONEXE
fi

# set production mode (0: scons+setup, 1: scons+pip, 2: setup legacy)
# set production mode (0: scons+setup, 1: scons+pip, 2: scons+pip+wheel)
if [ "$PRODMODE" = "" ]; then
PRODMODE=0
fi
Expand All @@ -61,10 +58,13 @@ if [ $PRODMODE -le 1 ]; then
rm -f build/lib.*/Converter/converter.*
rm -f build/lib.*/Converter/converter-*.*
rm -f build/lib.*/Converter/expression.*
if [ $PRODMODE -eq 0 ]; then
if [ $PRODMODE -eq 0 ]; then # setup
python setup.py install --prefix="$INSTALLPATH"
[ $? != 0 ] && exit 1;
elif [ $PRODMODE -eq 1 ]; then
elif [ $PRODMODE -eq 1 ]; then # pip
python -m pip install --ignore-installed --upgrade --prefix="$INSTALLPATH" .
[ $? != 0 ] && exit 1;
elif [ $PRODMODE -eq 2 ]; then # pip+wheel
TMPDIR=$INSTALLPATH python -m pip install --ignore-installed --upgrade --prefix="$INSTALLPATH" --no-clean .
[ $? != 0 ] && exit 1;
fi
Expand All @@ -73,11 +73,6 @@ else
[ $? != 0 ] && exit 1;
fi

# Clean temporary folder containing wheels
if [ "$CLEAN_WHEELS_CASSIOPEE" -eq 1 ]; then
rm -rf "$INSTALLPATH"/pip-*
fi

cp test/ediff "$INSTALLPATH"
cp test/ediff.py "$INSTALLPATH"
cp Converter/kpython "$INSTALLPATH"
Expand Down
17 changes: 6 additions & 11 deletions Cassiopee/Dist2Walls/install
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,13 @@ else
echo 'install <dir>: install in directory <dir>.'
exit 1
fi
if [ -z "${CLEAN_WHEELS_CASSIOPEE+x}" ]; then
CLEAN_WHEELS_CASSIOPEE=1
fi

# if specific python exe name
if [ "$PYTHONEXE" != "" ]; then
alias python=$PYTHONEXE
fi

# set production mode (0: scons+setup, 1: scons+pip, 2: setup legacy)
# set production mode (0: scons+setup, 1: scons+pip, 2: scons+pip+wheel)
if [ "$PRODMODE" = "" ]; then
PRODMODE=0
fi
Expand All @@ -58,10 +55,13 @@ if [ $PRODMODE -le 1 ]; then
#touch Dist2Walls/dist2walls.cpp
rm -f build/lib.*/Dist2Walls/dist2walls.*
rm -f build/lib.*/Dist2Walls/dist2walls-*.*
if [ $PRODMODE -eq 0 ]; then
if [ $PRODMODE -eq 0 ]; then # setup
python setup.py install --prefix="$INSTALLPATH"
[ $? != 0 ] && exit 1;
elif [ $PRODMODE -eq 1 ]; then
elif [ $PRODMODE -eq 1 ]; then # pip
python -m pip install --ignore-installed --upgrade --prefix="$INSTALLPATH" .
[ $? != 0 ] && exit 1;
elif [ $PRODMODE -eq 2 ]; then # pip+wheel
TMPDIR=$INSTALLPATH python -m pip install --ignore-installed --upgrade --prefix="$INSTALLPATH" --no-clean .
[ $? != 0 ] && exit 1;
fi
Expand All @@ -70,10 +70,5 @@ else
[ $? != 0 ] && exit 1;
fi

# Clean temporary folder containing wheels
if [ "$CLEAN_WHEELS_CASSIOPEE" -eq 1 ]; then
rm -rf "$INSTALLPATH"/pip-*
fi

# Test l'installation
python test/t1.py
17 changes: 6 additions & 11 deletions Cassiopee/Distributor2/install
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,13 @@ else
echo 'install <dir>: install in directory <dir>.'
exit 1
fi
if [ -z "${CLEAN_WHEELS_CASSIOPEE+x}" ]; then
CLEAN_WHEELS_CASSIOPEE=1
fi

# if specific python exe name
if [ "$PYTHONEXE" != "" ]; then
alias python=$PYTHONEXE
fi

# set production mode (0: scons+setup, 1: scons+pip, 2: setup legacy)
# set production mode (0: scons+setup, 1: scons+pip, 2: scons+pip+wheel)
if [ "$PRODMODE" = "" ]; then
PRODMODE=0
fi
Expand All @@ -61,10 +58,13 @@ if [ $PRODMODE -le 2 ]; then
#touch Distributor2/distributor2.cpp
rm -f build/lib.*/Distributor2/distributor2.*
rm -f build/lib.*/Distributor2/distributor2-*.*
if [ $PRODMODE -eq 0 ]; then
if [ $PRODMODE -eq 0 ]; then # setup
python setup.py install --prefix="$INSTALLPATH"
[ $? != 0 ] && exit 1;
elif [ $PRODMODE -eq 1 ]; then
elif [ $PRODMODE -eq 1 ]; then # pip
python -m pip install --ignore-installed --upgrade --prefix="$INSTALLPATH" .
[ $? != 0 ] && exit 1;
elif [ $PRODMODE -eq 2 ]; then # pip+wheel
TMPDIR=$INSTALLPATH python -m pip install --ignore-installed --upgrade --prefix="$INSTALLPATH" --no-clean .
[ $? != 0 ] && exit 1;
fi
Expand All @@ -73,10 +73,5 @@ else
[ $? != 0 ] && exit 1;
fi

# Clean temporary folder containing wheels
if [ "$CLEAN_WHEELS_CASSIOPEE" -eq 1 ]; then
rm -rf "$INSTALLPATH"/pip-*
fi

# Test installation
python test/t1.py
1 change: 0 additions & 1 deletion Cassiopee/Envs/env_Cassiopee_local
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ else
endif
set EXT=$INTTYPE$DBGMODE

set CLEAN_WHEELS_CASSIOPEE=1

# ----------------------------- Prods ------------------------------------------

Expand Down
4 changes: 1 addition & 3 deletions Cassiopee/Envs/sh_Cassiopee_local
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ case $MACHINETMP in
esac
unset MACHINETMP
EXT=$INTTYPE$DBGMODE
export CLEAN_WHEELS_CASSIOPEE=1

# ----------------------------- Prods ------------------------------------------
if [ "$MAC" = "ld_eos8" ]; then
Expand Down Expand Up @@ -165,9 +164,8 @@ elif [ "$MAC" = "azure" ]; then
export ELSAPROD=$ELSAPROD$EXT
export OMP_NUM_THREADS=4
export PYTHONEXE=python3
export PRODMODE=1
export PRODMODE=2
export PIP_DISABLE_PIP_VERSION_CHECK=1
export CLEAN_WHEELS_CASSIOPEE=0

elif [ "$MAC" = "visio" ]; then
#----------------------------- visio -----------------------------------------
Expand Down
19 changes: 7 additions & 12 deletions Cassiopee/Generator/install
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,13 @@ else
echo 'install <dir>: install in directory <dir>.'
exit 1
fi
if [ -z "${CLEAN_WHEELS_CASSIOPEE+x}" ]; then
CLEAN_WHEELS_CASSIOPEE=1
fi

# if specific python exe name
if [ "$PYTHONEXE" != "" ]; then
alias python=$PYTHONEXE
fi

# set production mode (0: scons+setup, 1: scons+pip, 2: setup legacy)
# set production mode (0: scons+setup, 1: scons+pip, 2: scons+pip+wheel)
if [ "$PRODMODE" = "" ]; then
PRODMODE=0
fi
Expand All @@ -60,23 +57,21 @@ if [ $PRODMODE -le 1 ]; then
#touch Generator/generator.cpp
rm -f build/lib.*/Generator/generator.*
rm -f build/lib.*/Generator/generator-*.*
if [ $PRODMODE -eq 0 ]; then
if [ $PRODMODE -eq 0 ]; then # setup
python setup.py install --prefix="$INSTALLPATH"
[ $? != 0 ] && exit 1;
elif [ $PRODMODE -eq 1 ]; then
elif [ $PRODMODE -eq 1 ]; then # pip
python -m pip install --ignore-installed --upgrade --prefix="$INSTALLPATH" .
[ $? != 0 ] && exit 1;
elif [ $PRODMODE -eq 2 ]; then # pip+wheel
TMPDIR=$INSTALLPATH python -m pip install --ignore-installed --upgrade --prefix="$INSTALLPATH" --no-clean .
[ $? != 0 ] && exit 1;
[ $? != 0 ] && exit 1;
fi
else
python setupLegacy.py install --prefix="$INSTALLPATH"
[ $? != 0 ] && exit 1;
fi

# Clean temporary folder containing wheels
if [ "$CLEAN_WHEELS_CASSIOPEE" -eq 1 ]; then
rm -rf "$INSTALLPATH"/pip-*
fi

# Install libgenerator
python installLib.py

Expand Down
Loading

0 comments on commit f4b3e24

Please sign in to comment.