diff --git a/jupyterlab/commands.py b/jupyterlab/commands.py index f86df31f18df..e0532c9dd134 100644 --- a/jupyterlab/commands.py +++ b/jupyterlab/commands.py @@ -1194,6 +1194,7 @@ 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(): @@ -1201,6 +1202,7 @@ def format_path(path): 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() @@ -1256,6 +1258,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) @@ -1265,7 +1270,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))