From e64c821a6c422321c90feda8ff77bb92616ebc91 Mon Sep 17 00:00:00 2001 From: Christiaan Meijer Date: Thu, 18 Feb 2021 15:20:12 +0100 Subject: [PATCH 01/12] add CI github action (refs #44) --- .github/workflows/python-package.yml | 74 ++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 .github/workflows/python-package.yml diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml new file mode 100644 index 0000000..30e7de6 --- /dev/null +++ b/.github/workflows/python-package.yml @@ -0,0 +1,74 @@ +# 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: CI Build + +on: + push: + pull_request: + types: [opened, reopened] + +jobs: + first_check: + name: first code check / python-3.8 / ubuntu-latest + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v1 + with: + python-version: 3.8 + - name: Python info + run: | + which python + python --version + - name: Build package and create dev environment + run: | + python -m pip install --upgrade pip + pip install -e .[dev] + - name: Show pip list + run: | + pip list + - name: Check style against standards using prospector + shell: bash -l {0} + run: prospector --profile linter_profile -o grouped -o pylint:pylint-report.txt + - name: Run unit test / Test coverage with Scrutinizer + run: | + pytest + + basic_checks: + name: Run tests across OS and versions / python-${{ matrix.python-version }} / ${{ matrix.os }} + runs-on: ${{ matrix.os }} + needs: first_check + strategy: + fail-fast: false + matrix: + os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] + python-version: ['3.6', '3.7', '3.8'] + exclude: + # already tested in first_check job + - python-version: 3.8 + os: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + - name: Python info + run: | + which python + python --version + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -e .[dev] + - name: Show pip list + run: | + pip list + - name: Run unit tests + run: | + pytest + - name: Check style against standards using prospector + shell: bash -l {0} + run: prospector --profile linter_profile -o grouped -o pylint:pylint-report.txt From 34ed01d2d8481a0fd667b8fe7cc54100ba7f1889 Mon Sep 17 00:00:00 2001 From: Christiaan Meijer Date: Thu, 18 Feb 2021 15:26:33 +0100 Subject: [PATCH 02/12] add dependency installation to github workflow --- .github/workflows/python-package.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 30e7de6..7689ee9 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -22,10 +22,10 @@ jobs: run: | which python python --version - - name: Build package and create dev environment + - name: Install mcfly run: | python -m pip install --upgrade pip - pip install -e .[dev] + pip install mcfly - name: Show pip list run: | pip list @@ -59,10 +59,10 @@ jobs: run: | which python python --version - - name: Install dependencies + - name: Install mcfly run: | python -m pip install --upgrade pip - pip install -e .[dev] + pip install mcfly - name: Show pip list run: | pip list From e831c18da55f09a92eb387586f0541be90c29d02 Mon Sep 17 00:00:00 2001 From: Christiaan Meijer Date: Thu, 18 Feb 2021 15:31:45 +0100 Subject: [PATCH 03/12] add prospector installation to github workflow --- .github/workflows/python-package.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 7689ee9..b63bb3d 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -22,10 +22,10 @@ jobs: run: | which python python --version - - name: Install mcfly + - name: Install dependiencies run: | python -m pip install --upgrade pip - pip install mcfly + pip install mcfly prospector - name: Show pip list run: | pip list @@ -59,10 +59,10 @@ jobs: run: | which python python --version - - name: Install mcfly + - name: Install dependencies run: | python -m pip install --upgrade pip - pip install mcfly + pip install mcfly prospector - name: Show pip list run: | pip list From 38addbd62312a55fc82e1cdda384ecc3af104e5e Mon Sep 17 00:00:00 2001 From: Christiaan Meijer Date: Thu, 18 Feb 2021 15:41:44 +0100 Subject: [PATCH 04/12] Create linter_profile.yaml --- linter_profile.yaml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 linter_profile.yaml diff --git a/linter_profile.yaml b/linter_profile.yaml new file mode 100644 index 0000000..7ed471c --- /dev/null +++ b/linter_profile.yaml @@ -0,0 +1,21 @@ +output-format: json + +strictness: medium +test-warnings: true +doc-warnings: false + +pylint: + disable: + - wrong-import-position + - redefined-builtin + - bare-except + - unused-argument + - dangerous-default-value + - too-many-branches + - too-many-arguments + - too-many-locals + - protected-access + +pep8: + disable: + - E722 From d738e5b3b28ca7c874415fd18edac9ce39a58d30 Mon Sep 17 00:00:00 2001 From: Christiaan Meijer Date: Thu, 18 Feb 2021 16:01:36 +0100 Subject: [PATCH 05/12] make prospector always exit with zero (refs #46) --- .github/workflows/python-package.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index b63bb3d..7d4aaca 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -29,9 +29,9 @@ jobs: - name: Show pip list run: | pip list - - name: Check style against standards using prospector + - name: Check style against standards using prospector (only warn for now, but never fail) shell: bash -l {0} - run: prospector --profile linter_profile -o grouped -o pylint:pylint-report.txt + run: prospector --profile linter_profile -o grouped -o pylint:pylint-report.txt --zero-exit - name: Run unit test / Test coverage with Scrutinizer run: | pytest @@ -69,6 +69,6 @@ jobs: - name: Run unit tests run: | pytest - - name: Check style against standards using prospector + - name: Check style against standards using prospector (only warn for now, but never fail) shell: bash -l {0} - run: prospector --profile linter_profile -o grouped -o pylint:pylint-report.txt + run: prospector --profile linter_profile -o grouped -o pylint:pylint-report.txt --zero-exit From e80004c22c82c75d8dcfe5b09f6f8e238e1176f7 Mon Sep 17 00:00:00 2001 From: Christiaan Meijer Date: Thu, 18 Feb 2021 16:04:54 +0100 Subject: [PATCH 06/12] add pytest installation to GA --- .github/workflows/python-package.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 7d4aaca..8a72594 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -25,7 +25,7 @@ jobs: - name: Install dependiencies run: | python -m pip install --upgrade pip - pip install mcfly prospector + pip install mcfly prospector pytest - name: Show pip list run: | pip list @@ -62,7 +62,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install mcfly prospector + pip install mcfly prospector pytest - name: Show pip list run: | pip list From c165d399e93519285a979f66e6b5a8c3e2224c9a Mon Sep 17 00:00:00 2001 From: Christiaan Meijer Date: Thu, 18 Feb 2021 16:16:32 +0100 Subject: [PATCH 07/12] change pytests to nosetests in GA --- .github/workflows/python-package.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 8a72594..bd94527 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -25,7 +25,7 @@ jobs: - name: Install dependiencies run: | python -m pip install --upgrade pip - pip install mcfly prospector pytest + pip install mcfly prospector nosetests - name: Show pip list run: | pip list @@ -34,7 +34,7 @@ jobs: run: prospector --profile linter_profile -o grouped -o pylint:pylint-report.txt --zero-exit - name: Run unit test / Test coverage with Scrutinizer run: | - pytest + nosetests basic_checks: name: Run tests across OS and versions / python-${{ matrix.python-version }} / ${{ matrix.os }} @@ -62,13 +62,13 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install mcfly prospector pytest + pip install mcfly prospector nosetests - name: Show pip list run: | pip list - name: Run unit tests run: | - pytest + nosetests - name: Check style against standards using prospector (only warn for now, but never fail) shell: bash -l {0} run: prospector --profile linter_profile -o grouped -o pylint:pylint-report.txt --zero-exit From a3cf483a58337ff8b8a3ec89ff94584b92809f63 Mon Sep 17 00:00:00 2001 From: Christiaan Meijer Date: Thu, 18 Feb 2021 16:20:22 +0100 Subject: [PATCH 08/12] fix incorrect package name: nosetests to nose --- .github/workflows/python-package.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index bd94527..2b1405f 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -25,7 +25,7 @@ jobs: - name: Install dependiencies run: | python -m pip install --upgrade pip - pip install mcfly prospector nosetests + pip install mcfly prospector nose - name: Show pip list run: | pip list @@ -62,7 +62,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install mcfly prospector nosetests + pip install mcfly prospector nose - name: Show pip list run: | pip list From a22e3310a2e20b797737e85e932182a3e97eba59 Mon Sep 17 00:00:00 2001 From: Christiaan Meijer Date: Thu, 18 Feb 2021 16:23:48 +0100 Subject: [PATCH 09/12] add pandas dependency to GA --- .github/workflows/python-package.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 2b1405f..9e6aa80 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -25,7 +25,7 @@ jobs: - name: Install dependiencies run: | python -m pip install --upgrade pip - pip install mcfly prospector nose + pip install mcfly prospector nose pandas - name: Show pip list run: | pip list @@ -62,7 +62,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install mcfly prospector nose + pip install mcfly prospector nose pandas - name: Show pip list run: | pip list From 39a0c4d5e8497ca7aab30a4f1854aa0659a6596c Mon Sep 17 00:00:00 2001 From: Christiaan Meijer Date: Thu, 18 Feb 2021 16:30:59 +0100 Subject: [PATCH 10/12] remove duplicate linting tests from grid --- .github/workflows/python-package.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 9e6aa80..731f77b 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -32,7 +32,7 @@ jobs: - name: Check style against standards using prospector (only warn for now, but never fail) shell: bash -l {0} run: prospector --profile linter_profile -o grouped -o pylint:pylint-report.txt --zero-exit - - name: Run unit test / Test coverage with Scrutinizer + - name: Run unit tests run: | nosetests @@ -69,6 +69,3 @@ jobs: - name: Run unit tests run: | nosetests - - name: Check style against standards using prospector (only warn for now, but never fail) - shell: bash -l {0} - run: prospector --profile linter_profile -o grouped -o pylint:pylint-report.txt --zero-exit From f5e35e6240cb98507127c782180f6f344f9174a0 Mon Sep 17 00:00:00 2001 From: Christiaan Meijer Date: Thu, 18 Feb 2021 16:35:06 +0100 Subject: [PATCH 11/12] Delete .travis.yml --- .travis.yml | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 49cbed3..0000000 --- a/.travis.yml +++ /dev/null @@ -1,33 +0,0 @@ -language: python -dist: trusty -sudo: false - -python: -#- "3.5" # nosetest fails -- "3.6" -#- "3.7" - -before_install: -- wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; -- bash miniconda.sh -b -p $HOME/miniconda -- export PATH="$HOME/miniconda/bin:$PATH" -- conda config --set always_yes yes -- conda update -q conda -- conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION pip numpy -- source activate test-environment -- conda install -q pip openblas numpy scipy pandas -- "pip install -q nose" -- "pip install coverage" -- "pip install --upgrade pip" -- "pip install mcfly" - -install: -- "echo done" - -# command to run tests, e.g. python setup.py test -script: -- nosetests - -after_script: -- "pip install scrutinizer-ocular" -- "ocular" \ No newline at end of file From 75e037c449e5873125b5a40cf645e665ace0bfa7 Mon Sep 17 00:00:00 2001 From: Christiaan Meijer Date: Thu, 18 Feb 2021 16:39:56 +0100 Subject: [PATCH 12/12] change travis badge to new GA badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5565b0f..4b509e0 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@

-[![Build Status](https://travis-ci.org/NLeSC/mcfly-tutorial.svg?branch=master)](https://travis-ci.org/NLeSC/mcfly-tutorial) +[![CI Build](https://github.com/NLeSC/mcfly-tutorial/workflows/CI%20Build/badge.svg)](https://github.com/NLeSC/mcfly-tutorial/actions) This repository contains notebooks that show how to use the [mcfly](https://github.com/NLeSC/mcfly) software. Mcfly is deep learning tool for time series classification..