From 18a52d48c4174cfddf53e963e1d42fe3e42afb2e Mon Sep 17 00:00:00 2001 From: Neil Wu Date: Mon, 23 Mar 2020 19:46:45 -0400 Subject: [PATCH 1/9] Update .travis.yml --- .travis.yml | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/.travis.yml b/.travis.yml index fc44214..b58102f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ os: - linux -language: generic +language: python env: - PY=2.7 @@ -15,6 +15,7 @@ addons: - texlive-latex-extra cache: + pip apt: true directories: - $HOME/.cache/pip @@ -33,13 +34,6 @@ before_install: rm -rf $HOME/miniconda; fi -- if [ -f $HOME/.cache/pip ]; then - echo "cached pip found -- nothing to do"; - else - NOT_CACHED_PIP=1; - rm -rf $HOME/.cache/pip; - fi - - rm -rf $HOME/miniconda/lib/python$PY/site-packages/pyXDSM install: @@ -54,23 +48,14 @@ install: export PATH=$HOME/miniconda/bin:$PATH; fi -- if [ "$NOT_CACHED_PIP" ]; then - pip install --upgrade pip; - fi - +- pip install testflo; - pip install . - # display summary of installed packages and their versions - conda list script: -- cd examples -- python kitchen_sink.py -- python mat_eqn.py -- python mdf.py -- ls -- cd .. +- testflo . -v deploy: provider: pypi @@ -79,4 +64,4 @@ deploy: distributions: "sdist bdist_wheel" on: tags: true - skip_existing: true \ No newline at end of file + skip_existing: true From 2b6e5bcafd1c676fc26f190ae53bdb55db1c1c2c Mon Sep 17 00:00:00 2001 From: Neil Wu Date: Mon, 23 Mar 2020 19:52:58 -0400 Subject: [PATCH 2/9] Update .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b58102f..db6880d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,7 @@ addons: - texlive-latex-extra cache: - pip + pip: true apt: true directories: - $HOME/.cache/pip From e8e90cf08516f0a181da44514923fb03b141b6b1 Mon Sep 17 00:00:00 2001 From: Neil Wu Date: Mon, 23 Mar 2020 19:59:28 -0400 Subject: [PATCH 3/9] Removed py2 --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index db6880d..efa375f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,8 +4,9 @@ os: language: python env: - - PY=2.7 - PY=3.6 + - PY=3.7 + - PY=3.8 addons: apt: From f198d39d28c643f98b36b10b42451153124f8a11 Mon Sep 17 00:00:00 2001 From: Neil Wu Date: Mon, 23 Mar 2020 20:05:25 -0400 Subject: [PATCH 4/9] Removed pip cache --- .travis.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index efa375f..71fbbc2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,10 +16,8 @@ addons: - texlive-latex-extra cache: - pip: true apt: true directories: - - $HOME/.cache/pip - $HOME/miniconda before_install: @@ -35,8 +33,6 @@ before_install: rm -rf $HOME/miniconda; fi -- rm -rf $HOME/miniconda/lib/python$PY/site-packages/pyXDSM - install: - if [ "$NOT_CACHED_CONDA" ]; then wget "https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh" -O miniconda.sh; From aa151196520308fe3b68cf7563a7cc94de1553d9 Mon Sep 17 00:00:00 2001 From: Neil Wu Date: Mon, 23 Mar 2020 20:12:05 -0400 Subject: [PATCH 5/9] Update .travis.yml --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 71fbbc2..2e477ae 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ os: - linux -language: python +language: generic env: - PY=3.6 @@ -35,7 +35,7 @@ before_install: install: - if [ "$NOT_CACHED_CONDA" ]; then - wget "https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh" -O miniconda.sh; + wget "https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh" -O miniconda.sh; chmod +x miniconda.sh; ./miniconda.sh -b -p $HOME/miniconda; export PATH=$HOME/miniconda/bin:$PATH; From a43fbe66b3c336965c5c442c37dc43d93262f036 Mon Sep 17 00:00:00 2001 From: Neil Wu Date: Thu, 26 Mar 2020 10:19:51 -0400 Subject: [PATCH 6/9] Added back the example builds as tests --- .travis.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.travis.yml b/.travis.yml index 2e477ae..6e7b813 100644 --- a/.travis.yml +++ b/.travis.yml @@ -54,6 +54,12 @@ install: script: - testflo . -v +# now we build examples as a test +- cd examples +- python kitchen_sink.py +- python mat_eqn.py +- python mdf.py + deploy: provider: pypi user: "__token__" From f467663dccd92772853d58dd866ffd58165f4e30 Mon Sep 17 00:00:00 2001 From: Neil Wu Date: Thu, 26 Mar 2020 11:24:55 -0400 Subject: [PATCH 7/9] added tests for building the examples --- pyxdsm/tests/test_xdsm.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/pyxdsm/tests/test_xdsm.py b/pyxdsm/tests/test_xdsm.py index 0b12213..a7e2a75 100644 --- a/pyxdsm/tests/test_xdsm.py +++ b/pyxdsm/tests/test_xdsm.py @@ -1,7 +1,6 @@ import unittest import os - -from pyxdsm.XDSM import XDSM +from pyxdsm.XDSM import XDSM, __file__ class TestXDSM(unittest.TestCase): @@ -26,6 +25,23 @@ def tearDown(self): except OSError: pass + def test_examples(self): + ''' + This test just builds the three examples, and assert that the output files exist. + Unlike the other tests, this one requires LaTeX to be available. + ''' + os.chdir(os.path.join(os.path.dirname(os.path.abspath(__file__)), '../examples')) + filenames = ['kitchen_sink', 'mdf'] + for f in filenames: + os.system('python {}.py'.format(f)) + self.assertTrue(os.path.isfile(f + '.tikz')) + self.assertTrue(os.path.isfile(f + '.tex')) + self.assertTrue(os.path.isfile(f + '.pdf')) + os.system('python mat_eqn.py') + self.assertTrue(os.path.isfile('mat_eqn_example.pdf')) + # change back to previous directory + os.chdir(self.tempdir) + def test_options(self): filename = 'xdsm_test_options' From 565dce7433ff6d44e149f0ffc49d68d65c138fb8 Mon Sep 17 00:00:00 2001 From: Neil Wu Date: Thu, 26 Mar 2020 11:34:44 -0400 Subject: [PATCH 8/9] Update .travis.yml --- .travis.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6e7b813..7092955 100644 --- a/.travis.yml +++ b/.travis.yml @@ -46,7 +46,7 @@ install: fi - pip install testflo; -- pip install . +- pip install . -e # display summary of installed packages and their versions - conda list @@ -54,12 +54,6 @@ install: script: - testflo . -v -# now we build examples as a test -- cd examples -- python kitchen_sink.py -- python mat_eqn.py -- python mdf.py - deploy: provider: pypi user: "__token__" From 47fd87689bad69b7197893835ca4e464f491e86a Mon Sep 17 00:00:00 2001 From: Neil Wu Date: Thu, 26 Mar 2020 11:41:29 -0400 Subject: [PATCH 9/9] Update .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7092955..61224cc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -46,7 +46,7 @@ install: fi - pip install testflo; -- pip install . -e +- pip install -e . # display summary of installed packages and their versions - conda list