From 1e09219fc7c9b08cc1abcef7351f48782f90ee5e Mon Sep 17 00:00:00 2001 From: Robin De Schepper Date: Tue, 19 Dec 2023 14:20:06 +0100 Subject: [PATCH] Add CI and beta dependencies (#1) * add tests * add test requirements * add coverage --- .github/workflows/main.yml | 40 ++++++++++++++++++++++++++++++++++++++ pyproject.toml | 8 ++++++-- requirements.txt | 5 +++++ 3 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/main.yml create mode 100644 requirements.txt diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..cc36a8f --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,40 @@ +name: Test BSB Arbor adapter + +on: [ push, pull_request ] + +jobs: + build: + if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [ "3.9", "3.10", "3.11" ] + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install apt dependencies + run: | + sudo apt-get update + sudo apt-get install openmpi-bin libopenmpi-dev + - name: Cache pip + uses: actions/cache@v3 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + ${{ runner.os }}- + - name: Install dependencies & self + run: | + python -m pip install --upgrade pip + pip install -e . --no-deps + pip install -r requirements.txt --prefer-binary + pip install -e . + - name: Run tests & coverage + run: | + coverage run -p -m unittest + mpiexec -n 2 coverage run -p -m unittest + bash <(curl -s https://codecov.io/bash) diff --git a/pyproject.toml b/pyproject.toml index 6fb7a2c..72b3055 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,11 @@ readme = "README.md" license = {file = "LICENSE"} classifiers = ["License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)"] dynamic = ["version", "description"] -dependencies = ["bsb-core>=4.0.0b0,<=4.0.0b9999", "arbor~=0.9", "arborize[arbor]==4.0.0a4"] +dependencies = [ + "bsb-core>=4.0.0b0,<=4.0.0b9999", + "arbor~=0.9", + "arborize[arbor]>=4.0.0b1" +] [project.entry-points."bsb.simulation_backends"] arbor = "bsb_arbor" @@ -18,4 +22,4 @@ arbor = "bsb_arbor" name = "bsb_arbor" [project.optional-dependencies] -test = ["bsb-test==0.0.0a0"] +test = ["bsb-test>=0.0.0b0"] diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..3934cb6 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,5 @@ +arbor==0.9 +mpi4py==3.1.5 +bsb-core>=4.0.0b0 +bsb-test==0.0.0b2 +coverage==7.3.3 \ No newline at end of file