forked from NREL/pysam
/
build_conda.sh
executable file
·43 lines (35 loc) · 961 Bytes
/
build_conda.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
cd $PYSAMDIR || exit
source $(conda info --base)/etc/profile.d/conda.sh
# get `CONDA_TOKEN` env variable, required for authentication
source .env || exit
DIST_NAME=''
if [ `uname` = "Linux" ] ;
then
DIST_NAME='linux-64'
elif [ `uname` = "Darwin" ] ;
then
DIST_NAME='osx-64'
else
DIST_NAME='win-64'
fi
# read version
VERSION="$(python -c 'from files.version import __version__; print(__version__)' 2>&1)"
export VERSION
# distribution direction where bdist_wheel outputs to
DIST_DIR=$(pwd)/dist
export DIST_DIR
yes | conda install conda-build
yes | conda activate base
conda update -n base -c defaults conda
for PYTHONVER in 3.6 3.7 3.8 3.9 3.10
do
conda-build stubs --output-folder=$DIST_DIR --python=$PYTHONVER || exit
conda build purge
done
for PYTHONVER in 3.6 3.7 3.8 3.9 3.10
do
export PYTHONVER
conda-build conda --output-folder=$DIST_DIR --python=$PYTHONVER --prefix-length=0 || exit
conda build purge
done