Skip to content

Commit

Permalink
Use shutil.which to find out whether npm is available
Browse files Browse the repository at this point in the history
  • Loading branch information
mwouts committed Jan 11, 2021
1 parent 71393b8 commit 29176cc
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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. "
Expand Down

0 comments on commit 29176cc

Please sign in to comment.