From a63a774a39c3e7d936e6d1be544527164af09617 Mon Sep 17 00:00:00 2001 From: Mainak Jas Date: Thu, 1 Apr 2021 00:05:35 -0400 Subject: [PATCH 1/6] MAINT: Set up github actions --- .github/workflows/unit_tests.yml | 43 ++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/unit_tests.yml diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml new file mode 100644 index 00000000..7163bc88 --- /dev/null +++ b/.github/workflows/unit_tests.yml @@ -0,0 +1,43 @@ +name: Python package + +on: + push: + branches: ['**'] + pull_request: + branches: ['**'] + create: + branches: [main] + tags: ['**'] + schedule: + - cron: "0 4 * * *" + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.6, 3.7, 3.8] + + 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: | + python -m pip install --upgrade pip + pip install flake8 pytest + + - name: Install HNN + run: | + python setup.py install + + - name: Lint with flake8 + run: | + flake8 --count hnn_core + - name: Test with pytest + run: | + python -m py.test . --cov=hnn_core hnn_core/tests/ --cov-report=xml From 1072a05a61bb316a664c6446949a7f3453c013dc Mon Sep 17 00:00:00 2001 From: Mainak Jas Date: Thu, 1 Apr 2021 18:54:38 -0400 Subject: [PATCH 2/6] MAINT: install hnn_core --- .github/workflows/unit_tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 7163bc88..c262c91c 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -30,6 +30,7 @@ jobs: run: | python -m pip install --upgrade pip pip install flake8 pytest + pip install hnn_core - name: Install HNN run: | From 97a07ca0ab1a6599002b5dc709bf967f8480ba49 Mon Sep 17 00:00:00 2001 From: Mainak Jas Date: Thu, 1 Apr 2021 18:56:36 -0400 Subject: [PATCH 3/6] MAINT: tests should be for hnn not hnn_core --- .github/workflows/unit_tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index c262c91c..83989d15 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -38,7 +38,7 @@ jobs: - name: Lint with flake8 run: | - flake8 --count hnn_core + flake8 --count hnn - name: Test with pytest run: | - python -m py.test . --cov=hnn_core hnn_core/tests/ --cov-report=xml + python -m py.test . --cov=hnn hnn/tests/ --cov-report=xml From 69a8dd3901b817eec534ef45b80384a45675b8e1 Mon Sep 17 00:00:00 2001 From: Mainak Jas Date: Thu, 1 Apr 2021 18:59:06 -0400 Subject: [PATCH 4/6] Flake8 --- hnn/qt_psd.py | 1 + hnn/qt_sim.py | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/hnn/qt_psd.py b/hnn/qt_psd.py index d27f7fb2..83622e98 100644 --- a/hnn/qt_psd.py +++ b/hnn/qt_psd.py @@ -1,4 +1,5 @@ import os +import sys from math import sqrt from copy import deepcopy diff --git a/hnn/qt_sim.py b/hnn/qt_sim.py index 8de4a660..38a32621 100644 --- a/hnn/qt_sim.py +++ b/hnn/qt_sim.py @@ -396,7 +396,6 @@ def plotsimdat(self): xlim = (first_spec_trial['time'][0], first_spec_trial['time'][-1]) - # set the axes of input histograms to match dipole and spec plots for ax in hist_axes: ax.set_xlim(xlim) From 75c7b397e19b65c898cf767674999a09946c654d Mon Sep 17 00:00:00 2001 From: Mainak Jas Date: Thu, 1 Apr 2021 19:06:11 -0400 Subject: [PATCH 5/6] MAINT: missing deps --- .github/workflows/unit_tests.yml | 2 +- setup.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 83989d15..8cfef736 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -29,7 +29,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install flake8 pytest + pip install flake8 pytest pytest-qt pytest-cov mne pip install hnn_core - name: Install HNN diff --git a/setup.py b/setup.py index 59d909c2..6651bcc7 100644 --- a/setup.py +++ b/setup.py @@ -37,5 +37,7 @@ packages=find_packages(), package_data={'hnn': ['../param/*.param']}, - install_requires=['hnn-core'] + install_requires=['nlopt', + 'psutil', + 'pyqt5'] ) From 145f491d9a428c62a9f2b6a8d752ea28825e5679 Mon Sep 17 00:00:00 2001 From: Mainak Jas Date: Thu, 1 Apr 2021 19:21:10 -0400 Subject: [PATCH 6/6] MAINT: Pyqt deps --- .github/workflows/unit_tests.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 8cfef736..b351615e 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -25,7 +25,20 @@ jobs: uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - + + - name: Install stuff for PyQt + run: | + sudo -E apt-get install --no-install-recommends -y \ + openmpi-bin lsof \ + libfontconfig1 libxext6 libx11-xcb1 libxcb-glx0 \ + libxkbcommon-x11-0 libgl1-mesa-glx \ + libncurses5 libreadline5 libdbus-1-3 libopenmpi-dev \ + libc6-dev libtinfo-dev libncurses5-dev \ + libx11-dev libreadline-dev \ + libxcb-icccm4 libxcb-util1 libxcb-image0 libxcb-keysyms1 \ + libxcb-render0 libxcb-shape0 libxcb-randr0 libxcb-render-util0 \ + libxcb-xinerama0 libxcb-xfixes0 + - name: Install dependencies run: | python -m pip install --upgrade pip