Skip to content

Commit 8596574

Browse files
committed
plexon2 specific action on cron
1 parent 3471305 commit 8596574

File tree

4 files changed

+125
-11
lines changed

4 files changed

+125
-11
lines changed

.github/workflows/io-test.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,12 @@ jobs:
114114
# run: |
115115
# pip install --no-dependencies -e .
116116

117-
- name: Install wine
118-
run: |
119-
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
120-
sudo dpkg --add-architecture i386
121-
sudo apt-get update -qq
122-
sudo apt-get install -yqq --allow-downgrades libc6:i386 libgcc-s1:i386 libstdc++6:i386 wine
117+
#- name: Install wine
118+
# run: |
119+
# sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
120+
# sudo dpkg --add-architecture i386
121+
# sudo apt-get update -qq
122+
# sudo apt-get install -yqq --allow-downgrades libc6:i386 libgcc-s1:i386 libstdc++6:i386 wine
123123

124124
- name: Pip list
125125
run: |
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
name: NeoPlexon2Test
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: "0 12 * * 0" # weekly at noon UTC on Sundays
7+
8+
concurrency: # Cancel previous workflows on the same pull request
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
build-and-test:
14+
name: Test on (${{ inputs.os }}) (${{ matrix.python-version}}) (${{ matrix.numpy-version }})
15+
runs-on: ${{ inputs.os }}
16+
strategy:
17+
fail-fast: true
18+
matrix:
19+
python-version: ['3.9', '3.12']
20+
numpy-version: ['1.26', '2.0']
21+
defaults:
22+
# by default run in bash mode (required for conda usage)
23+
run:
24+
shell: bash -l {0}
25+
steps:
26+
27+
- name: Checkout repository
28+
uses: actions/checkout@v4
29+
30+
- name: Get current year-month
31+
id: date
32+
run: echo "date=$(date +'%Y-%m')" >> $GITHUB_OUTPUT
33+
34+
- name: Get ephy_testing_data current head hash
35+
# the key depend on the last commit repo https://gin.g-node.org/NeuralEnsemble/ephy_testing_data.git
36+
id: ephy_testing_data
37+
run: |
38+
echo "dataset_hash=$(git ls-remote https://gin.g-node.org/NeuralEnsemble/ephy_testing_data.git HEAD | cut -f1)" >> $GITHUB_OUTPUT
39+
40+
- uses: actions/cache/restore@v4
41+
# Loading cache of ephys_testing_dataset
42+
id: cache-datasets
43+
with:
44+
path: ~/ephy_testing_data
45+
key: ${{ runner.os }}-datasets-${{ steps.ephy_testing_data.outputs.dataset_hash }}
46+
restore-keys: ${{ runner.os }}-datasets-
47+
48+
- uses: conda-incubator/setup-miniconda@v3
49+
with:
50+
activate-environment: neo-test-env-${{ matrix.python-version }}
51+
python-version: "${{ matrix.python-version }}"
52+
53+
- name: Install testing dependencies
54+
# testing environment is only created from yml if no cache was found
55+
# restore-key hits should result in `cache-hit` == 'false'
56+
#if: steps.cache-conda-env.outputs.cache-hit != 'true'
57+
run: |
58+
conda install pip numpy=${{ matrix.numpy-version }} -c conda-forge
59+
# this command is for updating cache. We are resting removal.
60+
# conda env update --name neo-test-env-${{ matrix.python-version }} --file environment_testing.yml --prune
61+
62+
- name: Install git-annex
63+
# this is the trick from the spikeinterface repo for getting git-annex to work with datalad
64+
# see https://github.com/SpikeInterface/spikeinterface/pull/3877 for more info
65+
shell: bash
66+
run: |
67+
pip install datalad-installer
68+
datalad-installer --sudo ok git-annex --method datalad/packages
69+
git config --global filter.annex.process "git-annex filter-process" # recommended for efficiency
70+
71+
- name: Configure git
72+
run: |
73+
git config --global user.email "neo_ci@fake_mail.com"
74+
git config --global user.name "neo CI"
75+
76+
- name: Python version
77+
run: |
78+
which python
79+
python --version
80+
81+
- name: Install neo including dependencies
82+
# installation with dependencies is only required if no cache was found
83+
# restore-key hits should result in `cache-hit` == 'false'
84+
# if: steps.cache-conda-env.outputs.cache-hit != 'true'
85+
run: |
86+
pip install --upgrade -e .
87+
pip install .[test]
88+
89+
90+
- name: Install wine
91+
run: |
92+
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
93+
sudo dpkg --add-architecture i386
94+
sudo apt-get update -qq
95+
sudo apt-get install -yqq --allow-downgrades libc6:i386 libgcc-s1:i386 libstdc++6:i386 wine
96+
97+
- name: Pip list
98+
run: |
99+
pip list
100+
101+
- name: Conda list
102+
run: |
103+
conda list
104+
105+
- name: Test with pytest
106+
env:
107+
HDF5_PLUGIN_PATH: ${{ github.workspace }}/hdf5_local_plugin_path
108+
PLEXON2_TEST: True
109+
run: |
110+
# only neo.rawio and neo.io
111+
pytest --cov=neo neo/test/rawiotest
112+
pytest --cov=neo neo/test/iotest

neo/test/iotest/test_plexon2io.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"""
44

55
import unittest
6+
import os
67

78
from neo.io import Plexon2IO
89
from neo.test.iotest.common_io_test import BaseTestIO
@@ -17,8 +18,9 @@
1718
except (ImportError, TimeoutError):
1819
HAVE_PYPL2 = False
1920

21+
TEST_PLEXON2 = bool(os.getenv("PLEXON2_TEST"))
2022

21-
@unittest.skipUnless(HAVE_PYPL2, "requires pypl package and all its dependencies")
23+
@unittest.skipUnless(HAVE_PYPL2 and TEST_PLEXON2, "requires pypl package and all its dependencies")
2224
class TestPlexon2IO(BaseTestIO, unittest.TestCase):
2325
entities_to_download = TestPlexon2RawIO.entities_to_download
2426
entities_to_test = TestPlexon2RawIO.entities_to_test

neo/test/rawiotest/test_plexon2rawio.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
"""
2-
Tests of neo.rawio.mearecrawio
2+
Tests of neo.rawio.plexon2
33
44
"""
55

66
import unittest
7+
import os
78

89
from neo.rawio.plexon2rawio import Plexon2RawIO
9-
1010
from neo.test.rawiotest.common_rawio_test import BaseTestRawIO
11-
1211
from numpy.testing import assert_equal
1312

1413
try:
@@ -18,8 +17,9 @@
1817
except (ImportError, TimeoutError):
1918
HAVE_PYPL2 = False
2019

20+
TEST_PLEXON2 = bool(os.getenv("PLEXON2_TEST"))
2121

22-
@unittest.skipUnless(HAVE_PYPL2, "requires pypl package and all its dependencies")
22+
@unittest.skipUnless(HAVE_PYPL2 and TEST_PLEXON2, "requires pypl package and all its dependencies")
2323
class TestPlexon2RawIO(
2424
BaseTestRawIO,
2525
unittest.TestCase,

0 commit comments

Comments
 (0)