Skip to content

Commit

Permalink
Update post-release script (#22)
Browse files Browse the repository at this point in the history
* Update post-release script

* Add CircleCI

* Use bjodahimg18dev on DroneCI

* CI fixes

* Less python2 testing

* CI fix

* gfortranbegin removed in gfortran 4.5

* Fix phantomjs
  • Loading branch information
bjodah authored Apr 23, 2018
1 parent 41eda64 commit bfa4883
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 26 deletions.
16 changes: 16 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 2

jobs:
build:
docker:
- image: continuumio/miniconda3
steps:
- checkout
- run: apt-get --quiet update && apt-get --quiet --assume-yes install gcc g++
- run: conda config --set always_yes yes
- run: conda update python
- run: conda install conda-build
- run: conda config --add channels conda-forge
- run: conda config --set show_channel_urls true
- run: conda build --python 3.6 conda-recipe
- run: conda build --python 2.7 conda-recipe
11 changes: 5 additions & 6 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
build:
image: bjodah/bjodahimg16dev:v1.3
image: bjodah/bjodahimg18dev:v1.0
environment:
- ASAN_SYMBOLIZER_PATH=/usr/lib/llvm-5.0/bin/llvm-symbolizer
- ASAN_SYMBOLIZER_PATH=/usr/lib/llvm-6.0/bin/llvm-symbolizer
- ASAN_OPTIONS=symbolize=1
commands:
- bash -c '[[ $(python setup.py --version) =~ ^[0-9]+.* ]]'
- (cd examples/; make -B CXX=clang++-5.0 EXTRA_COMPILE_ARGS="-fsanitize=address -O0 -g")
- bash -c '[[ $(python3 setup.py --version) =~ ^[0-9]+.* ]]'
- (cd examples/; make -B CXX=clang++-6.0 EXTRA_COMPILE_ARGS="-fsanitize=address -O0 -g")
- (cd examples/; make -B CXX=g++ EXTRA_COMPILE_ARGS="-DNDEBUG -O2")
- (cd tests/; make -B CXX=clang++-5.0 EXTRA_COMPILE_ARGS="-fsanitize=address -O0 -g")
- (cd tests/; make -B CXX=clang++-6.0 EXTRA_COMPILE_ARGS="-fsanitize=address -O0 -g")
- (cd tests/; make -B CXX=g++ EXTRA_COMPILE_ARGS="-DNDEBUG -O2")
- ./scripts/ci.sh finitediff
- ./scripts/generate_docs.sh
Expand All @@ -25,4 +25,3 @@ deploy:
target: ~
recursive: true
delete: false

1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ v0.4.0
======
- Removed ``*_optim`` functions. (since intermediate results were not used anyways)
- Python wrapper has a new utility subpackage: .grid
- Tweaked conda-recipe

v0.3.5
======
Expand Down
3 changes: 2 additions & 1 deletion conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ source:

build:
number: 0
script: python setup.py install --single-version-externally-managed --record record.txt
script: python -m pip install --no-deps --ignore-installed .

requirements:
build:
- python
- setuptools
- pip
- cython
- numpy
run:
Expand Down
13 changes: 5 additions & 8 deletions scripts/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,11 @@ if [[ "$CI_BRANCH" =~ ^v[0-9]+.[0-9]?* ]]; then
eval export ${PKG_NAME^^}_RELEASE_VERSION=\$CI_BRANCH
echo ${CI_BRANCH} | tail -c +2 > __conda_version__.txt
fi
python2 setup.py sdist
for PYTHON in python2 python3; do
(cd dist/; $PYTHON -m pip install $PKG_NAME-$($PYTHON ../setup.py --version).tar.gz)
(cd /; $PYTHON -m pytest --pyargs $PKG_NAME)
$PYTHON -m pip install --user -e .[all]
done
PYTHONPATH=$(pwd) PYTHON=python2 ./scripts/run_tests.sh
PYTHONPATH=$(pwd) PYTHON=python3 ./scripts/run_tests.sh --cov $PKG_NAME --cov-report html
python3 setup.py sdist
(cd dist/; python3 -m pip install $PKG_NAME-$(python3 ../setup.py --version).tar.gz)
(cd /; python3 -m pytest --pyargs $PKG_NAME)
python3 -m pip install --user -e .[all]
PYTHONPATH=$(pwd) ./scripts/run_tests.sh --cov $PKG_NAME --cov-report html
./scripts/coverage_badge.py htmlcov/ htmlcov/coverage.svg

# Make sure repo is pip installable from git-archive zip
Expand Down
16 changes: 10 additions & 6 deletions scripts/post_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,16 @@ sed -i -E \
-e "/cython/d" \
dist/conda-recipe-$VERSION/meta.yaml

ssh $PKG@$SERVER 'mkdir -p ~/public_html/conda-packages'
for CONDA_PY in 27 35 36; do
anfilte-build . dist/conda-recipe-$VERSION dist/ --python ${CONDA_PY}
scp dist/linux-64/${PKG}-${VERSION}-py${CONDA_PY}*.bz2 $PKG@$SERVER:~/public_html/conda-packages/
done
ssh $PKG@$SERVER 'mkdir -p ~/public_html/conda-recipes'
scp -r dist/conda-recipe-$VERSION/ $PKG@$SERVER:~/public_html/conda-recipes/
scp "$SDIST_FILE" "$PKG@$SERVER:~/public_html/releases/"


if [[ -e ./scripts/update-gh-pages.sh ]]; then
./scripts/update-gh-pages.sh v$VERSION
fi
# 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.5 3.6; do
ssh $PKG@$SERVER "source /etc/profile; conda-build --python $CONDA_PY ~/public_html/conda-recipes/conda-recipe-$VERSION/"
done
2 changes: 1 addition & 1 deletion scripts/render_index.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ for f in $@; do
continue # don't include bokeh apps
fi
img=$(basename $f .html).png
phantomjs $(unset CDPATH && cd "$(dirname "$0")" && echo $PWD)/rasterize.js $f $tmpdir/$img 1200px*900px
QT_QPA_PLATFORM=offscreen phantomjs $(unset CDPATH && cd "$(dirname "$0")" && echo $PWD)/rasterize.js $f $tmpdir/$img 1200px*900px
convert $tmpdir/$img -resize 400x300 thumbs/$img
cat <<EOF>>index.html
<p style='text-align: center'>
Expand Down
6 changes: 3 additions & 3 deletions scripts/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
# $ ./scripts/run_tests.sh
# or
# $ ./scripts/run_tests.sh --cov pycvodes --cov-report html
${PYTHON:-python} setup.py build_ext -i
${PYTHON:-python} -m pytest --doctest-modules --pep8 --flakes $@
${PYTHON:-python} -m doctest README.rst
${PYTHON:-python3} setup.py build_ext -i
${PYTHON:-python3} -m pytest --doctest-modules --pep8 --flakes $@
${PYTHON:-python3} -m doctest README.rst
2 changes: 1 addition & 1 deletion src/tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ test_finitediff_fort: ../finitediff_fort.f90 test_finitediff_fort.f90
$(FC) $(FLAGS) $(FFLAGS) -o $@ -c $^

test_finitediff: c_finitediff_fort.o finitediff_fort.o test_finitediff.cpp ../../finitediff/include/finitediff_templated.hpp
$(CXX) $(FLAGS) $(CXXFLAGS) -I../../finitediff/include -o $@ $^ -lgfortranbegin -lgfortran -lm
$(CXX) $(FLAGS) $(CXXFLAGS) -I../../finitediff/include -o $@ $^ -lgfortran -lm

0 comments on commit bfa4883

Please sign in to comment.