Skip to content

Added scripts to create a conda package. #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,6 @@ docs/_build/

# PyBuilder
target/

#conda build files
conda-bld/
34 changes: 34 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
47 changes: 47 additions & 0 deletions meta.yaml
Original file line number Diff line number Diff line change
@@ -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'
25 changes: 25 additions & 0 deletions scripts/deploy_anaconda.sh
Original file line number Diff line number Diff line change
@@ -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