-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
87 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
#!/bin/bash | ||
export CPLUS_INCLUDE_PATH=$PREFIX/include:$CPLUS_INCLUDE_PATH | ||
|
||
${PYTHON} setup.py build | ||
${PYTHON} setup.py install | ||
CPLUS_INCLUDE_PATH=$PREFIX/include:$CPLUS_INCLUDE_PATH ${PYTHON} setup.py build | ||
${PYTHON} setup.py install --single-version-externally-managed --record record.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash -xeu | ||
# Usage: | ||
# | ||
# $ ./scripts/post_release.sh v1.2.3 myserver githubuser | ||
# | ||
VERSION=${1#v} | ||
SERVER=$2 | ||
GITHUBUSER=$3 | ||
PKG=$(find . -maxdepth 2 -name __init__.py -print0 | xargs -0 -n1 dirname | xargs basename) | ||
PKG_UPPER=$(echo $PKG | tr '[:lower:]' '[:upper:]') | ||
SDIST_FILE=dist/${PKG}-$VERSION.tar.gz | ||
if [[ ! -f "$SDIST_FILE" ]]; then | ||
>&2 echo "Nonexistent file $SDIST_FILE" | ||
exit 1 | ||
fi | ||
SHA256=$(openssl sha256 "$SDIST_FILE" | cut -f2 -d' ') | ||
if [[ -d "dist/conda-recipe-$VERSION" ]]; then | ||
rm -r "dist/conda-recipe-$VERSION" | ||
fi | ||
cp -r conda-recipe/ dist/conda-recipe-$VERSION | ||
sed -i -E \ | ||
-e "s/\{\% set version(.+)/\{\% set version = \"$VERSION\" \%\}\n \{\% set sha256 = $SHA256 \%\}/" \ | ||
-e "s/git_url:(.+)/fn: \{\{ name \}\}-\{\{ version \}\}.tar.gz\n url: https:\/\/pypi.io\/packages\/source\/\{\{ name\[0\] \}\}\/\{\{ name \}\}\/\{\{ name \}\}-\{\{ version \}\}.tar.gz\n sha256: \{\{ sha256 \}\}/" \ | ||
-e "/cython/d" \ | ||
dist/conda-recipe-$VERSION/meta.yaml | ||
|
||
./scripts/update-gh-pages.sh v$VERSION | ||
|
||
# Specific for this project: | ||
scp -r dist/conda-recipe-$VERSION/ $PKG@$SERVER:~/public_html/conda-recipes/ | ||
scp "$SDIST_FILE" "$PKG@$SERVER:~/public_html/releases/" | ||
for CONDA_PY in 2.7 3.4 3.5; do | ||
for CONDA_NPY in 1.11; do | ||
ssh $PKG@$SERVER "source /etc/profile; conda-build --python $CONDA_PY --numpy $CONDA_NPY ~/public_html/conda-recipes/conda-recipe-$VERSION/" | ||
done | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,47 @@ | ||
#!/bin/bash -xeu | ||
# Usage: | ||
# | ||
# $ ./scripts/release.sh v1.2.3 ~/anaconda2/bin myserver.example.com | ||
# $ ./scripts/release.sh v1.2.3 ~/anaconda2/bin myserver.example.com GITHUB_USER GITHUB_REPO | ||
# | ||
|
||
if [[ $1 != v* ]]; then | ||
>&2 echo "Argument does not start with 'v'" | ||
echo "Argument does not start with 'v'" | ||
exit 1 | ||
fi | ||
./scripts/check_clean_repo_on_master.sh $1 | ||
VERSION=${1#v} | ||
CONDA_PATH=$2 | ||
SERVER=$3 | ||
find . -type f -iname "*.pyc" -exec rm {} + | ||
find . -type f -iname "*.o" -exec rm {} + | ||
find . -type f -iname "*.so" -exec rm {} + | ||
find . -type d -name "__pycache__" -exec rmdir {} + | ||
./scripts/check_clean_repo_on_master.sh | ||
cd $(dirname $0)/.. | ||
# PKG will be name of the directory one level up containing "__init__.py" | ||
PKG=$(find . -maxdepth 2 -name __init__.py -print0 | xargs -0 -n1 dirname | xargs basename) | ||
! grep --include "*.py" "will_be_missing_in='$VERSION'" -R $PKG/ # see deprecation() | ||
PKG_UPPER=$(echo $PKG | tr '[:lower:]' '[:upper:]') | ||
./scripts/run_tests.sh | ||
env ${PKG_UPPER}_RELEASE_VERSION=$1 python setup.py sdist | ||
env ${PKG_UPPER}_RELEASE_VERSION=v$VERSION python setup.py sdist | ||
env ${PKG_UPPER}_RELEASE_VERSION=v$VERSION ./scripts/generate_docs.sh $4 $5 v$VERSION | ||
for CONDA_PY in 2.7 3.4 3.5; do | ||
for CONDA_NPY in 1.11; do | ||
PATH=$CONDA_PATH:$PATH ./scripts/build_conda_recipe.sh $1 --python $CONDA_PY --numpy $CONDA_NPY | ||
continue # we build the conda recipe on another host for now.. | ||
PATH=$CONDA_PATH:$PATH ./scripts/build_conda_recipe.sh v$VERSION --python $CONDA_PY --numpy $CONDA_NPY | ||
done | ||
done | ||
|
||
# All went well | ||
git tag -a $1 -m $1 | ||
# All went well, add a tag and push it. | ||
git tag -a v$VERSION -m v$VERSION | ||
git push | ||
git push --tags | ||
twine upload dist/${PKG}-$VERSION.tar.gz | ||
MD5=$(md5sum dist/${PKG}-$VERSION.tar.gz | cut -f1 -d' ') | ||
|
||
if [[ -d dist/conda-recipe-$VERSION ]]; then | ||
rm -r dist/conda-recipe-$VERSION | ||
fi | ||
cp -r conda-recipe/ dist/conda-recipe-$VERSION | ||
sed -i -E \ | ||
-e "s/version:(.+)/version: $VERSION/" \ | ||
-e "s/path:(.+)/fn: $PKG-$VERSION.tar.gz\n url: https:\/\/pypi.python.org\/packages\/source\/${PKG:0:1}\/$PKG\/$PKG-$VERSION.tar.gz#md5=$MD5\n md5: $MD5/" \ | ||
-e '/cython/d' dist/conda-recipe-$VERSION/meta.yaml | ||
|
||
# Specific for this project: | ||
scp -r dist/conda-recipe-$VERSION/ $PKG@$SERVER:~/public_html/conda-recipes/ | ||
scp dist/${PKG}-$VERSION.tar.gz $PKG@$SERVER:~/public_html/releases/ | ||
for CONDA_PY in 2.7 3.4 3.5; do | ||
for CONDA_NPY in 1.11; do | ||
ssh $PKG@$SERVER "source /etc/profile; conda-build --python $CONDA_PY --numpy $CONDA_NPY ~/public_html/conda-recipes/conda-recipe-$VERSION/" | ||
done | ||
done | ||
set +x | ||
echo "" | ||
echo " You may now create a new github release with the tag \"v$VERSION\" and name " | ||
echo " it \"${PKG}-${VERSION}\", (don't foreget to manually attach the new .tar.gz" | ||
echo " file from the ./dist/ directory). Then run:" | ||
echo "" | ||
echo " $ ./scripts/post_release.sh $1 MYSERVER MYGITHUBUSERNAME" | ||
echo "" |