From 9c314f47225efb069b1698eb335ee982c347ea14 Mon Sep 17 00:00:00 2001 From: Harvey Thompson <58153750+Harveyt47@users.noreply.github.com> Date: Wed, 27 May 2020 16:16:56 +1000 Subject: [PATCH 01/19] creating test.yml still need to add test changes for this to work --- .github/workflows/test.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..fc945e2f3 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,34 @@ +name: continuous-integration + +on: [pull_request , push] + +jobs: + tests: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [windows-latest, ubuntu-latest, macos-latest] + python-version: [3.6, 3.7, 3.8] + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pytest tables + pip install pytest-cov + python setup.py develop + pip install -U pip nose coverage numpy scipy pandas numba sympy ipython statsmodels flake8 + python setup.py install + - name: Run Tests + run: | + flake8 --select F401, F405,E231 quantecon + pytest quantecon/game_theory/tests + pytest quantecon/markov/tests + pytest quantecon/optimize/tests + pytest quantecon/random/tests + pytest quantecon/tests + pytest quantecon/util/tests From 49d11a6c7763eb0306ab6d3e08900916f3a50c62 Mon Sep 17 00:00:00 2001 From: Harvey Thompson <58153750+Harveyt47@users.noreply.github.com> Date: Wed, 10 Jun 2020 16:28:52 +1000 Subject: [PATCH 02/19] testing addition of coveralls --- .github/workflows/test.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fc945e2f3..4b5428261 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,12 +23,14 @@ jobs: python setup.py develop pip install -U pip nose coverage numpy scipy pandas numba sympy ipython statsmodels flake8 python setup.py install + pip install coveralls - name: Run Tests run: | flake8 --select F401, F405,E231 quantecon - pytest quantecon/game_theory/tests - pytest quantecon/markov/tests - pytest quantecon/optimize/tests - pytest quantecon/random/tests - pytest quantecon/tests - pytest quantecon/util/tests + coverage run --source=quantecon -m pytest quantecon/game_theory/tests + coverage run --source=quantecon -m pytest quantecon/markov/tests + coverage run --source=quantecon -m pytest quantecon/optimize/tests + coverage run --source=quantecon -m pytest quantecon/random/tests + coverage run --source=quantecon -m pytest quantecon/tests + coverage run --source=quantecon -m pytest quantecon/util/tests + coveralls From 6cc1383e3a5d39c12c42d1d675f13de98b745da4 Mon Sep 17 00:00:00 2001 From: Harvey Thompson <58153750+Harveyt47@users.noreply.github.com> Date: Wed, 10 Jun 2020 16:42:56 +1000 Subject: [PATCH 03/19] add coveralls token --- .github/workflows/test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4b5428261..ed4bac630 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,6 +25,10 @@ jobs: python setup.py install pip install coveralls - name: Run Tests + + env: + COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} + run: | flake8 --select F401, F405,E231 quantecon coverage run --source=quantecon -m pytest quantecon/game_theory/tests From 788e81d1b89513c2d9971b898dbdfbd22d86f091 Mon Sep 17 00:00:00 2001 From: Harvey Thompson <58153750+Harveyt47@users.noreply.github.com> Date: Wed, 10 Jun 2020 16:50:47 +1000 Subject: [PATCH 04/19] edit token --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ed4bac630..ed86891bb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,7 +27,7 @@ jobs: - name: Run Tests env: - COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} + COVERALLS_REPO_TOKEN: ${{ 7f8JDNk6BsPMESy0URL3W00zlazzRcuzR }} run: | flake8 --select F401, F405,E231 quantecon From ae3ebeb9c8634a7dc43e878e9fe8fa462a96c000 Mon Sep 17 00:00:00 2001 From: Harvey Thompson <58153750+Harveyt47@users.noreply.github.com> Date: Wed, 10 Jun 2020 16:53:07 +1000 Subject: [PATCH 05/19] edit token 2 --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ed86891bb..d8f227d4b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,7 +27,7 @@ jobs: - name: Run Tests env: - COVERALLS_REPO_TOKEN: ${{ 7f8JDNk6BsPMESy0URL3W00zlazzRcuzR }} + COVERALLS_REPO_TOKEN: 7f8JDNk6BsPMESy0URL3W00zlazzRcuzR run: | flake8 --select F401, F405,E231 quantecon From 9af5e7cc3ec54428eca076f8e25dfc8cc51991a5 Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Wed, 10 Jun 2020 19:21:29 +1000 Subject: [PATCH 06/19] migrate to GitHub Actions secrets --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d8f227d4b..c1854bf1b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,7 +27,7 @@ jobs: - name: Run Tests env: - COVERALLS_REPO_TOKEN: 7f8JDNk6BsPMESy0URL3W00zlazzRcuzR + COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} run: | flake8 --select F401, F405,E231 quantecon From 02ba1de589ff3eef56ee2f2efa171b3f0b3a41f6 Mon Sep 17 00:00:00 2001 From: Harvey Thompson <58153750+Harveyt47@users.noreply.github.com> Date: Thu, 11 Jun 2020 12:20:04 +1000 Subject: [PATCH 07/19] remove duplicate testing on push and PR --- .github/workflows/test.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c1854bf1b..0daef6b8d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,7 +1,12 @@ name: continuous-integration -on: [pull_request , push] +on: + push: + branches: + - master + pull_request: + jobs: tests: runs-on: ${{ matrix.os }} From b9e858a8c7165ead0eaebf4150888e198287cb99 Mon Sep 17 00:00:00 2001 From: Harvey Thompson <58153750+Harveyt47@users.noreply.github.com> Date: Fri, 3 Jul 2020 15:29:06 +1000 Subject: [PATCH 08/19] Test new Coveralls set up Using similar set up as to [here](https://github.com/marketplace/actions/coveralls-github-action) --- .github/workflows/test.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0daef6b8d..92f23633b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,10 +30,6 @@ jobs: python setup.py install pip install coveralls - name: Run Tests - - env: - COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} - run: | flake8 --select F401, F405,E231 quantecon coverage run --source=quantecon -m pytest quantecon/game_theory/tests @@ -42,4 +38,8 @@ jobs: coverage run --source=quantecon -m pytest quantecon/random/tests coverage run --source=quantecon -m pytest quantecon/tests coverage run --source=quantecon -m pytest quantecon/util/tests - coveralls + - name: Coveralls + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.github_token }} + flag-name: run-${{ matrix.python-version }} From 4f7938b20f8b798890ca6a9459016eb20862b8e1 Mon Sep 17 00:00:00 2001 From: Harvey Thompson <58153750+Harveyt47@users.noreply.github.com> Date: Fri, 3 Jul 2020 18:02:03 +1000 Subject: [PATCH 09/19] removing `flag-name` input --- .github/workflows/test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 92f23633b..a02a28efb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -42,4 +42,3 @@ jobs: uses: coverallsapp/github-action@master with: github-token: ${{ secrets.github_token }} - flag-name: run-${{ matrix.python-version }} From 326695c05ca52212cccc61ab2713c6c108afa213 Mon Sep 17 00:00:00 2001 From: rht Date: Fri, 1 Jan 2021 02:46:24 -0500 Subject: [PATCH 10/19] Remove .coveralls.yml --- .coveralls.yml | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 .coveralls.yml diff --git a/.coveralls.yml b/.coveralls.yml deleted file mode 100644 index 653a5b1c6..000000000 --- a/.coveralls.yml +++ /dev/null @@ -1,2 +0,0 @@ -service_name: travis-ci -repo_token: 7f8JDNk6BsPMESy0URL3W00zlazzRcuzR From 7c3ec8b40b8c9ef5eda946c7476d27aeb0e208c3 Mon Sep 17 00:00:00 2001 From: rht Date: Fri, 1 Jan 2021 02:52:22 -0500 Subject: [PATCH 11/19] GA: Remove Python 3.6 from the build matrix Otherwise, scipy returns this error during installation: RuntimeError: Python version >= 3.7 required. --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a02a28efb..a4cfe84ff 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: os: [windows-latest, ubuntu-latest, macos-latest] - python-version: [3.6, 3.7, 3.8] + python-version: [3.7, 3.8] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} From c80307e69ca04284a70738e4db7334f30423ac17 Mon Sep 17 00:00:00 2001 From: rht Date: Fri, 1 Jan 2021 03:00:38 -0500 Subject: [PATCH 12/19] GA: Use nose to run the tests --- .github/workflows/test.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a4cfe84ff..11085ff5f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,12 +32,7 @@ jobs: - name: Run Tests run: | flake8 --select F401, F405,E231 quantecon - coverage run --source=quantecon -m pytest quantecon/game_theory/tests - coverage run --source=quantecon -m pytest quantecon/markov/tests - coverage run --source=quantecon -m pytest quantecon/optimize/tests - coverage run --source=quantecon -m pytest quantecon/random/tests - coverage run --source=quantecon -m pytest quantecon/tests - coverage run --source=quantecon -m pytest quantecon/util/tests + nosetests --with-coverage -a "!slow" --cover-package=quantecon - name: Coveralls uses: coverallsapp/github-action@master with: From c5771c8ce7b88f7c51503f0628a159bc2211f071 Mon Sep 17 00:00:00 2001 From: rht Date: Fri, 1 Jan 2021 03:46:44 -0500 Subject: [PATCH 13/19] Use AndreMiras' version of Coveralls action According to https://github.com/coverallsapp/github-action/issues/4#issuecomment-727600521, this version works, unlike the official https://github.com/marketplace/actions/coveralls-github-action. --- .github/workflows/test.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 11085ff5f..86ada3377 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,7 +33,17 @@ jobs: run: | flake8 --select F401, F405,E231 quantecon nosetests --with-coverage -a "!slow" --cover-package=quantecon - - name: Coveralls - uses: coverallsapp/github-action@master + - name: Coveralls Parallel + uses: AndreMiras/coveralls-python-action@develop + if: runner.os == 'Linux' with: - github-token: ${{ secrets.github_token }} + flag-name: run-${{ matrix.test_number }} + parallel: true + coveralls_finish: + needs: tests + runs-on: ubuntu-latest + steps: + - name: Coveralls Finished + uses: AndreMiras/coveralls-python-action@develop + with: + parallel-finished: true From fbb223b2e82b9b2421f725a77c2d9e7499022bee Mon Sep 17 00:00:00 2001 From: rht Date: Fri, 1 Jan 2021 04:08:13 -0500 Subject: [PATCH 14/19] Remove .travis.yml --- .travis.yml | 59 ----------------------------------------------------- 1 file changed, 59 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 0eba3f5c0..000000000 --- a/.travis.yml +++ /dev/null @@ -1,59 +0,0 @@ -# Travis Configuration for QuantEcon.py -# -# Thank you for the writeup given by dan-blanchard at https://gist.github.com/dan-blanchard/7045057 -# - -sudo: false #Use new Container Infrastructure -language: python -dist: xenial - -cache: - pip: true - directories: - # osx-specific caches - - $HOME/Library/Caches/pip - -addons: - apt: - packages: - - hdf5-tools - homebrew: - packages: - - hdf5 - -matrix: - include: - - python: 3.7 - - os: osx - osx_image: xcode10 - sudo: required - env: TRAVIS_PYTHON_VERSION=3.7 - language: generic - before_install: - - pip install virtualenv - - virtualenv env -p python3 - - source env/bin/activate - -notifications: - email: false - -branches: - only: - - master - -install: - - pip install -U pip nose coveralls coverage numpy scipy pandas numba sympy ipython statsmodels flake8 - - pip install tables - - python setup.py install - -script: - - flake8 --select F401, F405,E231 quantecon - - nosetests --with-coverage -a "!slow" --cover-package=quantecon - -after_success: - - | - if [ "$TRAVIS_OS_NAME" == "linux" ]; then - coveralls - fi - # Enable this to occasionally test performance - # - nosetests -a "slow" From 652590718a96a10b7be5767130e35eba2b2ecba1 Mon Sep 17 00:00:00 2001 From: rht Date: Fri, 1 Jan 2021 04:24:44 -0500 Subject: [PATCH 15/19] Add relative_files = True in .coveragerc --- .coveragerc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.coveragerc b/.coveragerc index 7c5fb46f5..1f9de38a8 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,4 +1,7 @@ [run] +# relative_files = True is necessary as per documentation of +# https://github.com/AndreMiras/coveralls-python-action +relative_files = True source = quantecon omit = */python?.?/* From 8809199c1754a6cf41440064ba0489fd2d656ef3 Mon Sep 17 00:00:00 2001 From: rht Date: Fri, 1 Jan 2021 04:40:52 -0500 Subject: [PATCH 16/19] GA: Ignore Python 3.7 on Windows --- .github/workflows/test.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 86ada3377..d5a13f1cf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,5 +1,13 @@ name: continuous-integration +# We ignore Python 3.7 on windows-latest because 3 tests are failing: +# - FAIL: test_quadrect_2d_H (quantecon.tests.test_quad.TestQuadrect) +# AssertionError: +# Not equal to tolerance rtol=1e-07, atol=0 +# - FAIL: test_quadrect_2d_H2 (quantecon.tests.test_quad.TestQuadrect) +# AssertionError: +# Not equal to tolerance rtol=1e-07, atol=0 +# - The last error can't be found from the log on: push: @@ -14,6 +22,9 @@ jobs: matrix: os: [windows-latest, ubuntu-latest, macos-latest] python-version: [3.7, 3.8] + exclude: + - os: windows-latest + python-version: 3.7 steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} From 0a072b48736bd32b1b1b5d13d6f0c1709a30bcce Mon Sep 17 00:00:00 2001 From: rht Date: Fri, 1 Jan 2021 04:45:32 -0500 Subject: [PATCH 17/19] Remove unused coveralls lib --- .github/workflows/test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d5a13f1cf..6ca894acf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -39,7 +39,6 @@ jobs: python setup.py develop pip install -U pip nose coverage numpy scipy pandas numba sympy ipython statsmodels flake8 python setup.py install - pip install coveralls - name: Run Tests run: | flake8 --select F401, F405,E231 quantecon From 71390b57e06f6fc4902052eff37bb9889ca46cc4 Mon Sep 17 00:00:00 2001 From: rht Date: Fri, 1 Jan 2021 05:17:15 -0500 Subject: [PATCH 18/19] Remove pytest --- .github/workflows/test.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6ca894acf..5ee27faff 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,10 +34,8 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install pytest tables - pip install pytest-cov - python setup.py develop - pip install -U pip nose coverage numpy scipy pandas numba sympy ipython statsmodels flake8 + pip install -U nose coverage numpy scipy pandas numba sympy ipython statsmodels flake8 + pip install tables python setup.py install - name: Run Tests run: | From d8c44005a1b5bbe9e1977682332adefa8eaf44bd Mon Sep 17 00:00:00 2001 From: rht Date: Fri, 1 Jan 2021 05:23:55 -0500 Subject: [PATCH 19/19] Add comment for running performance test --- .github/workflows/test.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5ee27faff..46ca4ce9a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,6 +8,9 @@ name: continuous-integration # AssertionError: # Not equal to tolerance rtol=1e-07, atol=0 # - The last error can't be found from the log +# +# Run this occasionally to test performance: +# nosetests -a "slow" on: push: