File tree Expand file tree Collapse file tree 4 files changed +39
-10
lines changed
Expand file tree Collapse file tree 4 files changed +39
-10
lines changed Original file line number Diff line number Diff line change @@ -76,10 +76,25 @@ jobs:
7676 # restore-key hits should result in `cache-hit` == 'false'
7777 # if: steps.cache-conda-env.outputs.cache-hit != 'true'
7878 run : |
79- conda install datalad pip numpy=${{ matrix.numpy-version }} -c conda-forge
79+ conda install pip numpy=${{ matrix.numpy-version }} -c conda-forge
8080 # this command is for updating cache. We are resting removal.
8181 # conda env update --name neo-test-env-${{ matrix.python-version }} --file environment_testing.yml --prune
8282
83+ - name : Install git-annex
84+ # this is the trick from the spikeinterface repo for getting git-annex to work with datalad
85+ shell : bash
86+ run : |
87+ pip install datalad-installer
88+ wget https://downloads.kitenet.net/git-annex/linux/current/git-annex-standalone-amd64.tar.gz
89+ mkdir /home/runner/work/installation
90+ mv git-annex-standalone-amd64.tar.gz /home/runner/work/installation/
91+ workdir=$(pwd)
92+ cd /home/runner/work/installation
93+ tar xvzf git-annex-standalone-amd64.tar.gz
94+ echo "$(pwd)/git-annex.linux" >> $GITHUB_PATH
95+ cd $workdir
96+ git config --global filter.annex.process "git-annex filter-process" # recommended for efficiency
97+
8398 - name : Configure git
8499 run : |
85100 git config --global user.email "neo_ci@fake_mail.com"
Original file line number Diff line number Diff line change 1919
2020import logging
2121import unittest
22+ import importlib .util
23+ import warnings
24+ import os
2225
2326from neo .utils .datasets import download_dataset , get_local_testing_data_folder , default_testing_repo
2427
2528from neo .test .rawiotest .tools import can_use_network
2629
2730from neo .test .rawiotest import rawio_compliance as compliance
2831
29- try :
30- import datalad
31-
32+ datalad_spec = importlib .util .find_spec ("datalad" )
33+ if datalad_spec is not None :
3234 HAVE_DATALAD = True
33- except :
35+ else :
3436 HAVE_DATALAD = False
37+ # pytest skip doesn't explain why we are skipping.
38+ # raise error if in CI to prevent tests from spuriously skipping and appearing
39+ # as passing.
40+ if os .environ .get ("GITHUB_ACTIONS" ) == 'true' :
41+ raise RuntimeError ("Datalad is required for running the CI." )
42+
3543
3644# url_for_tests = "https://portal.g-node.org/neo/" #This is the old place
3745repo_for_test = default_testing_repo
Original file line number Diff line number Diff line change 44
55import logging
66import os
7+ import importlib .util
8+
79
810logger = logging .getLogger ("neo.test" )
911
@@ -13,14 +15,18 @@ def can_use_network():
1315 Return True if network access is allowed
1416 """
1517
18+ # env variable for local dev
1619 if os .environ .get ("NEO_TESTS_NO_NETWORK" , False ):
1720 return False
18- try :
19- import datalad
20-
21+
22+ # check for datalad presence
23+ datalad_spec = importlib .util .find_spec ("datalad" )
24+ if datalad_spec is not None :
2125 HAVE_DATALAD = True
22- except :
26+ else :
2327 HAVE_DATALAD = False
28+
2429 if not HAVE_DATALAD :
2530 return False
31+
2632 return True
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ test = [
4949 # "dhn_med_py<2.0", # ci failing with 2.0 test future version when stable
5050 " pytest" ,
5151 " pytest-cov" ,
52- # datalad # this dependency is covered by conda (environment_testing.yml)-- maybe moving straight to ci
52+ " datalad" ,
5353 " scipy>=1.0.0" ,
5454 " pyedflib" ,
5555 " h5py" ,
You can’t perform that action at this time.
0 commit comments