From b6c4332f77f53375f8ae6f3dfee34a84098f69a4 Mon Sep 17 00:00:00 2001 From: Phil Elson Date: Tue, 13 Oct 2015 08:15:11 +0100 Subject: [PATCH 1/3] Added travis testing. --- .travis.yml | 20 ++++++++++++++++++++ requirements.txt | 2 ++ 2 files changed, 22 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..a661db0 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,20 @@ +language: python + +sudo: false + +install: +- export CONDA_BASE=http://repo.continuum.io/miniconda/Miniconda3 +- wget ${CONDA_BASE}-latest-Linux-x86_64.sh -O miniconda.sh; +- bash miniconda.sh -b -p $HOME/miniconda +- export PATH="$HOME/miniconda/bin:$PATH" +- conda config --set show_channel_urls True + +- conda install --yes --file requirements.txt + +- python setup.py version +- python setup.py install + +script: +- conda execute --help +- python -c "import conda_execute; print(conda_execute.__version__)" +- ./tests/run_tests.sh diff --git a/requirements.txt b/requirements.txt index 48ce42f..472f0ea 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,5 @@ +python +setuptools yaml conda psutil From fad71041fd29592c288bcf3b795ad9bb7eb4be2d Mon Sep 17 00:00:00 2001 From: Phil Elson Date: Tue, 13 Oct 2015 08:28:59 +0100 Subject: [PATCH 2/3] Fixed Py3 code input. --- conda_execute/execute.py | 3 ++- setup.cfg | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/conda_execute/execute.py b/conda_execute/execute.py index b1c152e..3581ed6 100644 --- a/conda_execute/execute.py +++ b/conda_execute/execute.py @@ -233,7 +233,8 @@ def __call__(self, parser, namespace, values, option_string=None): try: if args.code: - with tempfile.NamedTemporaryFile(prefix='conda-execute_', delete=False) as fh: + with tempfile.NamedTemporaryFile(prefix='conda-execute_', + delete=False, mode='w') as fh: fh.writelines(args.code) path = fh.name log.info('Writing temporary code to {}'.format(path)) diff --git a/setup.cfg b/setup.cfg index c690ec6..c4ae51b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -5,7 +5,7 @@ [versioneer] VCS = git -style = pep440-post +style = pep440-pre versionfile_source = conda_execute/_version.py versionfile_build = conda_execute/_version.py tag_prefix = v From 1d5bbf0a9059215a7341b57024db25a97a532f78 Mon Sep 17 00:00:00 2001 From: Phil Elson Date: Tue, 13 Oct 2015 08:31:51 +0100 Subject: [PATCH 3/3] Widened the travis testing. --- .travis.yml | 7 ++++++- tests/run_tests.sh | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index a661db0..b964ebf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,11 @@ language: python sudo: false +env: + - python=2.7 + - python=3.4 + - python=3.5 + install: - export CONDA_BASE=http://repo.continuum.io/miniconda/Miniconda3 - wget ${CONDA_BASE}-latest-Linux-x86_64.sh -O miniconda.sh; @@ -9,7 +14,7 @@ install: - export PATH="$HOME/miniconda/bin:$PATH" - conda config --set show_channel_urls True -- conda install --yes --file requirements.txt +- conda install --yes python=${python} --file requirements.txt - python setup.py version - python setup.py install diff --git a/tests/run_tests.sh b/tests/run_tests.sh index 6215e43..41f2ede 100755 --- a/tests/run_tests.sh +++ b/tests/run_tests.sh @@ -25,7 +25,7 @@ conda execute $example_script wibble --arg1=123 foobar cat < $tmp_script -#!/usr/bin/env conda execute -v +#!/usr/bin/env conda-execute """ A script that uses numpy's random normal distribution to print 10 numbers.