Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 92a5bc0f authored by hhakim's avatar hhakim
Browse files

Update conda pkg build & upload script for Windows.

parent c9aa155a
No related branches found
No related tags found
No related merge requests found
...@@ -18,6 +18,12 @@ function usage ...@@ -18,6 +18,12 @@ function usage
echo "Note: the package must be available on pypi.org to be built and uploaded to conda repository." echo "Note: the package must be available on pypi.org to be built and uploaded to conda repository."
} }
function sanitize_path
{
local P="$1"
echo $P | sed -e 's%C:\\%/c/%;s%\\%/%g'
}
function find_pkg function find_pkg
{ {
local P OS local P OS
...@@ -25,10 +31,17 @@ function find_pkg ...@@ -25,10 +31,17 @@ function find_pkg
then then
OS=osx OS=osx
P=$(dirname $CONDA_PATH_ENV_PREFIX) P=$(dirname $CONDA_PATH_ENV_PREFIX)
elif [[ "$SYSTEM" = win ]]
then
OS=$SYSTEM
P=$(dirname $CONDA_PATH_ENV_PREFIX)
else else
OS=$SYSTEM OS=$SYSTEM
P=$CONDA_PATH_ENV_PREFIX P=$CONDA_PATH_ENV_PREFIX
fi fi
[[ -n "$DEBUG" ]] && echo "to sanitize path: $P" >&2
P=$(sanitize_path "$P")
[[ -n "$DEBUG" ]] && echo "sanitized path: $P" >&2
find $P -iname "*.tar.bz2" | grep conda-bld | grep pyfaust | grep $OS | grep $PYVER_NODOT | grep $PYFAUST_VERSION find $P -iname "*.tar.bz2" | grep conda-bld | grep pyfaust | grep $OS | grep $PYVER_NODOT | grep $PYFAUST_VERSION
} }
...@@ -103,17 +116,21 @@ CONDA_ENV=build_upload_pyfaust_venv_$PYVER_NODOT ...@@ -103,17 +116,21 @@ CONDA_ENV=build_upload_pyfaust_venv_$PYVER_NODOT
if ! conda env list | grep $CONDA_ENV if ! conda env list | grep $CONDA_ENV
then then
[[ -n "$DEBUG" ]] && echo Conda env name to create: $CONDA_ENV [[ -n "$DEBUG" ]] && echo Conda env name to create: $CONDA_ENV
conda create -y -n $CONDA_ENV python==$PYVER && conda run -n $CONDA_ENV conda install -y conda-build anaconda-client conda create -y -n $CONDA_ENV python==$PYVER && conda run -n $CONDA_ENV conda install -y conda-build anaconda-client && conda config --add channels conda-forge # conda-forge used for numpy 1.22 on windows and macosx but maybe an update on anaconda channel will come soon
[[ ! "$?" = 0 ]] && echo "Error: failed to setup the conda environment" && exit 5 [[ ! "$?" = 0 ]] && echo "Error: failed to setup the conda environment" && exit 5
#conda init bash #conda init bash
fi fi
# conda-activate is only for interactive shell, so use run # conda-activate is only for interactive shell, so use run
#conda activate $CONDA_ENV || echo "Error: failed to activate the conda env $ENV" && exit 6 #conda activate $CONDA_ENV || echo "Error: failed to activate the conda env $ENV" && exit 6
CONDA_PATH_ENV_PREFIX=$(conda info | grep "envs directories" | head -1 | cut -d: -f2) #CONDA_PATH_ENV_PREFIX=$(conda info | grep "envs directories" | head -1 | cut -d: -f2)
CONDA_PATH_ENV_PREFIX=$(conda info | grep "envs directories" | head -1 | sed -e 's/[^:]*: \(.*\)/\1/')
PKG=$(find_pkg) PKG=$(find_pkg)
if [[ -z "$PKG" || ! -r "$PKG" ]] if [[ -z "$PKG" || ! -r "$PKG" ]]
then then
[[ -n "$DEBUG" ]] && echo "conda env used to build: $CONDA_ENV"
conda run -n $CONDA_ENV conda build pyfaust conda run -n $CONDA_ENV conda build pyfaust
else
echo "pyfaust conda package already built: $PKG"
fi fi
[[ ! "$?" = 0 ]] && echo "Error: failed to build pyfaust conda package" && exit 7 [[ ! "$?" = 0 ]] && echo "Error: failed to build pyfaust conda package" && exit 7
# find the package # find the package
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment