Skip to content

Commit

Permalink
Properly install NPM Packages
Browse files Browse the repository at this point in the history
  • Loading branch information
jtpio committed May 22, 2021
1 parent f027ee6 commit 1e2355f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
17 changes: 14 additions & 3 deletions jupyter_releaser/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,9 +478,20 @@ def prep_git(ref, branch, repo, auth, username, url, install=True):
else:
util.run(checkout_cmd)

# Install the package with test deps
if util.SETUP_PY.exists() and install:
util.run('pip install ".[test]"')
# Install the package
if install:
# install python package with test deps
if util.SETUP_PY.exists():
util.run('pip install ".[test]"')

# prefer yarn if yarn lock exists
elif util.YARN_LOCK.exists():
util.run("npm install -g yarn")
util.run("yarn")

# npm install otherwise
elif util.PACKAGE_JSON.exists():
util.run("npm install")

os.chdir(orig_dir)

Expand Down
1 change: 1 addition & 0 deletions jupyter_releaser/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
SETUP_PY = Path("setup.py")
SETUP_CFG = Path("setup.cfg")
PACKAGE_JSON = Path("package.json")
YARN_LOCK = Path("yarn.lock")
jupyter_releaser_CONFIG = Path(".jupyter-releaser.toml")

BUF_SIZE = 65536
Expand Down

0 comments on commit 1e2355f

Please sign in to comment.