From 00eec5eab06c4dd8f7ea16ee5516e023bca9bf91 Mon Sep 17 00:00:00 2001 From: Camilo Diaz Date: Wed, 12 Jun 2024 19:24:07 -0400 Subject: [PATCH 01/17] removed conda from ci pipeline --- .github/workflows/unit_tests.yml | 64 ++++++++++++++++++++++++-------- 1 file changed, 49 insertions(+), 15 deletions(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 3de966ffb..98a5a1fca 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -12,16 +12,16 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macos-latest] - python-version: [3.8, 3.9] + os: [ubuntu-24.04,macos-14] + python-version: [3.8,3.9] steps: - uses: actions/checkout@v4 - - uses: conda-incubator/setup-miniconda@v3 - with: - activate-environment: test + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + id: cp310 + with: python-version: ${{ matrix.python-version }} - fetch-depth: 2 - name: Install ubuntu dependencies shell: bash -el {0} run: | @@ -30,24 +30,58 @@ jobs: sudo apt-get update sudo apt-get install libopenmpi-dev openmpi-bin fi; + - name: Install MacOs dependencies + shell: bash -el {0} + run: | + if [ "${{ matrix.os }}" == "macos-latest" ]; then + brew install open-mpi + fi; - name: Install dependencies shell: bash -el {0} run: | - python -m pip install --upgrade pip - conda install --yes -c conda-forge mpi4py openmpi + '${{ steps.cp310.outputs.python-path }}' -m pip install --upgrade pip + '${{ steps.cp310.outputs.python-path }}' -m pip install mpi4py openmpi + - name: Check MPI version + shell: bash -el {0} + run: | + mpiexec --version + - name: Check Python version + shell: bash -el {0} + run: | + '${{ steps.cp310.outputs.python-path }}' --version - name: Install HNN-core shell: bash -el {0} run: | - pip install --verbose '.[opt, parallel, test, gui]' - - name: Lint with flake8 + '${{ steps.cp310.outputs.python-path }}' -m pip install --verbose '.[opt, parallel, test, gui]' + - name: Set Env Variables shell: bash -el {0} run: | - flake8 --count hnn_core - - name: Test with pytest + if [ "${{ matrix.os }}" == "macos-latest" ]; then + echo "List /opt/homebrew/lib" + ls /opt/homebrew/lib + echo "MPI_LIB_NRN_PATH=/opt/homebrew/lib/libmpi.dylib" >> $GITHUB_ENV + fi; + # - name: Run MPI application + # shell: bash -el {0} + # run: | + # mpiexec -np 2 '${{ steps.cp310.outputs.python-path }}' ./hnn_core/mpi_test.py + - name: Verify NEURON installation shell: bash -el {0} run: | - python -m pytest ./hnn_core/tests/ --cov=hnn_core --cov-report=xml - - name: Upload coverage to Codecov + nrniv -python -nobanner -mpi '${{ steps.cp310.outputs.python-path }}' "from neuron import h; print(h)" + # - name: Run MPI application with NEURON + # shell: bash -el {0} + # run: | + # mpiexec -np 2 -verbose nrniv -python -mpi -nobanner '${{ steps.cp310.outputs.python-path }}' ./hnn_core/mpi_test.py + # - name: Lint with flake8 + # shell: bash -el {0} + # run: | + # flake8 --count hnn_core + - name: Test with pytest shell: bash -el {0} run: | - bash <(curl -s https://codecov.io/bash) -f ./coverage.xml + '${{ steps.cp310.outputs.python-path }}' -m pytest ./hnn_core/tests/ --cov=hnn_core --cov-report=xml + # - name: Upload coverage to Codecov + # shell: bash -el {0} + # run: | + # bash <(curl -s https://codecov.io/bash) -f ./coverage.xml From 0b9048937221a4bda7228e01424a6f75be10754c Mon Sep 17 00:00:00 2001 From: Camilo Diaz Date: Wed, 12 Jun 2024 19:29:47 -0400 Subject: [PATCH 02/17] MAINT: Switching to ubuntu 22.04 --- .github/workflows/unit_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 98a5a1fca..e3390502b 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -12,7 +12,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-24.04,macos-14] + os: [ubuntu-22.04,macos-14] python-version: [3.8,3.9] steps: From 9792723a8c2098ddd6447392c15b73f9a65547ef Mon Sep 17 00:00:00 2001 From: Camilo Diaz Date: Wed, 12 Jun 2024 19:36:56 -0400 Subject: [PATCH 03/17] MAINT: Added conditionals to install openmpi according to matrix.os --- .github/workflows/unit_tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index e3390502b..b229edbdd 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -23,19 +23,19 @@ jobs: with: python-version: ${{ matrix.python-version }} - name: Install ubuntu dependencies + if: contains(matrix.os, 'ubuntu') shell: bash -el {0} run: | - if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt-get update sudo apt-get install libopenmpi-dev openmpi-bin - fi; + - name: Install MacOs dependencies + if: contains(matrix.os, 'macos') shell: bash -el {0} run: | - if [ "${{ matrix.os }}" == "macos-latest" ]; then brew install open-mpi - fi; + - name: Install dependencies shell: bash -el {0} run: | From 848c69b373ef54962f6410c18f99802381aed8b4 Mon Sep 17 00:00:00 2001 From: Camilo Diaz Date: Wed, 12 Jun 2024 19:44:53 -0400 Subject: [PATCH 04/17] MAINT: moving macos MPI_LIB_NRN_PATH env variable assigment --- .github/workflows/unit_tests.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index b229edbdd..d6b60d228 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -35,6 +35,8 @@ jobs: shell: bash -el {0} run: | brew install open-mpi + echo "List /opt/homebrew/lib" + echo "MPI_LIB_NRN_PATH=/opt/homebrew/lib/libmpi.dylib" >> $GITHUB_ENV - name: Install dependencies shell: bash -el {0} @@ -53,14 +55,13 @@ jobs: shell: bash -el {0} run: | '${{ steps.cp310.outputs.python-path }}' -m pip install --verbose '.[opt, parallel, test, gui]' - - name: Set Env Variables - shell: bash -el {0} - run: | - if [ "${{ matrix.os }}" == "macos-latest" ]; then - echo "List /opt/homebrew/lib" - ls /opt/homebrew/lib - echo "MPI_LIB_NRN_PATH=/opt/homebrew/lib/libmpi.dylib" >> $GITHUB_ENV - fi; + + # - name: Set Env Variables + # if: contains(matrix.os, 'macos') + # shell: bash -el {0} + # run: | + # echo "List /opt/homebrew/lib" + # echo "MPI_LIB_NRN_PATH=/opt/homebrew/lib/libmpi.dylib" >> $GITHUB_ENV # - name: Run MPI application # shell: bash -el {0} # run: | From a487ed6d4c2d7ed041c889be35c30f3b3600db90 Mon Sep 17 00:00:00 2001 From: Camilo Diaz Date: Wed, 12 Jun 2024 20:05:39 -0400 Subject: [PATCH 05/17] MAINT: Removing comments and additional test in unit_test.yml --- .github/workflows/unit_tests.yml | 41 +++++++------------------------- 1 file changed, 8 insertions(+), 33 deletions(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index d6b60d228..88b61d090 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -35,7 +35,6 @@ jobs: shell: bash -el {0} run: | brew install open-mpi - echo "List /opt/homebrew/lib" echo "MPI_LIB_NRN_PATH=/opt/homebrew/lib/libmpi.dylib" >> $GITHUB_ENV - name: Install dependencies @@ -43,46 +42,22 @@ jobs: run: | '${{ steps.cp310.outputs.python-path }}' -m pip install --upgrade pip '${{ steps.cp310.outputs.python-path }}' -m pip install mpi4py openmpi - - name: Check MPI version - shell: bash -el {0} - run: | - mpiexec --version - - name: Check Python version - shell: bash -el {0} - run: | - '${{ steps.cp310.outputs.python-path }}' --version - name: Install HNN-core shell: bash -el {0} run: | '${{ steps.cp310.outputs.python-path }}' -m pip install --verbose '.[opt, parallel, test, gui]' - # - name: Set Env Variables - # if: contains(matrix.os, 'macos') - # shell: bash -el {0} - # run: | - # echo "List /opt/homebrew/lib" - # echo "MPI_LIB_NRN_PATH=/opt/homebrew/lib/libmpi.dylib" >> $GITHUB_ENV - # - name: Run MPI application - # shell: bash -el {0} - # run: | - # mpiexec -np 2 '${{ steps.cp310.outputs.python-path }}' ./hnn_core/mpi_test.py - - name: Verify NEURON installation + - name: Lint with flake8 shell: bash -el {0} run: | - nrniv -python -nobanner -mpi '${{ steps.cp310.outputs.python-path }}' "from neuron import h; print(h)" - # - name: Run MPI application with NEURON - # shell: bash -el {0} - # run: | - # mpiexec -np 2 -verbose nrniv -python -mpi -nobanner '${{ steps.cp310.outputs.python-path }}' ./hnn_core/mpi_test.py - # - name: Lint with flake8 - # shell: bash -el {0} - # run: | - # flake8 --count hnn_core + flake8 --count hnn_core + - name: Test with pytest shell: bash -el {0} run: | '${{ steps.cp310.outputs.python-path }}' -m pytest ./hnn_core/tests/ --cov=hnn_core --cov-report=xml - # - name: Upload coverage to Codecov - # shell: bash -el {0} - # run: | - # bash <(curl -s https://codecov.io/bash) -f ./coverage.xml + + - name: Upload coverage to Codecov + shell: bash -el {0} + run: | + bash <(curl -s https://codecov.io/bash) -f ./coverage.xml From dee1f3a42aaf561c056db9f4ad0ab5546a91322a Mon Sep 17 00:00:00 2001 From: Camilo Diaz Date: Thu, 13 Jun 2024 22:23:40 -0400 Subject: [PATCH 06/17] MAINT: Moving linux CI to a separate workflow --- .github/workflows/linux_unit_test.yml | 54 +++++++++++++++++++ .../{unit_tests.yml => macos_unit_tests.yml} | 0 2 files changed, 54 insertions(+) create mode 100644 .github/workflows/linux_unit_test.yml rename .github/workflows/{unit_tests.yml => macos_unit_tests.yml} (100%) diff --git a/.github/workflows/linux_unit_test.yml b/.github/workflows/linux_unit_test.yml new file mode 100644 index 000000000..eda66ce25 --- /dev/null +++ b/.github/workflows/linux_unit_test.yml @@ -0,0 +1,54 @@ +name: Unit tests + +on: + push: + branches: ['**'] + pull_request: + branches: ['**'] + +jobs: + build: + + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + python-version: [3.8,3.9] + + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - name: Install ubuntu dependencies + shell: bash -el {0} + run: | + sudo add-apt-repository ppa:ubuntu-toolchain-r/test + sudo apt-get update + sudo apt-get install libopenmpi-dev openmpi-bin + + - name: Install dependencies + shell: bash -el {0} + run: | + python -m pip install --upgrade pip + python -m pip install mpi4py openmpi + - name: Install HNN-core + shell: bash -el {0} + run: | + python -m pip install --verbose '.[opt, parallel, test, gui]' + + - name: Lint with flake8 + shell: bash -el {0} + run: | + flake8 --count hnn_core + + - name: Test with pytest + shell: bash -el {0} + run: | + python -m pytest ./hnn_core/tests/ --cov=hnn_core --cov-report=xml + + - name: Upload coverage to Codecov + shell: bash -el {0} + run: | + bash <(curl -s https://codecov.io/bash) -f ./coverage.xml \ No newline at end of file diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/macos_unit_tests.yml similarity index 100% rename from .github/workflows/unit_tests.yml rename to .github/workflows/macos_unit_tests.yml From 3b0702821f7f3b307279ef84e9e43a41d1b5c458 Mon Sep 17 00:00:00 2001 From: Camilo Diaz Date: Thu, 13 Jun 2024 22:51:31 -0400 Subject: [PATCH 07/17] STY: fixed flake8 errors --- .github/workflows/macos_unit_tests.yml | 36 ++++++++++---------------- hnn_core/gui/gui.py | 3 ++- 2 files changed, 15 insertions(+), 24 deletions(-) diff --git a/.github/workflows/macos_unit_tests.yml b/.github/workflows/macos_unit_tests.yml index 88b61d090..fac63e14b 100644 --- a/.github/workflows/macos_unit_tests.yml +++ b/.github/workflows/macos_unit_tests.yml @@ -12,52 +12,42 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-22.04,macos-14] - python-version: [3.8,3.9] + os: [macos-latest] + python-version: [3.8, 3.9] steps: - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - id: cp310 - with: + - uses: conda-incubator/setup-miniconda@v3 + with: + activate-environment: test python-version: ${{ matrix.python-version }} + fetch-depth: 2 - name: Install ubuntu dependencies - if: contains(matrix.os, 'ubuntu') shell: bash -el {0} run: | + if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt-get update sudo apt-get install libopenmpi-dev openmpi-bin - - - name: Install MacOs dependencies - if: contains(matrix.os, 'macos') - shell: bash -el {0} - run: | - brew install open-mpi - echo "MPI_LIB_NRN_PATH=/opt/homebrew/lib/libmpi.dylib" >> $GITHUB_ENV - + fi; - name: Install dependencies shell: bash -el {0} run: | - '${{ steps.cp310.outputs.python-path }}' -m pip install --upgrade pip - '${{ steps.cp310.outputs.python-path }}' -m pip install mpi4py openmpi + python -m pip install --upgrade pip + conda install --yes -c conda-forge mpi4py openmpi - name: Install HNN-core shell: bash -el {0} run: | - '${{ steps.cp310.outputs.python-path }}' -m pip install --verbose '.[opt, parallel, test, gui]' - + pip install --verbose '.[opt, parallel, test, gui]' - name: Lint with flake8 shell: bash -el {0} run: | flake8 --count hnn_core - - name: Test with pytest shell: bash -el {0} run: | - '${{ steps.cp310.outputs.python-path }}' -m pytest ./hnn_core/tests/ --cov=hnn_core --cov-report=xml - + python -m pytest ./hnn_core/tests/ --cov=hnn_core --cov-report=xml - name: Upload coverage to Codecov shell: bash -el {0} run: | - bash <(curl -s https://codecov.io/bash) -f ./coverage.xml + bash <(curl -s https://codecov.io/bash) -f ./coverage.xml \ No newline at end of file diff --git a/hnn_core/gui/gui.py b/hnn_core/gui/gui.py index ad73fe943..a5a658164 100644 --- a/hnn_core/gui/gui.py +++ b/hnn_core/gui/gui.py @@ -1274,7 +1274,8 @@ def load_drive_and_connectivity(params, log_out, drives_out, """Add drive and connectivity ipywidgets from params.""" with log_out: # Add connectivity - add_connectivity_tab(params, connectivity_out, connectivity_textfields) + add_connectivity_tab(params, connectivity_out, + connectivity_textfields) # Add drives add_drive_tab(params, log_out, drives_out, drive_widgets, drive_boxes, tstop, layout) From e7b78983d62b7c645f92a34e2a9f5f1d634b821e Mon Sep 17 00:00:00 2001 From: Camilo Diaz Date: Thu, 13 Jun 2024 23:10:28 -0400 Subject: [PATCH 08/17] STY: fixed flake8 errors in gui.py --- hnn_core/gui/gui.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hnn_core/gui/gui.py b/hnn_core/gui/gui.py index a5a658164..4f4f9dea3 100644 --- a/hnn_core/gui/gui.py +++ b/hnn_core/gui/gui.py @@ -1275,7 +1275,7 @@ def load_drive_and_connectivity(params, log_out, drives_out, with log_out: # Add connectivity add_connectivity_tab(params, connectivity_out, - connectivity_textfields) + connectivity_textfields) # Add drives add_drive_tab(params, log_out, drives_out, drive_widgets, drive_boxes, tstop, layout) From 9c4f8bc3fb297cc09017f4f73ed629f4a4104a0d Mon Sep 17 00:00:00 2001 From: Camilo Diaz Date: Thu, 13 Jun 2024 23:16:47 -0400 Subject: [PATCH 09/17] MAINT: Removing linux commands from macos CI workflow --- .github/workflows/macos_unit_tests.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/macos_unit_tests.yml b/.github/workflows/macos_unit_tests.yml index fac63e14b..a693527d7 100644 --- a/.github/workflows/macos_unit_tests.yml +++ b/.github/workflows/macos_unit_tests.yml @@ -22,14 +22,6 @@ jobs: activate-environment: test python-version: ${{ matrix.python-version }} fetch-depth: 2 - - name: Install ubuntu dependencies - shell: bash -el {0} - run: | - if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then - sudo add-apt-repository ppa:ubuntu-toolchain-r/test - sudo apt-get update - sudo apt-get install libopenmpi-dev openmpi-bin - fi; - name: Install dependencies shell: bash -el {0} run: | From 5191ecac536e8f2f703e40b17cb6aec59a3c5a91 Mon Sep 17 00:00:00 2001 From: Camilo Diaz Date: Sun, 16 Jun 2024 09:36:08 -0400 Subject: [PATCH 10/17] TST: Adding python 3.10 and 3.11 to the tests --- .github/workflows/linux_unit_test.yml | 2 +- .github/workflows/macos_unit_tests.yml | 2 +- .github/workflows/windows_unit_tests.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linux_unit_test.yml b/.github/workflows/linux_unit_test.yml index eda66ce25..c37b2a95b 100644 --- a/.github/workflows/linux_unit_test.yml +++ b/.github/workflows/linux_unit_test.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - python-version: [3.8,3.9] + python-version: [3.8, 3.9, 3.10, 3.11] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/macos_unit_tests.yml b/.github/workflows/macos_unit_tests.yml index a693527d7..7a47f6f65 100644 --- a/.github/workflows/macos_unit_tests.yml +++ b/.github/workflows/macos_unit_tests.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: os: [macos-latest] - python-version: [3.8, 3.9] + python-version: [3.8, 3.9, 3.10, 3.11] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/windows_unit_tests.yml b/.github/workflows/windows_unit_tests.yml index 665ed7562..b13a3569a 100644 --- a/.github/workflows/windows_unit_tests.yml +++ b/.github/workflows/windows_unit_tests.yml @@ -17,7 +17,7 @@ jobs: strategy: matrix: os: [windows-latest] - python-version: [3.8, 3.9] + python-version: [3.8, 3.9, 3.10, 3.11] steps: - uses: actions/checkout@v4 From 2a8dc3dc162ba3789e54db8be98324158fc4adbe Mon Sep 17 00:00:00 2001 From: Camilo Diaz Date: Sun, 16 Jun 2024 09:41:58 -0400 Subject: [PATCH 11/17] TST: Adding quotes to python version 3.10 --- .github/workflows/linux_unit_test.yml | 2 +- .github/workflows/windows_unit_tests.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux_unit_test.yml b/.github/workflows/linux_unit_test.yml index c37b2a95b..d3236b42c 100644 --- a/.github/workflows/linux_unit_test.yml +++ b/.github/workflows/linux_unit_test.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - python-version: [3.8, 3.9, 3.10, 3.11] + python-version: [3.8, 3.9, '3.10', 3.11] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/windows_unit_tests.yml b/.github/workflows/windows_unit_tests.yml index b13a3569a..ce02f6d9f 100644 --- a/.github/workflows/windows_unit_tests.yml +++ b/.github/workflows/windows_unit_tests.yml @@ -17,7 +17,7 @@ jobs: strategy: matrix: os: [windows-latest] - python-version: [3.8, 3.9, 3.10, 3.11] + python-version: [3.8, 3.9, '3.10', 3.11] steps: - uses: actions/checkout@v4 From 852269a1087d310b159604531aa4ae275f77c8ed Mon Sep 17 00:00:00 2001 From: Camilo Diaz Date: Sun, 16 Jun 2024 09:45:41 -0400 Subject: [PATCH 12/17] TST: Adding double quotes for macos python 3.10 build --- .github/workflows/macos_unit_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/macos_unit_tests.yml b/.github/workflows/macos_unit_tests.yml index 7a47f6f65..325bcf99c 100644 --- a/.github/workflows/macos_unit_tests.yml +++ b/.github/workflows/macos_unit_tests.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: os: [macos-latest] - python-version: [3.8, 3.9, 3.10, 3.11] + python-version: [3.8, 3.9, "3.10", 3.11] steps: - uses: actions/checkout@v4 From fe7e3c690a21f1fad4a508f40c817f86725eeec5 Mon Sep 17 00:00:00 2001 From: Camilo Diaz Date: Thu, 20 Jun 2024 15:27:00 -0400 Subject: [PATCH 13/17] MAINT: removing python 3.11 from CI tests --- .github/workflows/linux_unit_test.yml | 2 +- .github/workflows/macos_unit_tests.yml | 2 +- .github/workflows/windows_unit_tests.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linux_unit_test.yml b/.github/workflows/linux_unit_test.yml index d3236b42c..5468320ae 100644 --- a/.github/workflows/linux_unit_test.yml +++ b/.github/workflows/linux_unit_test.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - python-version: [3.8, 3.9, '3.10', 3.11] + python-version: [3.8, 3.9, '3.10'] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/macos_unit_tests.yml b/.github/workflows/macos_unit_tests.yml index 325bcf99c..aaceeda9f 100644 --- a/.github/workflows/macos_unit_tests.yml +++ b/.github/workflows/macos_unit_tests.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: os: [macos-latest] - python-version: [3.8, 3.9, "3.10", 3.11] + python-version: [3.8, 3.9, "3.10"] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/windows_unit_tests.yml b/.github/workflows/windows_unit_tests.yml index ce02f6d9f..8fca2a561 100644 --- a/.github/workflows/windows_unit_tests.yml +++ b/.github/workflows/windows_unit_tests.yml @@ -17,7 +17,7 @@ jobs: strategy: matrix: os: [windows-latest] - python-version: [3.8, 3.9, '3.10', 3.11] + python-version: [3.8, 3.9, '3.10'] steps: - uses: actions/checkout@v4 From afb34ee862f67dce6645a126edd0735fa2d01056 Mon Sep 17 00:00:00 2001 From: Camilo Diaz Date: Fri, 21 Jun 2024 10:49:06 -0400 Subject: [PATCH 14/17] MAINT: Testing Ifs in workflow to test multiple OS --- .github/workflows/macos_unit_tests.yml | 105 +++++++++++++++---------- 1 file changed, 64 insertions(+), 41 deletions(-) diff --git a/.github/workflows/macos_unit_tests.yml b/.github/workflows/macos_unit_tests.yml index aaceeda9f..27a55eb09 100644 --- a/.github/workflows/macos_unit_tests.yml +++ b/.github/workflows/macos_unit_tests.yml @@ -1,45 +1,68 @@ -name: Unit tests + name: Unit tests -on: - push: - branches: ['**'] - pull_request: - branches: ['**'] + on: + push: + branches: ['**'] + pull_request: + branches: ['**'] -jobs: - build: + jobs: + build: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [macos-latest] - python-version: [3.8, 3.9, "3.10"] + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest,macos-latest] + python-version: [3.8] - steps: - - uses: actions/checkout@v4 - - uses: conda-incubator/setup-miniconda@v3 - with: - activate-environment: test - python-version: ${{ matrix.python-version }} - fetch-depth: 2 - - name: Install dependencies - shell: bash -el {0} - run: | - python -m pip install --upgrade pip - conda install --yes -c conda-forge mpi4py openmpi - - name: Install HNN-core - shell: bash -el {0} - run: | - pip install --verbose '.[opt, parallel, test, gui]' - - name: Lint with flake8 - shell: bash -el {0} - run: | - flake8 --count hnn_core - - name: Test with pytest - shell: bash -el {0} - run: | - python -m pytest ./hnn_core/tests/ --cov=hnn_core --cov-report=xml - - name: Upload coverage to Codecov - shell: bash -el {0} - run: | - bash <(curl -s https://codecov.io/bash) -f ./coverage.xml \ No newline at end of file + steps: + - uses: actions/checkout@4 + + - name: Install Ubuntu System dependencies + if: matrix.os == 'ubuntu-latest' + shell: bash -el {0} + run: | + sudo add-apt-repository ppa:ubuntu-toolchain-r/test + sudo apt-get update + sudo apt-get install libopenmpi-dev openmpi-bin + + - name: Activate conda environment for macOS + if: matrix.os == 'macos-latest' + uses: conda-incubator/setup-miniconda@v3 + with: + activate-environment: test + python-version: ${{ matrix.python-version }} + fetch-depth: 2 + + - name: Activate Python environment for Ubuntu + if: matrix.os == 'ubuntu-latest' + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install Python dependencies + shell: bash -el {0} + run: | + if [ ${{ matrix.os }} == 'macos-latest' ]; then + python -m pip install --upgrade pip + conda install --yes -c conda-forge mpi4py openmpi + elif [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then + python -m pip install --upgrade pip + python -m pip install mpi4py + fi + - name: Install HNN-core + shell: bash -el {0} + run: | + pip install --verbose '.[opt, parallel, test, gui]' + - name: Lint with flake8 + shell: bash -el {0} + run: | + flake8 --count hnn_core + - name: Test with pytest + shell: bash -el {0} + run: | + python -m pytest ./hnn_core/tests/ --cov=hnn_core --cov-report=xml + - name: Upload coverage to Codecov + shell: bash -el {0} + run: | + bash <(curl -s https://codecov.io/bash) -f ./coverage.xml \ No newline at end of file From db2794d25cf9d394eecdbe5061209a0585e07962 Mon Sep 17 00:00:00 2001 From: Camilo Diaz Date: Fri, 21 Jun 2024 10:52:16 -0400 Subject: [PATCH 15/17] MAINT: Fixed checkout@v4 statement --- .github/workflows/macos_unit_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/macos_unit_tests.yml b/.github/workflows/macos_unit_tests.yml index 27a55eb09..a643bd42c 100644 --- a/.github/workflows/macos_unit_tests.yml +++ b/.github/workflows/macos_unit_tests.yml @@ -16,7 +16,7 @@ python-version: [3.8] steps: - - uses: actions/checkout@4 + - uses: actions/checkout@v4 - name: Install Ubuntu System dependencies if: matrix.os == 'ubuntu-latest' From c78cb07eb7fbad3af10fe7b1dc7579842361ca15 Mon Sep 17 00:00:00 2001 From: Camilo Diaz Date: Fri, 21 Jun 2024 11:16:30 -0400 Subject: [PATCH 16/17] MAINT: Adding python 3.9 and 3.10 to multi porpuse workflow --- .github/workflows/linux_unit_test.yml | 62 +++++++++++++------------- .github/workflows/macos_unit_tests.yml | 2 +- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/.github/workflows/linux_unit_test.yml b/.github/workflows/linux_unit_test.yml index 5468320ae..8fbdcaea4 100644 --- a/.github/workflows/linux_unit_test.yml +++ b/.github/workflows/linux_unit_test.yml @@ -21,34 +21,34 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - - name: Install ubuntu dependencies - shell: bash -el {0} - run: | - sudo add-apt-repository ppa:ubuntu-toolchain-r/test - sudo apt-get update - sudo apt-get install libopenmpi-dev openmpi-bin - - - name: Install dependencies - shell: bash -el {0} - run: | - python -m pip install --upgrade pip - python -m pip install mpi4py openmpi - - name: Install HNN-core - shell: bash -el {0} - run: | - python -m pip install --verbose '.[opt, parallel, test, gui]' - - - name: Lint with flake8 - shell: bash -el {0} - run: | - flake8 --count hnn_core - - - name: Test with pytest - shell: bash -el {0} - run: | - python -m pytest ./hnn_core/tests/ --cov=hnn_core --cov-report=xml - - - name: Upload coverage to Codecov - shell: bash -el {0} - run: | - bash <(curl -s https://codecov.io/bash) -f ./coverage.xml \ No newline at end of file + # - name: Install Systems dependencies + # shell: bash -el {0} + # run: | + # sudo add-apt-repository ppa:ubuntu-toolchain-r/test + # sudo apt-get update + # sudo apt-get install libopenmpi-dev openmpi-bin + + # - name: Install dependencies + # shell: bash -el {0} + # run: | + # python -m pip install --upgrade pip + # python -m pip install mpi4py openmpi + # - name: Install HNN-core + # shell: bash -el {0} + # run: | + # python -m pip install --verbose '.[opt, parallel, test, gui]' + + # - name: Lint with flake8 + # shell: bash -el {0} + # run: | + # flake8 --count hnn_core + + # - name: Test with pytest + # shell: bash -el {0} + # run: | + # python -m pytest ./hnn_core/tests/ --cov=hnn_core --cov-report=xml + + # - name: Upload coverage to Codecov + # shell: bash -el {0} + # run: | + # bash <(curl -s https://codecov.io/bash) -f ./coverage.xml \ No newline at end of file diff --git a/.github/workflows/macos_unit_tests.yml b/.github/workflows/macos_unit_tests.yml index a643bd42c..86ed418d3 100644 --- a/.github/workflows/macos_unit_tests.yml +++ b/.github/workflows/macos_unit_tests.yml @@ -13,7 +13,7 @@ strategy: matrix: os: [ubuntu-latest,macos-latest] - python-version: [3.8] + python-version: [3.8, 3.9, '3.10'] steps: - uses: actions/checkout@v4 From 1b454eafe26f1f9f5d8390501e7edd1571212164 Mon Sep 17 00:00:00 2001 From: Camilo Diaz Date: Fri, 21 Jun 2024 11:36:59 -0400 Subject: [PATCH 17/17] MAINT: Removed linux workflow file. Moved logic to unix_unit_tests.yml --- .github/workflows/linux_unit_test.yml | 54 ------------------- ...cos_unit_tests.yml => unix_unit_tests.yml} | 0 2 files changed, 54 deletions(-) delete mode 100644 .github/workflows/linux_unit_test.yml rename .github/workflows/{macos_unit_tests.yml => unix_unit_tests.yml} (100%) diff --git a/.github/workflows/linux_unit_test.yml b/.github/workflows/linux_unit_test.yml deleted file mode 100644 index 8fbdcaea4..000000000 --- a/.github/workflows/linux_unit_test.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: Unit tests - -on: - push: - branches: ['**'] - pull_request: - branches: ['**'] - -jobs: - build: - - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest] - python-version: [3.8, 3.9, '3.10'] - - steps: - - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - # - name: Install Systems dependencies - # shell: bash -el {0} - # run: | - # sudo add-apt-repository ppa:ubuntu-toolchain-r/test - # sudo apt-get update - # sudo apt-get install libopenmpi-dev openmpi-bin - - # - name: Install dependencies - # shell: bash -el {0} - # run: | - # python -m pip install --upgrade pip - # python -m pip install mpi4py openmpi - # - name: Install HNN-core - # shell: bash -el {0} - # run: | - # python -m pip install --verbose '.[opt, parallel, test, gui]' - - # - name: Lint with flake8 - # shell: bash -el {0} - # run: | - # flake8 --count hnn_core - - # - name: Test with pytest - # shell: bash -el {0} - # run: | - # python -m pytest ./hnn_core/tests/ --cov=hnn_core --cov-report=xml - - # - name: Upload coverage to Codecov - # shell: bash -el {0} - # run: | - # bash <(curl -s https://codecov.io/bash) -f ./coverage.xml \ No newline at end of file diff --git a/.github/workflows/macos_unit_tests.yml b/.github/workflows/unix_unit_tests.yml similarity index 100% rename from .github/workflows/macos_unit_tests.yml rename to .github/workflows/unix_unit_tests.yml