Ver código fonte

Merge pull request #6749 from vidartf/winbuild

Fix publish on Windows
Steven Silvester 5 anos atrás
pai
commit
3dce7286ce

+ 6 - 4
RELEASE.md

@@ -67,9 +67,11 @@ JupyterLab itself, run `jlpm run bumpversion major`.
 
 - Run `jlpm run bumpversion build` to create a new `alpha` version.
 - Push the commits and tags as prompted.
-- Run `jlpm run publish:all` to publish the JS and Python packages.
+- Run `npm run publish:all` to publish the JS and Python packages.
+  Note that the use of `npm` instead of `jlpm` is
+  [significant on Windows](https://github.com/jupyterlab/jupyterlab/issues/6733).
   Execute the suggested commands after doing a quick sanity check.
-  If there is a network error during JS publish, run `jlpm run publish:all --skip-build` to resume publish without requiring another
+  If there is a network error during JS publish, run `npm run publish:all --skip-build` to resume publish without requiring another
   clean and build phase of the JS packages.
 - Run `jlpm run bumpversion release` to switch to an `rc` version.
   (running `jlpm run bumpversion build` will then increment `rc` versions).
@@ -106,7 +108,7 @@ Now do the actual final release:
 
 - [ ] Run `jlpm run bumpversion release` to switch to final release
 - [ ] Push the commit and tags to master
-- [ ] Run `jlpm run publish:all` to publish the packages
+- [ ] Run `npm run publish:all` to publish the packages
 - [ ] Create a branch for the release and push to GitHub
 - [ ] Merge the PRs on the other repos and set the default branch of the
       xckd repo
@@ -117,7 +119,7 @@ the next release:
 
 - [ ] Run `jlpm run bumpversion minor` to bump to alpha for the next alpha release
 - [ ] Put the commit and tags to master
-- [ ] Run `jlpm run publish:all` to publish the packages
+- [ ] Run `npm run publish:all` to publish the packages
 - [ ] Release the other repos as appropriate
 - [ ] Update version for [binder](https://github.com/jupyterlab/jupyterlab/blob/master/RELEASE.md#update-version-for-binder)
 

+ 3 - 1
buildutils/src/ensure-repo.ts

@@ -219,7 +219,9 @@ function ensureJupyterlab(): string[] {
     }
 
     // watch all src, build, and test files in the Jupyterlab project
-    let relativePath = `../${path.relative(basePath, pkgPath)}`;
+    let relativePath = utils.ensureUnixPathSep(
+      path.join('..', path.relative(basePath, pkgPath))
+    );
     corePackage.jupyterlab.linkedPackages[data.name] = relativePath;
   });
 

+ 1 - 1
buildutils/src/prepublish-check.ts

@@ -8,7 +8,7 @@ import * as glob from 'glob';
 import * as path from 'path';
 import * as utils from './utils';
 
-utils.run('jlpm run clean:slate');
+utils.run('npm run clean:slate');
 utils.run('lerna run prepublishOnly');
 
 utils.getLernaPaths().forEach(pkgPath => {

+ 1 - 1
buildutils/src/publish.ts

@@ -24,7 +24,7 @@ commander
     // Optionally clean and build the python packages.
     if (!options.skipBuild) {
       // Ensure a clean state.
-      utils.run('jlpm run clean:slate');
+      utils.run('npm run clean:slate');
     }
 
     // Publish JS to the appropriate tag.

+ 12 - 0
buildutils/src/utils.ts

@@ -8,6 +8,8 @@ import coreutils = require('@phosphor/coreutils');
 
 type Dict<T> = { [key: string]: T };
 
+const backSlash = /\\/g;
+
 /**
  * Get all of the lerna package paths.
  */
@@ -262,3 +264,13 @@ function requirePackage(parentModule: string, module: string) {
   });
   return require(requirePath);
 }
+
+/**
+ * Ensure the given path uses '/' as path separator.
+ */
+export function ensureUnixPathSep(source: string) {
+  if (path.sep === '/') {
+    return source;
+  }
+  return source.replace(backSlash, '/');
+}

+ 2 - 2
clean.py

@@ -13,11 +13,11 @@ if os.name == 'nt':
             dnames.remove('node_modules')
 
 
+subprocess.check_call('python -m pip uninstall -y jupyterlab'.split(), cwd=here)
+
 git_clean_exclude = [
     '-e',
     '/.vscode',
 ]
 git_clean_command = ['git', 'clean', '-dfx'] + git_clean_exclude
 subprocess.check_call(git_clean_command, cwd=here)
-
-subprocess.call('python -m pip uninstall -y jupyterlab'.split(), cwd=here)