From 3f725cc0f017286c9c44ed274b02fea401dd0233 Mon Sep 17 00:00:00 2001 From: Danhickstein Date: Wed, 7 Dec 2022 09:24:55 -0700 Subject: [PATCH 1/5] Adding github workflow for testing --- .github/workflows/python-package-conda.yml | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/python-package-conda.yml diff --git a/.github/workflows/python-package-conda.yml b/.github/workflows/python-package-conda.yml new file mode 100644 index 00000000..57940bdb --- /dev/null +++ b/.github/workflows/python-package-conda.yml @@ -0,0 +1,34 @@ +name: Python Package using Conda + +on: [push] + +jobs: + build-linux: + runs-on: ubuntu-latest + strategy: + max-parallel: 5 + + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: 3.10 + - name: Add conda to system path + run: | + # $CONDA is an environment variable pointing to the root of the miniconda directory + echo $CONDA/bin >> $GITHUB_PATH + - name: Install dependencies + run: | + conda env update --file environment.yml --name base + - name: Lint with flake8 + run: | + conda install flake8 + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest + run: | + conda install pytest + pytest From d1ab3c8dcba9e6a22ddc6b8e282880aac8ff649b Mon Sep 17 00:00:00 2001 From: DanHickstein Date: Wed, 7 Dec 2022 09:28:53 -0700 Subject: [PATCH 2/5] switched to py3.9 --- .github/workflows/python-package-conda.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-package-conda.yml b/.github/workflows/python-package-conda.yml index 57940bdb..a5b52874 100644 --- a/.github/workflows/python-package-conda.yml +++ b/.github/workflows/python-package-conda.yml @@ -10,10 +10,10 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Set up Python 3.10 + - name: Set up Python 3.9 uses: actions/setup-python@v3 with: - python-version: 3.10 + python-version: 3.9 - name: Add conda to system path run: | # $CONDA is an environment variable pointing to the root of the miniconda directory From 3e593c9830da87ee593788927931af4a0e463759 Mon Sep 17 00:00:00 2001 From: DanHickstein Date: Wed, 7 Dec 2022 09:39:32 -0700 Subject: [PATCH 3/5] Update python-package-conda.yml --- .github/workflows/python-package-conda.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/python-package-conda.yml b/.github/workflows/python-package-conda.yml index a5b52874..19718eae 100644 --- a/.github/workflows/python-package-conda.yml +++ b/.github/workflows/python-package-conda.yml @@ -1,6 +1,6 @@ name: Python Package using Conda -on: [push] +on: [push, pull_request] jobs: build-linux: @@ -9,9 +9,9 @@ jobs: max-parallel: 5 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v2 - name: Set up Python 3.9 - uses: actions/setup-python@v3 + uses: actions/setup-python@v2 with: python-version: 3.9 - name: Add conda to system path @@ -20,10 +20,12 @@ jobs: echo $CONDA/bin >> $GITHUB_PATH - name: Install dependencies run: | - conda env update --file environment.yml --name base - name: Lint with flake8 run: | conda install flake8 + conda install numpy + conda install scipy + conda install matplotlib # stop the build if there are Python syntax errors or undefined names flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide @@ -31,4 +33,4 @@ jobs: - name: Test with pytest run: | conda install pytest - pytest + pytest -v \ No newline at end of file From 46a5b0c67759d4b77c9fa2886f90b5f8b096f4b2 Mon Sep 17 00:00:00 2001 From: DanHickstein Date: Wed, 7 Dec 2022 09:43:06 -0700 Subject: [PATCH 4/5] remove flake8 testing --- .github/workflows/python-package-conda.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-package-conda.yml b/.github/workflows/python-package-conda.yml index 19718eae..d7d88842 100644 --- a/.github/workflows/python-package-conda.yml +++ b/.github/workflows/python-package-conda.yml @@ -27,9 +27,9 @@ jobs: conda install scipy conda install matplotlib # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + # flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with pytest run: | conda install pytest From e532fb03dd64342fb0e1213d6f27011341153133 Mon Sep 17 00:00:00 2001 From: DanHickstein Date: Wed, 7 Dec 2022 09:49:24 -0700 Subject: [PATCH 5/5] re-organized yml file --- .github/workflows/python-package-conda.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-package-conda.yml b/.github/workflows/python-package-conda.yml index d7d88842..d38bd034 100644 --- a/.github/workflows/python-package-conda.yml +++ b/.github/workflows/python-package-conda.yml @@ -19,13 +19,14 @@ jobs: # $CONDA is an environment variable pointing to the root of the miniconda directory echo $CONDA/bin >> $GITHUB_PATH - name: Install dependencies - run: | - - name: Lint with flake8 run: | conda install flake8 conda install numpy conda install scipy conda install matplotlib + - name: Lint with flake8 + run: | + # flake8 testing disabled for now: # stop the build if there are Python syntax errors or undefined names # flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide