diff --git a/.github/workflows/installation-tips-test.yml b/.github/workflows/installation-tips-test.yml index b3bf08954d..d4529bdaff 100644 --- a/.github/workflows/installation-tips-test.yml +++ b/.github/workflows/installation-tips-test.yml @@ -31,3 +31,9 @@ jobs: uses: conda-incubator/setup-miniconda@v2.2.0 with: environment-file: ./installation_tips/full_spikeinterface_environment_${{ matrix.label }}.yml + activate-environment: si_env + - name: Check Installation Tips + run: python ./installation_tips/check_your_install.py --ci # ci flag turns off gui + - name: Windows cleanup + if: ${{ matrix.label == 'windows' }} + run: python .installation_tips/cleanup_for_windows.py diff --git a/installation_tips/check_your_install.py b/installation_tips/check_your_install.py index 2b13a941cd..4e01beb901 100644 --- a/installation_tips/check_your_install.py +++ b/installation_tips/check_your_install.py @@ -2,12 +2,11 @@ import platform import os import shutil - +import argparse def check_import_si(): import spikeinterface as si - def check_import_si_full(): import spikeinterface.full as si @@ -25,7 +24,6 @@ def _run_one_sorter_and_exctract_wf(sorter_name): si.extract_waveforms(rec, sorting, f'{sorter_name}_waveforms', n_jobs=1, total_memory="10M", max_spikes_per_unit=500, return_scaled=False) - def run_tridesclous(): _run_one_sorter_and_exctract_wf('tridesclous') @@ -49,7 +47,6 @@ def open_sigui(): win.show() app.exec_() - def export_to_phy(): import spikeinterface.full as si we = si.WaveformExtractor.load_from_folder("tridesclous_waveforms") @@ -73,9 +70,15 @@ def _clean(): if Path(folder).exists(): shutil.rmtree(folder) +parser = argparse.ArgumentParser() +# add ci flag so that gui will not be used in ci +# end user can ignore +parser.add_argument('--ci', action='store_false') if __name__ == '__main__': + args = parser.parse_args() + _clean() _create_recording() @@ -83,12 +86,16 @@ def _clean(): ('Import spikeinterface', check_import_si), ('Import spikeinterface.full', check_import_si_full), ('Run tridesclous', run_tridesclous), - ('Open spikeinterface-gui', open_sigui), - ('Export to phy', export_to_phy), + ] + + # backwards logic because default is True for end-user + if args.ci: + steps.insert(3, ('Open spikeinterface-gui', open_sigui) ) + + steps.append(('Export to phy', export_to_phy)), # phy is removed from the env because it force a pip install PyQt5 # which break the conda env # ('Open phy', open_phy), - ] if platform.system() == "Windows": pass