Skip to content

Commit

Permalink
Merge pull request #7792 from meeseeksmachine/auto-backport-of-pr-772…
Browse files Browse the repository at this point in the history
…8-on-1.x

Backport PR #7728 on branch 1.x (Fix handling of linked extensions)
  • Loading branch information
Steven Silvester committed Jan 16, 2020
2 parents edfc306 + 9602818 commit 68f11fe
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion jupyterlab/commands.py
Expand Up @@ -1202,13 +1202,15 @@ def format_path(path):
# Handle local extensions.
for (key, source) in local.items():
jlab['linkedPackages'][key] = source
data['resolutions'][key] = source

# Handle linked packages.
for (key, item) in linked.items():
path = pjoin(self.app_dir, 'staging', 'linked_packages')
path = pjoin(path, item['filename'])
data['dependencies'][key] = format_path(path)
jlab['linkedPackages'][key] = item['source']
data['resolutions'][key] = format_path(path)

# Handle extensions
compat_errors = self._get_extension_compat()
Expand Down Expand Up @@ -1265,6 +1267,9 @@ def _update_local(self, name, source, dname, data, dtype):
"""
# Extract the package in a temporary directory.
existing = data['filename']
if not osp.exists(pjoin(dname, existing)):
existing = ''

with TemporaryDirectory() as tempdir:
info = self._extract_package(source, tempdir)

Expand All @@ -1274,7 +1279,7 @@ def _update_local(self, name, source, dname, data, dtype):

shutil.move(info['path'], pjoin(dname, info['filename']))

# Remove the existing tarball and return the new file name.
# Remove the previous tarball and return the new file name.
if existing:
os.remove(pjoin(dname, existing))

Expand Down

0 comments on commit 68f11fe

Please sign in to comment.