mwouts / jupytext

Jupyter Notebooks as Markdown Documents, Julia, Python or R scripts
https://jupytext.readthedocs.io
MIT License
6.6k stars 386 forks source link

Building Jupytext fails locally #1127

Closed mwouts closed 1 year ago

mwouts commented 1 year ago

When I run BUILD_JUPYTERLAB_EXTENSION=1 python setup.py bdist_wheel locally, the build fails with an error about an invalid regular expression in webpack/lib/RuntimeTemplate.js:64

detailed logs ``` /home/marc/GitHub/jupytext/setup.py:158: DeprecatedWarning: create_cmdclass is deprecated as of 0.8 and will be removed in 1.0. " Use `wrap_installers` to handle prebuild steps in cmdclass. Use `get_data_files` to handle data files. Use `include_package_data=True` and `MANIFEST.in` for package data. cmdclass = create_cmdclass( /home/marc/GitHub/jupytext/setup.py:165: DeprecatedWarning: install_npm is deprecated as of 0.8 and will be removed in 1.0. Use `npm_builder` and `wrap_installers` install_npm( running bdist_wheel running jsdeps yarn not found, ignoring yarn.lock file Installing build dependencies with npm. This may take a while... > jlpm install yarn install v1.21.1 [1/4] Resolving packages... [2/4] Fetching packages... [3/4] Linking dependencies... warning "@jupyterlab/application > @lumino/coreutils@1.12.1" has unmet peer dependency "crypto@1.0.1". warning "@jupyterlab/builder > @jupyterlab/buildutils > verdaccio > clipanion@3.1.0" has unmet peer dependency "typanion@*". warning "@jupyterlab/codemirror > y-codemirror@3.0.1" has unmet peer dependency "yjs@^13.5.17". warning " > @jupyterlab/ui-components@3.5.0" has unmet peer dependency "react@^17.0.1". warning Workspaces can only be enabled in private projects. warning Workspaces can only be enabled in private projects. [4/4] Building fresh packages... $ jlpm run clean && jlpm run build:prod yarn run v1.21.1 $ jlpm run clean:lib $ rimraf lib tsconfig.tsbuildinfo Done in 0.60s. yarn run v1.21.1 $ jlpm run build:lib && jlpm run build:labextension $ tsc $ jupyter labextension build . Building extension in . /home/marc/GitHub/jupytext/packages/labextension/node_modules/webpack/lib/RuntimeTemplate.js:64 trimmed.match(/^[_\p{L}][_0-9\p{L}]*$/iu) || ^^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Invalid regular expression: /^[_\p{L}][_0-9\p{L}]*$/: Invalid property name in character class at internalCompileFunction (node:internal/vm:73:18) at wrapSafe (node:internal/modules/cjs/loader:1176:20) at Module._compile (node:internal/modules/cjs/loader:1218:27) at Module._extensions..js (node:internal/modules/cjs/loader:1308:10) at Module.load (node:internal/modules/cjs/loader:1117:32) at Module._load (node:internal/modules/cjs/loader:958:12) at Module.require (node:internal/modules/cjs/loader:1141:19) at require (node:internal/modules/cjs/helpers:110:18) at Object. (/home/marc/GitHub/jupytext/packages/labextension/node_modules/webpack/lib/Compilation.js:53:25) at Module._compile (node:internal/modules/cjs/loader:1254:14) Node.js v18.16.0 An error occurred. subprocess.CalledProcessError: Command '['node', '/home/marc/GitHub/jupytext/packages/labextension/node_modules/@jupyterlab/builder/lib/build-labextension.js', '--core-path', '/home/marc/venv/jupytext/lib/python3.10/site-packages/jupyterlab/staging', '/home/marc/GitHub/jupytext/packages/labextension']' returned non-zero exit status 1. See the log file for details: /tmp/jupyterlab-debug-3dkv9d4g.log error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command. Traceback (most recent call last): File "/home/marc/GitHub/jupytext/setup.py", line 175, in setup(**setup_args) File "/home/marc/venv/jupytext/lib/python3.10/site-packages/setuptools/__init__.py", line 87, in setup return distutils.core.setup(**attrs) File "/home/marc/venv/jupytext/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 185, in setup return run_commands(dist) File "/home/marc/venv/jupytext/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 201, in run_commands dist.run_commands() File "/home/marc/venv/jupytext/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 968, in run_commands self.run_command(cmd) File "/home/marc/venv/jupytext/lib/python3.10/site-packages/setuptools/dist.py", line 1217, in run_command super().run_command(command) File "/home/marc/venv/jupytext/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 987, in run_command cmd_obj.run() File "/home/marc/venv/jupytext/lib/python3.10/site-packages/jupyter_packaging/setupbase.py", line 726, in run [self.run_command(cmd) for cmd in cmds] File "/home/marc/venv/jupytext/lib/python3.10/site-packages/jupyter_packaging/setupbase.py", line 726, in [self.run_command(cmd) for cmd in cmds] File "/home/marc/venv/jupytext/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 319, in run_command self.distribution.run_command(command) File "/home/marc/venv/jupytext/lib/python3.10/site-packages/setuptools/dist.py", line 1217, in run_command super().run_command(command) File "/home/marc/venv/jupytext/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 987, in run_command cmd_obj.run() File "/home/marc/venv/jupytext/lib/python3.10/site-packages/jupyter_packaging/setupbase.py", line 345, in run c.run() File "/home/marc/venv/jupytext/lib/python3.10/site-packages/jupyter_packaging/setupbase.py", line 695, in run builder() File "/home/marc/venv/jupytext/lib/python3.10/site-packages/jupyter_packaging/setupbase.py", line 231, in builder run(npm_cmd + ["install"], cwd=node_package) File "/home/marc/venv/jupytext/lib/python3.10/site-packages/jupyter_packaging/setupbase.py", line 297, in run return subprocess.check_call(cmd, **kwargs) File "/home/marc/miniconda3/envs/jupytext-dev/lib/python3.10/subprocess.py", line 369, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['/home/marc/venv/jupytext/bin/jlpm', 'install']' returned non-zero exit status 1. ```
mwouts commented 1 year ago

There must be an issue with my conda environment (created with conda env create --file environment.yml).

In an empty virtual env (jupyterlab<4 and jupyter_packaging<0.13), with node 16.14.0 installed using https://github.com/nvm-sh/nvm#install--update-script, the build command works.