Skip to content

Commit

Permalink
Add plexon2 tests action for install wine and drop full (linux only) …
Browse files Browse the repository at this point in the history
…tests (#3101)

* add plexon tests and drop full (linux only) tests
  • Loading branch information
h-mayorquin authored Jul 2, 2024
1 parent 6dbf7c6 commit a178b7e
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 224 deletions.
19 changes: 14 additions & 5 deletions .github/actions/install-wine/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,29 @@ name: Install packages
description: This action installs the package and its dependencies for testing

inputs:
python-version:
description: 'Python version to set up'
required: false
os:
description: 'Operating system to set up'
required: false
required: true

runs:
using: "composite"
steps:
- name: Install wine (needed for Plexon2)
- name: Install wine on Linux
if: runner.os == 'Linux'
run: |
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
sudo dpkg --add-architecture i386
sudo apt-get update -qq
sudo apt-get install -yqq --allow-downgrades libc6:i386 libgcc-s1:i386 libstdc++6:i386 wine
shell: bash
- name: Install wine on macOS
if: runner.os == 'macOS'
run: |
brew install --cask xquartz
brew install --cask wine-stable
shell: bash

- name: Skip installation on Windows
if: ${{ inputs.os == 'Windows' }}
run: echo "Skipping Wine installation on Windows. Not necessary."
shell: bash
77 changes: 37 additions & 40 deletions .github/determine_testing_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,50 +36,47 @@

file_is_in_src = changed_file.parts[0] == "src"

if not file_is_in_src:

if changed_file.name == "pyproject.toml":
pyproject_toml_changed = True

else:
if changed_file.name == "neobaseextractor.py":
neobaseextractor_changed = True
elif changed_file.name == "plexon2.py":
extractors_changed = True
elif "core" in changed_file.parts:
conditions_changed = True
elif "extractors" in changed_file.parts:
extractors_changed = True
elif "preprocessing" in changed_file.parts:
preprocessing_changed = True
elif "postprocessing" in changed_file.parts:
postprocessing_changed = True
elif "qualitymetrics" in changed_file.parts:
qualitymetrics_changed = True
elif "comparison" in changed_file.parts:
comparison_changed = True
elif "curation" in changed_file.parts:
curation_changed = True
elif "widgets" in changed_file.parts:
widgets_changed = True
elif "exporters" in changed_file.parts:
exporters_changed = True
elif "sortingcomponents" in changed_file.parts:
sortingcomponents_changed = True
elif "generation" in changed_file.parts:
generation_changed = True
elif "sorters" in changed_file.parts:
if "external" in changed_file.parts:
sorters_external_changed = True
elif "internal" in changed_file.parts:
sorters_internal_changed = True
else:
sorters_changed = True

if changed_file.name == "pyproject.toml":
pyproject_toml_changed = True
elif changed_file.name == "neobaseextractor.py":
neobaseextractor_changed = True
elif changed_file.name == "plexon2.py":
plexon2_changed = True
elif "core" in changed_file.parts:
core_changed = True
elif "extractors" in changed_file.parts:
extractors_changed = True
elif "preprocessing" in changed_file.parts:
preprocessing_changed = True
elif "postprocessing" in changed_file.parts:
postprocessing_changed = True
elif "qualitymetrics" in changed_file.parts:
qualitymetrics_changed = True
elif "comparison" in changed_file.parts:
comparison_changed = True
elif "curation" in changed_file.parts:
curation_changed = True
elif "widgets" in changed_file.parts:
widgets_changed = True
elif "exporters" in changed_file.parts:
exporters_changed = True
elif "sortingcomponents" in changed_file.parts:
sortingcomponents_changed = True
elif "generation" in changed_file.parts:
generation_changed = True
elif "sorters" in changed_file.parts:
if "external" in changed_file.parts:
sorters_external_changed = True
elif "internal" in changed_file.parts:
sorters_internal_changed = True
else:
sorters_changed = True


run_everything = core_changed or pyproject_toml_changed or neobaseextractor_changed
run_generation_tests = run_everything or generation_changed
run_extractor_tests = run_everything or extractors_changed
run_extractor_tests = run_everything or extractors_changed or plexon2_changed
run_preprocessing_tests = run_everything or preprocessing_changed
run_postprocessing_tests = run_everything or postprocessing_changed
run_qualitymetrics_tests = run_everything or qualitymetrics_changed
Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/all-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,8 @@ jobs:
run: pytest -m "core"
shell: bash

- name: Install Other Testing Dependencies
- name: Install Dependencies for Timing Display
run: |
pip install -e .[test]
pip install tabulate
pip install pandas
shell: bash
Expand All @@ -91,6 +90,7 @@ jobs:
run: echo "dataset_hash=$(git ls-remote https://gin.g-node.org/NeuralEnsemble/ephy_testing_data.git HEAD | cut -f1)" >> $GITHUB_OUTPUT

- name: Cache datasets
if: env.RUN_EXTRACTORS_TESTS == 'true'
id: cache-datasets
uses: actions/cache/restore@v4
with:
Expand Down Expand Up @@ -119,6 +119,9 @@ jobs:
fi
git config --global filter.annex.process "git-annex filter-process" # recommended for efficiency
- name : Install Plexon dependencies
if: env.INSTALL_PLEXON_DEPENDENCIES == 'true'
uses: ./.github/actions/install-wine

- name: Set execute permissions on run_tests.sh
shell: bash
Expand All @@ -130,16 +133,21 @@ jobs:
HDF5_PLUGIN_PATH: ${{ github.workspace }}/hdf5_plugin_path_maxwell
if: env.RUN_EXTRACTORS_TESTS == 'true'
run: |
pip install -e .[extractors,streaming_extractors]
pip install -e .[extractors,streaming_extractors,test_extractors]
./.github/run_tests.sh "extractors and not streaming_extractors" --no-virtual-env
- name: Test preprocessing
shell: bash
if: env.RUN_PREPROCESSING_TESTS == 'true'
run: |
pip install -e .[preprocessing]
pip install -e .[preprocessing,test_preprocessing]
./.github/run_tests.sh "preprocessing and not deepinterpolation" --no-virtual-env
- name: Install remaining testing dependencies # TODO: Remove this step once we have better modularization
shell: bash
run: |
pip install -e .[test]
- name: Test postprocessing
shell: bash
if: env.RUN_POSTPROCESSING_TESTS == 'true'
Expand Down
167 changes: 0 additions & 167 deletions .github/workflows/full-test.yml

This file was deleted.

22 changes: 17 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ streaming_extractors = [
"s3fs"
]


preprocessing = [
"scipy",
]
Expand Down Expand Up @@ -124,10 +125,23 @@ test_core = [

# for github test : probeinterface and neo from master
# for release we need pypi, so this need to be commented
# "probeinterface @ git+https://github.com/SpikeInterface/probeinterface.git",
# "neo @ git+https://github.com/NeuralEnsemble/python-neo.git",
"probeinterface @ git+https://github.com/SpikeInterface/probeinterface.git",
"neo @ git+https://github.com/NeuralEnsemble/python-neo.git",
]

test_extractors = [
# Functions to download data in neo test suite
"pooch>=1.8.2",
"datalad>=1.0.2",
"probeinterface @ git+https://github.com/SpikeInterface/probeinterface.git",
"neo @ git+https://github.com/NeuralEnsemble/python-neo.git",
]

test_preprocessing = [
"ibllib>=2.36.0", # for IBL
]


test = [
"pytest",
"pytest-dependency",
Expand All @@ -148,9 +162,7 @@ test = [

# for sortingview backend
"sortingview",
# Download data
"pooch>=1.8.2",
"datalad>=1.0.2",


## install tridesclous for testing ##
"tridesclous>=1.6.8",
Expand Down
Loading

0 comments on commit a178b7e

Please sign in to comment.