From ec4892f55a15c258d39baa210944e6a41e153a4f Mon Sep 17 00:00:00 2001 From: Camilo Diaz Date: Fri, 21 Jun 2024 12:03:50 -0400 Subject: [PATCH] [MAINT] Remove conda from CI Linux Workflows (#794) * removed conda from ci pipeline * MAINT: Switching to ubuntu 22.04 * MAINT: Added conditionals to install openmpi according to matrix.os * MAINT: moving macos MPI_LIB_NRN_PATH env variable assigment * MAINT: Removing comments and additional test in unit_test.yml * MAINT: Moving linux CI to a separate workflow * STY: fixed flake8 errors * STY: fixed flake8 errors in gui.py * MAINT: Removing linux commands from macos CI workflow * TST: Adding python 3.10 and 3.11 to the tests * TST: Adding quotes to python version 3.10 * TST: Adding double quotes for macos python 3.10 build * MAINT: removing python 3.11 from CI tests * MAINT: Testing Ifs in workflow to test multiple OS * MAINT: Fixed checkout@v4 statement * MAINT: Adding python 3.9 and 3.10 to multi porpuse workflow * MAINT: Removed linux workflow file. Moved logic to unix_unit_tests.yml --- .github/workflows/unit_tests.yml | 53 ------------------ .github/workflows/unix_unit_tests.yml | 68 ++++++++++++++++++++++++ .github/workflows/windows_unit_tests.yml | 2 +- hnn_core/gui/gui.py | 3 +- 4 files changed, 71 insertions(+), 55 deletions(-) delete mode 100644 .github/workflows/unit_tests.yml create mode 100644 .github/workflows/unix_unit_tests.yml diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml deleted file mode 100644 index 3de966ffb..000000000 --- a/.github/workflows/unit_tests.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: Unit tests - -on: - push: - branches: ['**'] - pull_request: - branches: ['**'] - -jobs: - build: - - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, macos-latest] - python-version: [3.8, 3.9] - - 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 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: | - 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 diff --git a/.github/workflows/unix_unit_tests.yml b/.github/workflows/unix_unit_tests.yml new file mode 100644 index 000000000..86ed418d3 --- /dev/null +++ b/.github/workflows/unix_unit_tests.yml @@ -0,0 +1,68 @@ + name: Unit tests + + on: + push: + branches: ['**'] + pull_request: + branches: ['**'] + + jobs: + build: + + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest,macos-latest] + python-version: [3.8, 3.9, '3.10'] + + steps: + - uses: actions/checkout@v4 + + - 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 diff --git a/.github/workflows/windows_unit_tests.yml b/.github/workflows/windows_unit_tests.yml index 665ed7562..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] + python-version: [3.8, 3.9, '3.10'] steps: - uses: actions/checkout@v4 diff --git a/hnn_core/gui/gui.py b/hnn_core/gui/gui.py index ad73fe943..4f4f9dea3 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)