<commit_before>#!/usr/bin/env bash

# NOTE: This script has been adapted from content generated by github.com/conda-forge/conda-smithy
CLONE_DIR=/tmp/$LOGNAME/staged-recipes-dev
USERNAME=lightsource2-dev

REPO_ROOT=$(cd "$(dirname "$0")/.."; pwd;)
IMAGE_NAME="ericdill/debian-conda-builder:latest"

config=$(cat <<CONDARC

channels:
 - lightsource2-dev
 - lightsource2
 - conda-forge
 - defaults

always_yes: true
show_channel_urls: True
CONDARC
)

cat << EOF | docker run -i \
                        -v ${REPO_ROOT}/py2:/py2 \
                        -v ${REPO_ROOT}/py3:/py3 \
                        -v ${REPO_ROOT}/pyall:/pyall \
                        -a stdin -a stdout -a stderr \
                        $IMAGE_NAME \
                        bash || exit $?

if [ "${BINSTAR_TOKEN}" ];then
    export BINSTAR_TOKEN=${BINSTAR_TOKEN}
fi

echo USERNAME=$USERNAME
echo CLONE_DIR=$CLONE_DIR

# Unused, but needed by conda-build currently... :(
export CONDA_NPY='110'

export PYTHONUNBUFFERED=1
echo "$config" > ~/.condarc

# A lock sometimes occurs with incomplete builds. The lock file is stored in build_artefacts.
conda clean --lock

install ()
{
    url="https://github.com/$1"
    target="/tmp/$LOGNAME/$1"
    git clone $url /tmp/$LOGNAME/$1
    pushd $target
    python setup.py develop
    popd
}

echo "Install a dev build of conda-build"
install conda/conda-build
echo "Install dev build of conda-build-all"
conda install mock --yes
install scitools/conda-build-all
echo "Install dev build of conda-build-utils"
install ericdill/conda-build-utils

conda info

# dont allow failures on the conda-build commands
set -e
build_from_yaml ../build-directive.yaml -u $USERNAME
# echo "========== Running py2 builds =========="
# devbuild /py2 --username $USERNAME --pyver 2.7 --log $DEV_LOG.summary<commit_msg>Rename to devinstall to avoid shadowing builtin install<commit_after>#!/usr/bin/env bash

# NOTE: This script has been adapted from content generated by github.com/conda-forge/conda-smithy
CLONE_DIR=/tmp/$LOGNAME/staged-recipes-dev
USERNAME=lightsource2-dev

REPO_ROOT=$(cd "$(dirname "$0")/.."; pwd;)
IMAGE_NAME="ericdill/debian-conda-builder:latest"

config=$(cat <<CONDARC

channels:
 - lightsource2-dev
 - lightsource2
 - conda-forge
 - defaults

always_yes: true
show_channel_urls: True
CONDARC
)

cat << EOF | docker run -i \
                        -v ${REPO_ROOT}/py2:/py2 \
                        -v ${REPO_ROOT}/py3:/py3 \
                        -v ${REPO_ROOT}/pyall:/pyall \
                        -a stdin -a stdout -a stderr \
                        $IMAGE_NAME \
                        bash || exit $?

if [ "${BINSTAR_TOKEN}" ];then
    export BINSTAR_TOKEN=${BINSTAR_TOKEN}
fi

echo USERNAME=$USERNAME
echo CLONE_DIR=$CLONE_DIR

# Unused, but needed by conda-build currently... :(
export CONDA_NPY='110'

export PYTHONUNBUFFERED=1
echo "$config" > ~/.condarc

# A lock sometimes occurs with incomplete builds. The lock file is stored in build_artefacts.
conda clean --lock

devinstall ()
{
    url="https://github.com/$1"
    target="/tmp/$LOGNAME/$1"
    git clone $url /tmp/$LOGNAME/$1
    pushd $target
    python setup.py develop
    popd
}

echo "Install a dev build of conda-build"
devinstall conda/conda-build
echo "Install dev build of conda-build-all"
conda install mock --yes
devinstall scitools/conda-build-all
echo "Install dev build of conda-build-utils"
devinstall ericdill/conda-build-utils

conda info

# dont allow failures on the conda-build commands
set -e
build_from_yaml ../build-directive.yaml -u $USERNAME
# echo "========== Running py2 builds =========="
# devbuild /py2 --username $USERNAME --pyver 2.7 --log $DEV_LOG.summary
{'fraction_non_alphanumeric': 0.12845528455284552, 'fraction_numerical': 0.010298102981029811, 'mean_word_length': 2.828838174273859, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1976673', 'n_tokens_mistral': 1272, 'n_tokens_neox': 1227, 'n_words': 328}