From 29176cc74a3428a1a54cb5f7969679b734ba5cea Mon Sep 17 00:00:00 2001 From: Marc Wouts Date: Mon, 11 Jan 2021 21:00:26 +0100 Subject: [PATCH] Use shutil.which to find out whether npm is available --- setup.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 52d98bb1c..074128c85 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from io import open import re from setuptools import setup, find_packages -import subprocess +import shutil import warnings from jupyter_packaging import ( @@ -72,9 +72,7 @@ # We don't build the extensions if npm is not available # Cf. https://github.com/mwouts/jupytext/issues/706 -try: - proc = subprocess.Popen(["npm", "--version"]) -except FileNotFoundError: +if not shutil.which("npm"): warnings.warn( "The jupyterlab-jupytext extension could not be build. " "Please install nodejs if you need the extensions. "