diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index dfa4b571a..27db95984 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -42,7 +42,7 @@ jobs: - name: Install Python dependencies run: | python -m pip install --upgrade pip - pip install wheel setuptools scons numpy mpi4py + pip install wheel twine setuptools scons numpy mpi4py - name: Verify Python and Installed Packages run: | @@ -56,9 +56,6 @@ jobs: . $CASSIOPEE/Cassiopee/Envs/sh_Cassiopee_r8 cd $CASSIOPEE/Cassiopee echo -e "FREEMODULES='KCore XCore Converter Geom Transform Generator Post Initiator Connector Distributor2 Dist2Walls RigidMotion Compressor Modeler Intersector Apps CPlot'\nexport FREEMODULES\nFULLMODULES='KCore XCore Converter Geom Transform Generator Post Initiator Connector Distributor2 Dist2Walls RigidMotion Compressor Modeler Intersector Apps CPlot'\nexport FULLMODULES\nOTHERS=''" > $CASSIOPEE/Cassiopee/MODULES - echo "PATH: $PATH" - echo "LD_LIBRARY_PATH: $LD_LIBRARY_PATH" - echo "PYTHONPATH: $PYTHONPATH" ./install - name: Publish to PyPI @@ -66,8 +63,10 @@ jobs: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} run: | - find $CASSIOPEE -name "*.whl" -# find $CASSIOPEE -name "*.whl" -exec twine upload {} + + export CASSIOPEE=$GITHUB_WORKSPACE + export MACHINE=azure + . $CASSIOPEE/Cassiopee/Envs/sh_Cassiopee_r8 + find $CASSIOPEE/Dist/bin/$ELSAPROD/pip-ephem-wheel-cache-* -type f -name "*.whl" -exec twine upload {} + # publish: # runs-on: ubuntu-latest diff --git a/Cassiopee/Apps/install b/Cassiopee/Apps/install index 3436bc365..3e1beefbe 100755 --- a/Cassiopee/Apps/install +++ b/Cassiopee/Apps/install @@ -23,6 +23,9 @@ else echo 'install : install in directory .' exit 1 fi +if [ -z "${CLEAN_WHEELS_CASSIOPEE+x}" ]; then + CLEAN_WHEELS_CASSIOPEE=1 +fi # if specific python exe name if [ "$PYTHONEXE" != "" ]; then @@ -35,13 +38,18 @@ if [ "$PRODMODE" = "" ]; then fi # Compilation et installation -if [ $PRODMODE -eq 0 ] || [ $PRODMODE -eq 2 ]; then +if [ $PRODMODE -eq 0 ]; then python setup.py install --prefix="$INSTALLPATH" [ $? != 0 ] && exit 1; elif [ $PRODMODE -eq 1 ]; then - python -m pip install --ignore-installed --upgrade --prefix="$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 diff --git a/Cassiopee/CPlot/install b/Cassiopee/CPlot/install index b1ee45ff8..52f684bb3 100755 --- a/Cassiopee/CPlot/install +++ b/Cassiopee/CPlot/install @@ -23,6 +23,9 @@ else echo 'install : install in directory .' exit 1 fi +if [ -z "${CLEAN_WHEELS_CASSIOPEE+x}" ]; then + CLEAN_WHEELS_CASSIOPEE=1 +fi # if specific python exe name if [ "$PYTHONEXE" != "" ]; then @@ -62,13 +65,19 @@ if [ $PRODMODE -le 1 ]; then python setup.py install --prefix="$INSTALLPATH" [ $? != 0 ] && exit 1; elif [ $PRODMODE -eq 1 ]; then - python -m pip install --ignore-installed --upgrade --prefix="$INSTALLPATH" . + TMPDIR=$INSTALLPATH python -m pip install --ignore-installed --upgrade --prefix="$INSTALLPATH" --no-clean . [ $? != 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 + cp test/cplot "$INSTALLPATH" cp test/cplot.py "$INSTALLPATH" # Copie les applications diff --git a/Cassiopee/Compressor/install b/Cassiopee/Compressor/install index e5df21453..bee17a050 100755 --- a/Cassiopee/Compressor/install +++ b/Cassiopee/Compressor/install @@ -22,6 +22,9 @@ else echo 'install : install in directory .' exit 1 fi +if [ -z "${CLEAN_WHEELS_CASSIOPEE+x}" ]; then + CLEAN_WHEELS_CASSIOPEE=1 +fi # if specific python exe name if [ "$PYTHONEXE" != "" ]; then @@ -61,7 +64,7 @@ if [ $PRODMODE -le 1 ]; then python setup.py install --prefix="$INSTALLPATH" [ $? != 0 ] && exit 1; elif [ $PRODMODE -eq 1 ]; then # pip+wheel - python -m pip install --ignore-installed --upgrade --prefix="$INSTALLPATH" . + TMPDIR=$INSTALLPATH python -m pip install --ignore-installed --upgrade --prefix="$INSTALLPATH" --no-clean . [ $? != 0 ] && exit 1; fi else @@ -69,5 +72,10 @@ 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 diff --git a/Cassiopee/Connector/install b/Cassiopee/Connector/install index 078396b7e..99e790802 100755 --- a/Cassiopee/Connector/install +++ b/Cassiopee/Connector/install @@ -25,6 +25,9 @@ else echo 'install : install in directory .' exit 1 fi +if [ -z "${CLEAN_WHEELS_CASSIOPEE+x}" ]; then + CLEAN_WHEELS_CASSIOPEE=1 +fi # if specific python exe name if [ "$PYTHONEXE" != "" ]; then @@ -62,7 +65,7 @@ if [ $PRODMODE -le 1 ]; then python setup.py install --prefix="$INSTALLPATH" [ $? != 0 ] && exit 1; elif [ $PRODMODE -eq 1 ]; then # pip+wheel - python -m pip install --ignore-installed --upgrade --prefix="$INSTALLPATH" . + TMPDIR=$INSTALLPATH python -m pip install --ignore-installed --upgrade --prefix="$INSTALLPATH" --no-clean . [ $? != 0 ] && exit 1; fi else @@ -70,6 +73,11 @@ else [ $? != 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 diff --git a/Cassiopee/Converter/install b/Cassiopee/Converter/install index d98231294..7b6a3e283 100755 --- a/Cassiopee/Converter/install +++ b/Cassiopee/Converter/install @@ -25,6 +25,9 @@ else echo 'install : install in directory .' exit 1 fi +if [ -z "${CLEAN_WHEELS_CASSIOPEE+x}" ]; then + CLEAN_WHEELS_CASSIOPEE=1 +fi # if specific python exe name if [ "$PYTHONEXE" != "" ]; then @@ -62,13 +65,19 @@ if [ $PRODMODE -le 1 ]; then python setup.py install --prefix="$INSTALLPATH" [ $? != 0 ] && exit 1; elif [ $PRODMODE -eq 1 ]; then - python -m pip install --ignore-installed --upgrade --prefix="$INSTALLPATH" . + TMPDIR=$INSTALLPATH python -m pip install --ignore-installed --upgrade --prefix="$INSTALLPATH" --no-clean . [ $? != 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 + cp test/ediff "$INSTALLPATH" cp test/ediff.py "$INSTALLPATH" cp Converter/kpython "$INSTALLPATH" diff --git a/Cassiopee/Dist2Walls/install b/Cassiopee/Dist2Walls/install index e71936604..dedafc1a0 100755 --- a/Cassiopee/Dist2Walls/install +++ b/Cassiopee/Dist2Walls/install @@ -23,6 +23,9 @@ else echo 'install : install in directory .' exit 1 fi +if [ -z "${CLEAN_WHEELS_CASSIOPEE+x}" ]; then + CLEAN_WHEELS_CASSIOPEE=1 +fi # if specific python exe name if [ "$PYTHONEXE" != "" ]; then @@ -59,7 +62,7 @@ if [ $PRODMODE -le 1 ]; then python setup.py install --prefix="$INSTALLPATH" [ $? != 0 ] && exit 1; elif [ $PRODMODE -eq 1 ]; then - python -m pip install --ignore-installed --upgrade --prefix="$INSTALLPATH" . + TMPDIR=$INSTALLPATH python -m pip install --ignore-installed --upgrade --prefix="$INSTALLPATH" --no-clean . [ $? != 0 ] && exit 1; fi else @@ -67,5 +70,10 @@ 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 diff --git a/Cassiopee/Distributor2/install b/Cassiopee/Distributor2/install index 31d7f3298..903416958 100755 --- a/Cassiopee/Distributor2/install +++ b/Cassiopee/Distributor2/install @@ -26,6 +26,9 @@ else echo 'install : install in directory .' exit 1 fi +if [ -z "${CLEAN_WHEELS_CASSIOPEE+x}" ]; then + CLEAN_WHEELS_CASSIOPEE=1 +fi # if specific python exe name if [ "$PYTHONEXE" != "" ]; then @@ -62,7 +65,7 @@ if [ $PRODMODE -le 2 ]; then python setup.py install --prefix="$INSTALLPATH" [ $? != 0 ] && exit 1; elif [ $PRODMODE -eq 1 ]; then - python -m pip install --ignore-installed --upgrade --prefix="$INSTALLPATH" . + TMPDIR=$INSTALLPATH python -m pip install --ignore-installed --upgrade --prefix="$INSTALLPATH" --no-clean . [ $? != 0 ] && exit 1; fi else @@ -70,5 +73,10 @@ 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 diff --git a/Cassiopee/Envs/env_Cassiopee_local b/Cassiopee/Envs/env_Cassiopee_local index 78eda1b67..763a68785 100644 --- a/Cassiopee/Envs/env_Cassiopee_local +++ b/Cassiopee/Envs/env_Cassiopee_local @@ -70,6 +70,8 @@ else endif set EXT=$INTTYPE$DBGMODE +set CLEAN_WHEELS_CASSIOPEE=1 + # ----------------------------- Prods ------------------------------------------ if ($MAC == "ld_pgi") then diff --git a/Cassiopee/Envs/sh_Cassiopee_local b/Cassiopee/Envs/sh_Cassiopee_local index 5f0f33083..98634eb58 100644 --- a/Cassiopee/Envs/sh_Cassiopee_local +++ b/Cassiopee/Envs/sh_Cassiopee_local @@ -76,6 +76,7 @@ case $MACHINETMP in esac unset MACHINETMP EXT=$INTTYPE$DBGMODE +export CLEAN_WHEELS_CASSIOPEE=1 # ----------------------------- Prods ------------------------------------------ if [ "$MAC" = "ld_eos8" ]; then @@ -165,6 +166,7 @@ elif [ "$MAC" = "azure" ]; then export PYTHONEXE=python3 export PRODMODE=1 export PIP_DISABLE_PIP_VERSION_CHECK=1 + export CLEAN_WHEELS_CASSIOPEE=0 elif [ "$MAC" = "visio" ]; then #----------------------------- visio ----------------------------------------- diff --git a/Cassiopee/Generator/install b/Cassiopee/Generator/install index 0cfd57460..6fc67c1da 100755 --- a/Cassiopee/Generator/install +++ b/Cassiopee/Generator/install @@ -25,6 +25,9 @@ else echo 'install : install in directory .' exit 1 fi +if [ -z "${CLEAN_WHEELS_CASSIOPEE+x}" ]; then + CLEAN_WHEELS_CASSIOPEE=1 +fi # if specific python exe name if [ "$PYTHONEXE" != "" ]; then @@ -61,7 +64,7 @@ if [ $PRODMODE -le 1 ]; then python setup.py install --prefix="$INSTALLPATH" [ $? != 0 ] && exit 1; elif [ $PRODMODE -eq 1 ]; then - python -m pip install --ignore-installed --upgrade --prefix="$INSTALLPATH" . + TMPDIR=$INSTALLPATH python -m pip install --ignore-installed --upgrade --prefix="$INSTALLPATH" --no-clean . [ $? != 0 ] && exit 1; fi else @@ -69,6 +72,11 @@ else [ $? != 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 diff --git a/Cassiopee/Geom/install b/Cassiopee/Geom/install index 418f1786a..acddb4fb7 100755 --- a/Cassiopee/Geom/install +++ b/Cassiopee/Geom/install @@ -26,6 +26,9 @@ else echo 'install : install in directory .' exit 1 fi +if [ -z "${CLEAN_WHEELS_CASSIOPEE+x}" ]; then + CLEAN_WHEELS_CASSIOPEE=1 +fi # if specific python exe name if [ "$PYTHONEXE" != "" ]; then @@ -62,7 +65,7 @@ if [ $PRODMODE -le 1 ]; then python setup.py install --prefix="$INSTALLPATH" [ $? != 0 ] && exit 1; elif [ $PRODMODE -eq 1 ]; then - python -m pip install --ignore-installed --upgrade --prefix="$INSTALLPATH" . + TMPDIR=$INSTALLPATH python -m pip install --ignore-installed --upgrade --prefix="$INSTALLPATH" --no-clean . [ $? != 0 ] && exit 1; fi else @@ -70,5 +73,10 @@ 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 diff --git a/Cassiopee/Initiator/install b/Cassiopee/Initiator/install index 5262e2eca..19c30cc02 100755 --- a/Cassiopee/Initiator/install +++ b/Cassiopee/Initiator/install @@ -26,6 +26,9 @@ else echo 'install : install in directory .' exit 1 fi +if [ -z "${CLEAN_WHEELS_CASSIOPEE+x}" ]; then + CLEAN_WHEELS_CASSIOPEE=1 +fi # if specific python exe name if [ "$PYTHONEXE" != "" ]; then @@ -62,7 +65,7 @@ if [ $PRODMODE -le 1 ]; then python setup.py install --prefix="$INSTALLPATH" [ $? != 0 ] && exit 1; elif [ $PRODMODE -eq 1 ]; then - python -m pip install --ignore-installed --upgrade --prefix="$INSTALLPATH" . + TMPDIR=$INSTALLPATH python -m pip install --ignore-installed --upgrade --prefix="$INSTALLPATH" --no-clean . [ $? != 0 ] && exit 1; fi else @@ -70,5 +73,10 @@ 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 diff --git a/Cassiopee/Intersector/install b/Cassiopee/Intersector/install index 486f0e7ac..02ba3e160 100755 --- a/Cassiopee/Intersector/install +++ b/Cassiopee/Intersector/install @@ -26,6 +26,9 @@ else echo 'install : install in directory .' exit 1 fi +if [ -z "${CLEAN_WHEELS_CASSIOPEE+x}" ]; then + CLEAN_WHEELS_CASSIOPEE=1 +fi # if specific python exe name if [ "$PYTHONEXE" != "" ]; then @@ -61,8 +64,8 @@ if [ $PRODMODE -le 1 ]; then if [ $PRODMODE -eq 0 ]; then python setup.py install --prefix="$INSTALLPATH" [ $? != 0 ] && exit 1; - elif [ $PRODMODE -eq 2 ]; then - python -m pip install --ignore-installed --upgrade --prefix="$INSTALLPATH" . + elif [ $PRODMODE -eq 1 ]; then + TMPDIR=$INSTALLPATH python -m pip install --ignore-installed --upgrade --prefix="$INSTALLPATH" --no-clean . [ $? != 0 ] && exit 1; fi else @@ -70,5 +73,10 @@ 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 diff --git a/Cassiopee/KCore/install b/Cassiopee/KCore/install index 16b51c669..64edbd630 100755 --- a/Cassiopee/KCore/install +++ b/Cassiopee/KCore/install @@ -29,6 +29,9 @@ else echo 'install : install in directory .' exit 1 fi +if [ -z "${CLEAN_WHEELS_CASSIOPEE+x}" ]; then + CLEAN_WHEELS_CASSIOPEE=1 +fi # if specific python exe name if [ "$PYTHONEXE" != "" ]; then @@ -67,7 +70,7 @@ if [ $PRODMODE -le 1 ]; then python setup.py install --prefix="$INSTALLPATH" [ $? != 0 ] && exit 1; elif [ $PRODMODE -eq 1 ]; then # pip+wheel - python -m pip install --ignore-installed --upgrade --prefix="$INSTALLPATH" . + TMPDIR=$INSTALLPATH python -m pip install --ignore-installed --upgrade --prefix="$INSTALLPATH" --no-clean . [ $? != 0 ] && exit 1; fi else @@ -75,6 +78,11 @@ else [ $? != 0 ] && exit 1; fi +# Clean temporary folder containing wheels +if [ "$CLEAN_WHEELS_CASSIOPEE" -eq 1 ]; then + rm -rf "$INSTALLPATH"/pip-* +fi + # Install libkcore python installLib.py diff --git a/Cassiopee/Modeler/install b/Cassiopee/Modeler/install index ec54fd663..da40a1a9c 100755 --- a/Cassiopee/Modeler/install +++ b/Cassiopee/Modeler/install @@ -23,6 +23,9 @@ else echo 'install : install in directory .' exit 1 fi +if [ -z "${CLEAN_WHEELS_CASSIOPEE+x}" ]; then + CLEAN_WHEELS_CASSIOPEE=1 +fi # if specific python exe name if [ "$PYTHONEXE" != "" ]; then @@ -39,12 +42,14 @@ if [ $PRODMODE -eq 0 ] || [ $PRODMODE -eq 2 ]; then python setup.py install --prefix="$INSTALLPATH" [ $? != 0 ] && exit 1; elif [ $PRODMODE -eq 1 ]; then - python -m pip install --no-cache-dir --no-binary=Modeler --ignore-installed --upgrade --prefix="$INSTALLPATH" . - [ $? != 0 ] && exit 1; -elif [ $PRODMODE -eq 2 ]; then - python -m pip install --ignore-installed --upgrade --prefix="$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 diff --git a/Cassiopee/OCC/install b/Cassiopee/OCC/install index feb0b5138..64ad595cb 100755 --- a/Cassiopee/OCC/install +++ b/Cassiopee/OCC/install @@ -23,6 +23,9 @@ else echo 'install : install in directory .' exit 1 fi +if [ -z "${CLEAN_WHEELS_CASSIOPEE+x}" ]; then + CLEAN_WHEELS_CASSIOPEE=1 +fi # if specific python exe name if [ "$PYTHONEXE" != "" ]; then @@ -65,7 +68,7 @@ if [ $PRODMODE -le 1 ]; then python setup.py install --prefix="$INSTALLPATH" [ $? != 0 ] && exit 1; elif [ $PRODMODE -eq 1 ]; then - python -m pip install --ignore-installed --upgrade --prefix="$INSTALLPATH" . + TMPDIR=$INSTALLPATH python -m pip install --ignore-installed --upgrade --prefix="$INSTALLPATH" --no-clean . [ $? != 0 ] && exit 1; fi else @@ -73,6 +76,11 @@ else [ $? != 0 ] && exit 1; fi +# Clean temporary folder containing wheels +if [ "$CLEAN_WHEELS_CASSIOPEE" -eq 1 ]; then + rm -rf "$INSTALLPATH"/pip-* +fi + # remove cd OCC #rm -fr occ_inc diff --git a/Cassiopee/Post/install b/Cassiopee/Post/install index 2c5586993..9079f876c 100755 --- a/Cassiopee/Post/install +++ b/Cassiopee/Post/install @@ -25,6 +25,9 @@ else echo 'install : install in directory .' exit 1 fi +if [ -z "${CLEAN_WHEELS_CASSIOPEE+x}" ]; then + CLEAN_WHEELS_CASSIOPEE=1 +fi # if specific python exe name if [ "$PYTHONEXE" != "" ]; then @@ -63,7 +66,7 @@ if [ $PRODMODE -le 1 ]; then python setup.py install --prefix="$INSTALLPATH" [ $? != 0 ] && exit 1; elif [ $PRODMODE -eq 1 ]; then - python -m pip install --ignore-installed --upgrade --prefix="$INSTALLPATH" . + TMPDIR=$INSTALLPATH python -m pip install --ignore-installed --upgrade --prefix="$INSTALLPATH" --no-clean . [ $? != 0 ] && exit 1; fi else @@ -71,5 +74,10 @@ else [ $? != 0 ] && exit 1; fi +# Clean temporary folder containing wheels +if [ "$CLEAN_WHEELS_CASSIOPEE" -eq 1 ]; then + rm -rf "$INSTALLPATH"/pip-* +fi + # Test de l'installation python test/t1.py diff --git a/Cassiopee/RigidMotion/install b/Cassiopee/RigidMotion/install index 387583732..da8eb794a 100755 --- a/Cassiopee/RigidMotion/install +++ b/Cassiopee/RigidMotion/install @@ -23,6 +23,9 @@ else echo 'install : install in directory .' exit 1 fi +if [ -z "${CLEAN_WHEELS_CASSIOPEE+x}" ]; then + CLEAN_WHEELS_CASSIOPEE=1 +fi # if specific python exe name if [ "$PYTHONEXE" != "" ]; then @@ -59,7 +62,7 @@ if [ $PRODMODE -le 1 ]; then python setup.py install --prefix="$INSTALLPATH" [ $? != 0 ] && exit 1; elif [ $PRODMODE -eq 1 ]; then - python -m pip install --ignore-installed --upgrade --prefix="$INSTALLPATH" . + TMPDIR=$INSTALLPATH python -m pip install --ignore-installed --upgrade --prefix="$INSTALLPATH" --no-clean . [ $? != 0 ] && exit 1; fi else @@ -67,5 +70,10 @@ 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 diff --git a/Cassiopee/Template/install b/Cassiopee/Template/install index f204149c7..40e60b57a 100755 --- a/Cassiopee/Template/install +++ b/Cassiopee/Template/install @@ -23,6 +23,9 @@ else echo 'install : install in directory .' exit 1 fi +if [ -z "${CLEAN_WHEELS_CASSIOPEE+x}" ]; then + CLEAN_WHEELS_CASSIOPEE=1 +fi # if specific python exe name if [ "$PYTHONEXE" != "" ]; then @@ -59,7 +62,7 @@ if [ $PRODMODE -le 0 ]; then python setup.py install --prefix="$INSTALLPATH" [ $? != 0 ] && exit 1; elif [ $PRODMODE -eq 1 ]; then - python -m pip install --ignore-installed --upgrade --prefix="$INSTALLPATH" . + TMPDIR=$INSTALLPATH python -m pip install --ignore-installed --upgrade --prefix="$INSTALLPATH" --no-clean . [ $? != 0 ] && exit 1; fi else @@ -67,5 +70,10 @@ else [ $? != 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 diff --git a/Cassiopee/Transform/install b/Cassiopee/Transform/install index 23d484229..a78cffe57 100755 --- a/Cassiopee/Transform/install +++ b/Cassiopee/Transform/install @@ -25,6 +25,9 @@ else echo 'install : install in directory .' exit 1 fi +if [ -z "${CLEAN_WHEELS_CASSIOPEE+x}" ]; then + CLEAN_WHEELS_CASSIOPEE=1 +fi # if specific python exe name if [ "$PYTHONEXE" != "" ]; then @@ -61,7 +64,7 @@ if [ $PRODMODE -le 1 ]; then python setup.py install --prefix="$INSTALLPATH" [ $? != 0 ] && exit 1; elif [ $PRODMODE -eq 1 ]; then - python -m pip install --ignore-installed --upgrade --prefix="$INSTALLPATH" . + TMPDIR=$INSTALLPATH python -m pip install --ignore-installed --upgrade --prefix="$INSTALLPATH" --no-clean . [ $? != 0 ] && exit 1; fi else @@ -69,5 +72,10 @@ else [ $? != 0 ] && exit 1; fi +# Clean temporary folder containing wheels +if [ "$CLEAN_WHEELS_CASSIOPEE" -eq 1 ]; then + rm -rf "$INSTALLPATH"/pip-* +fi + # Test de l'installation python test/t1.py diff --git a/Cassiopee/XCore/install b/Cassiopee/XCore/install index 5c7ebca90..e18cf9032 100755 --- a/Cassiopee/XCore/install +++ b/Cassiopee/XCore/install @@ -28,6 +28,9 @@ else echo 'install : install in directory .' exit 1 fi +if [ -z "${CLEAN_WHEELS_CASSIOPEE+x}" ]; then + CLEAN_WHEELS_CASSIOPEE=1 +fi # if specific python exe name if [ "$PYTHONEXE" != "" ]; then @@ -67,7 +70,7 @@ if [ $PRODMODE -le 1 ]; then python setup.py install --prefix="$INSTALLPATH" [ $? != 0 ] && exit 1; elif [ $PRODMODE -eq 1 ]; then - python -m pip install --ignore-installed --upgrade --prefix="$INSTALLPATH" . + TMPDIR=$INSTALLPATH python -m pip install --ignore-installed --upgrade --prefix="$INSTALLPATH" --no-clean . [ $? != 0 ] && exit 1; fi else @@ -75,6 +78,11 @@ else [ $? != 0 ] && exit 1; fi +# Clean temporary folder containing wheels +if [ "$CLEAN_WHEELS_CASSIOPEE" -eq 1 ]; then + rm -rf "$INSTALLPATH"/pip-* +fi + # Install libxcore python installLib.py diff --git a/Cassiopee/install b/Cassiopee/install index 9d6c26065..76e97e6f8 100755 --- a/Cassiopee/install +++ b/Cassiopee/install @@ -1,51 +1,83 @@ #! /bin/sh -# install : compile et installe tous les modules -# install doc : installe uniquement les docs -# install all : installe les modules + docs -if ([ $# -eq 0 ]) -then - if [ "$CASSIOPEE" = "" ]; then - echo "You must specify a CASSIOPEE variable in your environment." - echo "This variable specifies the installation path of *Cassiopee*." - exit 1 - fi - if [ "$ELSAPROD" = "" ]; then - echo "You must specify a ELSAPROD in your environment." - echo "This variable identifies the processor type." - exit 1 - fi - INSTALLPATH="$CASSIOPEE/Dist/bin/$ELSAPROD" +# Print help message +usage() { + echo -e "Usage: $0 : Install all modules" + echo -e " $0 --all : Install modules and docs" + echo -e " $0 --doc : Install docs only" + echo -e " $0 --cassiopee= : Set env. var. CASSIOPEE and install all modules" + echo -e " $0 --elsaprod= : Set env. var. ELSAPROD and install all modules" + echo -e " $0 --help : Print help message" + exit 1 +} -elif ([ $# -eq 1 ]) -then - if [ "$ELSAPROD" = "" ]; then - echo "You must specify a ELSAPROD in your environment." - echo "This variable identifies the processor type." - exit 1 - fi - INSTALLPATH="$1" -else - echo 'install: install in $CASSIOPEE/Dist/bin/$ELSAPROD' - echo 'install : install in directory .' - exit 1 +# Parse command-line arguments +INSTALL_DOCS=0 +INSTALL_MODS=1 +NO_CLEAN=0 +while [ "$1" != "" ]; do + case "$1" in + --all | -a) + INSTALL_DOCS=1 + INSTALL_MODS=1 + ;; + --cassiopee=*) + export CASSIOPEE="${1#*=}" + ;; + --doc | -d) + INSTALL_DOCS=1 + INSTALL_MODS=0 + ;; + --elsaprod=*) + export ELSAPROD="${1#*=}" + ;; + --help | -h) + usage + ;; + --no-clean) + NO_CLEAN=1 + ;; + *) + echo "Invalid argument: $1" + usage + ;; + esac + shift +done + +# Sanitise input arguments +if [ "$CASSIOPEE" = "" ]; then + echo "You must specify a CASSIOPEE variable in your environment." + echo "This variable specifies the installation path of *Cassiopee*." + usage +fi +if [ "$ELSAPROD" = "" ]; then + echo "You must specify a ELSAPROD in your environment." + echo "This variable identifies the processor type." + usage +fi +if [ -z "${CLEAN_WHEELS_CASSIOPEE+x}" ]; then + CLEAN_WHEELS_CASSIOPEE=1 fi +# Set install path and load module names +INSTALLPATH="$CASSIOPEE/Dist/bin/$ELSAPROD" . ./MODULES if [ "$PYTHONEXE" = "" ]; then export PYTHONEXE=python fi +# Install modules and/or docs for mod in $FULLMODULES do if test -e $mod then cd $mod - if [ "$1" = "" -o "$1" = "all" ]; then + if [ "$INSTALL_MODS" -eq 1 ]; then ./install [ $? != 0 ] && exit 1; fi - if [ "$1" = "doc" -o "$1" = "all" ]; then + if [ "$INSTALL_DOCS" -eq 1 ]; then cd doc ./install [ $? != 0 ] && exit 1; @@ -53,18 +85,23 @@ do fi cd .. else - echo 'Directory ',$mod, 'not found.' + echo 'Directory ', $mod, 'not found.' fi done # Fini avec la doc KCore pour genindex... -if [ "$1" = "doc" -o "$1" = "all" ]; then +if [ "$INSTALL_DOCS" -eq 1 ]; then cd KCore/doc ./install [ $? != 0 ] && exit 1; cd ../.. fi -# Installation des fichiers d'environnement +# Copy environment scripts cp Envs/env_Cassiopee* "$CASSIOPEE"/Dist cp Envs/sh_Cassiopee* "$CASSIOPEE"/Dist + +# Clean temporary folders containing wheels +if [ "$CLEAN_WHEELS_CASSIOPEE" -eq 1 ]; then + rm -rf "$INSTALLPATH"/pip-* +fi diff --git a/pyproject.toml b/pyproject.toml index edf0f0294..a3e506bc5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,11 +15,6 @@ license = {text="GPLv3"} description = "Computational Fluid Dynamics pre- and post-processing python modules" readme = "README.md" requires-python = ">=3.8" -dependencies = [ - "numpy", - "mpi4py", - "scons" -] classifiers = [ "Programming Language :: Python", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", @@ -28,6 +23,30 @@ classifiers = [ "Topic :: Scientific/Engineering :: Physics" ] +[project.dependencies] +numpy = ">=1.23.3" +mpi4py = ">=3.1.3" +scons = ">=4.4.0" +KCore = ">=4.0" +XCore = ">=4.0" +Converter = ">=4.0" +Geom = ">=4.0" +Transform = ">=4.0" +Generator = ">=4.0" +Post = ">=4.0" +Initiator = ">=4.0" +Connector = ">=4.0" +Distributor2 = ">=4.0" +Dist2Walls = ">=4.0" +RigidMotion = ">=4.0" +Compressor = ">=4.0" +Modeler = ">=4.0" +Intersector = ">=4.0" +Apps = ">=4.0" +CPlot = ">=4.0" + +[project.optional-dependencies] + [project.urls] Homepage = "https://github.com/onera/Cassiopee" Issues = "https://github.com/onera/Cassiopee/issues"