From 9bfb5219731d130e58e1287cb683b84b314266ec Mon Sep 17 00:00:00 2001 From: zm711 <92116279+zm711@users.noreply.github.com> Date: Thu, 30 May 2024 11:23:48 +0100 Subject: [PATCH] add mac for plexon2 --- .../extractors/tests/test_neoextractors.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/spikeinterface/extractors/tests/test_neoextractors.py b/src/spikeinterface/extractors/tests/test_neoextractors.py index 83da53c453..379bf00c6b 100644 --- a/src/spikeinterface/extractors/tests/test_neoextractors.py +++ b/src/spikeinterface/extractors/tests/test_neoextractors.py @@ -31,13 +31,12 @@ def has_plexon2_dependencies(): # On Windows, no need for additional dependencies return True - elif os_type == "Linux": - # Check for 'wine' using dpkg - try: - result_wine = subprocess.run( - ["dpkg", "-l", "wine"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=True - ) - except subprocess.CalledProcessError: + elif os_type == "Linux" or os_type == "Darwin": + # Check for 'wine' using which. "which" works for both mac and linux + # if package exists it returns a 0. Anything else is an error code. + + result_wine = subprocess.run(["which", "wine"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=False) + if result_wine.returncode != 0: return False # Check for 'zugbruecke' using pip @@ -48,7 +47,6 @@ def has_plexon2_dependencies(): except ImportError: return False else: - # Not sure about MacOS raise ValueError(f"Unsupported OS: {os_type}")