#!/usr/bin/env bash
# Thu 22 Sep 2016 13:59:03 CEST

source $(dirname ${0})/functions.sh

if [ "${VISIBILITY}" != "public" ]; then
  log_warn "WARNING: You cannot publish a PRIVATE to PyPI"
  log_warn "WARNING: Make this package public if you wish to do so next time"
  log_warn "WARNING: Stopping deployment procedure before PyPI/Conda pushes"
  exit 0
fi

log_info "Uploading package to PyPI on behalf of user ${PYPIUSER}..."
twine upload --skip-existing --username ${PYPIUSER} --password ${PYPIPASS} dist/*.zip