Skip to content

Commit

Permalink
Merge pull request #2 from pelson/travis_testing
Browse files Browse the repository at this point in the history
Added travis testing.
  • Loading branch information
pelson committed Oct 13, 2015
2 parents adfe7da + 1d5bbf0 commit 096ca47
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 3 deletions.
25 changes: 25 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
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;
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- conda config --set show_channel_urls True

- conda install --yes python=${python} --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
3 changes: 2 additions & 1 deletion conda_execute/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
python
setuptools
yaml
conda
psutil
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ conda execute $example_script wibble --arg1=123 foobar


cat <<EOF > $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.
Expand Down

0 comments on commit 096ca47

Please sign in to comment.