Skip to content

Instantly share code, notes, and snippets.

@simion
Last active October 3, 2016 11:57
Show Gist options
  • Save simion/c34196434acb7cc01f49bd65dc21c853 to your computer and use it in GitHub Desktop.
Save simion/c34196434acb7cc01f49bd65dc21c853 to your computer and use it in GitHub Desktop.
Auto build/upload a package from pypi to anaconda cloud. The builds are for all platforms (osx/win/linux) and both major python versions (python 2.7 and 3.5)
#! /bin/sh
#
# Usage: bash pypi_to_anaconda.sh <pypi_package> <user_or_organisation>
# Eg: bash pypi_to_anaconda.sh cchardet simion
#
NAME=$1
ORG=$2
rm -rf ./$NAME
conda skeleton pypi $NAME
conda build --python 2.7 $NAME
PACKAGE_PATH_27=`conda build --python 2.7 $NAME --output`
conda convert --platform all $PACKAGE_PATH_27 -o out_27 -f
for f in out_27/**/$NAME*
do
anaconda upload -u $ORG --force $f
done
rm -rf ./out_27
conda build --python 3.5 $NAME
PACKAGE_PATH_35=`conda build --python 3.5 $NAME --output`
conda convert --platform all $PACKAGE_PATH_35 -o out_35 -f
for f in out_35/**/$NAME*
do
anaconda upload -u $ORG --force $f
done
rm -rf ./out_35
rm -rf ./$NAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment