From 59b4e6881d07ef8fc089af0918c01fd835f7efe1 Mon Sep 17 00:00:00 2001 From: Mario Mulansky Date: Wed, 29 Dec 2021 17:02:06 -0600 Subject: Create python-package.yml Switch from travis to GitHub actions --- .github/workflows/python-package.yml | 45 ++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/python-package.yml (limited to '.github/workflows') diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml new file mode 100644 index 0000000..48bb849 --- /dev/null +++ b/.github/workflows/python-package.yml @@ -0,0 +1,45 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: Python package + +on: + push: + branches: [ master, develop ] + pull_request: + branches: [ master, develop ] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.7", "3.8", "3.9", "3.10"] + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install libblas-dev + sudo apt-get install liblapack-dev + sudo apt-get install gfortran + python -m pip install --upgrade pip + python -m pip install flake8 pytest nose numpy scipy + python -m pip install -q cython + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + # - name: Lint with flake8 + # run: | + # # 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 nosetest + run: | + nosetes -- cgit v1.2.3 From ea268fc804d074450e3c0c15d496d0dfbc12ac15 Mon Sep 17 00:00:00 2001 From: Mario Mulansky Date: Wed, 29 Dec 2021 17:05:36 -0600 Subject: Fix typo in workflow --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.github/workflows') diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 48bb849..605a31e 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -42,4 +42,4 @@ jobs: # flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with nosetest run: | - nosetes + nosetests -- cgit v1.2.3 From 3581e2fb182a4b1c5e0e120cd326b5d44574ea3a Mon Sep 17 00:00:00 2001 From: Mario Mulansky Date: Wed, 29 Dec 2021 17:11:48 -0600 Subject: Add setup.py command to test workflow --- .github/workflows/python-package.yml | 4 ++++ 1 file changed, 4 insertions(+) (limited to '.github/workflows') diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 605a31e..80b7ba3 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -34,6 +34,9 @@ jobs: python -m pip install flake8 pytest nose numpy scipy python -m pip install -q cython if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Install package + run: | + python setup.py build_ext --inplace # - name: Lint with flake8 # run: | # # stop the build if there are Python syntax errors or undefined names @@ -43,3 +46,4 @@ jobs: - name: Test with nosetest run: | nosetests + nosetests test/numeric -- cgit v1.2.3 From 17fd0f63712a38c5b5e08456f6e9b192fee41c83 Mon Sep 17 00:00:00 2001 From: Mario Mulansky Date: Wed, 29 Dec 2021 17:17:36 -0600 Subject: Use pytest in CI instead of nosetests --- .github/workflows/python-package.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 80b7ba3..0f9e548 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -45,5 +45,4 @@ jobs: # flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with nosetest run: | - nosetests - nosetests test/numeric + pytest -- cgit v1.2.3 From 74445a5c93fb029e140e70c2ef28304c12e0a85e Mon Sep 17 00:00:00 2001 From: Mario Mulansky Date: Wed, 29 Dec 2021 17:27:52 -0600 Subject: Remove --inplace from workflow install --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.github/workflows') diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 0f9e548..81724d8 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -36,7 +36,7 @@ jobs: if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Install package run: | - python setup.py build_ext --inplace + python setup.py build_ext # - name: Lint with flake8 # run: | # # stop the build if there are Python syntax errors or undefined names -- cgit v1.2.3 From a0053c004ed55e7eb5effd43faa3c0d49cf7c373 Mon Sep 17 00:00:00 2001 From: Mario Mulansky Date: Wed, 29 Dec 2021 17:39:10 -0600 Subject: Call python -m pytest in test workflow --- .github/workflows/python-package.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 81724d8..edb25d2 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -43,6 +43,6 @@ jobs: # 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 nosetest + - name: Test with PyTest run: | - pytest + python3 -m pytest -- cgit v1.2.3 From cf421763434059d5fb1e5cc347b0db781116767d Mon Sep 17 00:00:00 2001 From: Mario Mulansky Date: Wed, 29 Dec 2021 17:53:33 -0600 Subject: Add cython to test matrix --- .github/workflows/python-package.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index edb25d2..6585af4 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -17,6 +17,7 @@ jobs: fail-fast: false matrix: python-version: ["3.7", "3.8", "3.9", "3.10"] + cython: ['python -m pip install -q cython', 'echo "No Cython"'] steps: - uses: actions/checkout@v2 @@ -32,11 +33,13 @@ jobs: sudo apt-get install gfortran python -m pip install --upgrade pip python -m pip install flake8 pytest nose numpy scipy - python -m pip install -q cython if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Install Cython + run: | + ${{ matrix.cython }} - name: Install package run: | - python setup.py build_ext + python setup.py build_ext --inplace # - name: Lint with flake8 # run: | # # stop the build if there are Python syntax errors or undefined names @@ -45,4 +48,4 @@ jobs: # flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with PyTest run: | - python3 -m pytest + python -m pytest -- cgit v1.2.3