diff --git a/.gitignore b/.gitignore index ba74660..3d58548 100644 --- a/.gitignore +++ b/.gitignore @@ -55,3 +55,6 @@ docs/_build/ # PyBuilder target/ + +#conda build files +conda-bld/ \ No newline at end of file diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..aa3bf44 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,34 @@ +language: python + +python: + - "2.7" + - "3.4" + - "3.6" + +install: + - sudo apt-get update + - if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then + wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh; + else + wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; + fi + - bash miniconda.sh -b -p $HOME/miniconda + - export PATH="$HOME/miniconda/bin:$PATH" + - hash -r + - conda config --set always_yes yes --set changeps1 no + - conda update -q conda + - conda info -a + - conda install conda-build + - conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION + - source activate test-environment + - conda build . + +script: + - echo "script step" + +deploy: + - provider: script + script: ./scripts/deploy_anaconda.sh + on: + tags: true + skip_cleanup: true \ No newline at end of file diff --git a/meta.yaml b/meta.yaml new file mode 100644 index 0000000..1bf9b06 --- /dev/null +++ b/meta.yaml @@ -0,0 +1,47 @@ +{% set name = "ipython_memwatcher" %} +{% set version = "0.2.1" %} +{% set file_ext = "tar.gz" %} +{% set hash_type = "sha256" %} +{% set hash_value = "a8a3204d5baf930cb3e379ccce215c0af4f33d95338ea7c31a4886cbf6409866" %} + +package: + name: '{{ name|lower }}' + version: '{{ version }}' + +source: + fn: '{{ name }}-{{ version }}.{{ file_ext }}' + url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.{{ file_ext }} + '{{ hash_type }}': '{{ hash_value }}' + +build: + number: 0 + script: python setup.py install --single-version-externally-managed --record=record.txt + +requirements: + host: + - python + - setuptools + - ipython >=2.1 + - memory_profiler + run: + - python + - ipython >=2.1 + - memory_profiler + +test: + imports: + - ipython_memwatcher + +about: + home: https://github.com/FrancescAlted/ipython_memwatcher + license: BSD-2-Clause + license_family: BSD + license_file: 'LICENSE.txt' + summary: 'ipython_memwatcher: display memory usage during IPython execution' + description: "ipython_memwatcher is an IPython tool to report memory usage deltas for\nevery command you type.\n\nThis is strongly based on\nhttps://github.com/ianozsvald/ipython_memory_usage by Ian Ozsvald\ + \ and in\nthe future ipython_memwatcher can merged back into ipython_memory_usage." + doc_url: '' + dev_url: '' + +extra: + recipe-maintainers: 'faltet AT gmail DOT com' diff --git a/scripts/deploy_anaconda.sh b/scripts/deploy_anaconda.sh new file mode 100755 index 0000000..dc562bf --- /dev/null +++ b/scripts/deploy_anaconda.sh @@ -0,0 +1,25 @@ +#!/bin/bash +# this script uses the ANACONDA_TOKEN env var. +# to create a token: +# >>> anaconda login +# >>> anaconda auth -c -n travis --max-age 307584000 --url https://anaconda.org/USERNAME/PACKAGENAME --scopes "api:write api:read" +set -e + +CONDA_PATH=$(which conda | sed -e 's/\(miniconda.\)\/.*/\1/g') +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +OUT="$SCRIPT_DIR/../conda-bld" + + +echo "Converting conda package..." +conda convert --platform all $CONDA_PATH/conda-bld/linux-64/ipython_memwatcher-*.tar.bz2 --output-dir $OUT/ + +echo "copy original linux-64 packages..." +if [ ! -d $OUT/linux-64 ]; then + mkdir $OUT/linux-64/ +fi +cp -v $CONDA_PATH/conda-bld/linux-64/ipython_memwatcher-*.tar.bz2 $OUT/linux-64/ + +echo "Deploying to Anaconda.org..." +anaconda -t $ANACONDA_TOKEN upload $SCRIPT_DIR/../conda-bld/**/ipython_memwatcher-*.tar.bz2 + +exit 0 \ No newline at end of file