I have been trying to get the pip install -e . command to work for hours with a hybrid plugin for Jupyter Lab 4.3.1 (the skeleton was initially created using copier). It seems to be having a hard time resolving the location of the entry point for the front end artifacts. from the messages it looks like it isn’t search for typescript files for some reason. Everything is being built within a mamba environment (although hatchling creates its own isolated environment for the build). The build log is as follows:
Obtaining file:///C:/projects/my-extension2
Installing build dependencies … done
Checking if build backend supports build_editable … done
Getting requirements to build editable … done
Installing backend dependencies … done
Preparing editable metadata (pyproject.toml) … error
error: subprocess-exited-with-error
× Preparing editable metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [83 lines of output]
INFO:hatch_jupyter_builder.utils:Running jupyter-builder
INFO:hatch_jupyter_builder.utils:Building with hatch_jupyter_builder.npm_builder
INFO:hatch_jupyter_builder.utils:With kwargs: {‘npm’: [‘jlpm’], ‘build_cmd’: ‘build:dev’, ‘source_dir’: ‘src’}
INFO:hatch_jupyter_builder.utils:Installing build dependencies with npm. This may take a while…
INFO:hatch_jupyter_builder.utils:> C:\Users\kkoster\AppData\Local\Temp\1\pip-build-env-v3gw2x59\overlay\Scripts\jl
pm.EXE install
➤ YN0000: ┌ Resolution step
➤ YN0002: │ @jupyterlab/services@npm:7.4.5::__archiveUrl=https%3A%2F%2Fprodart.mycompany.com%3A443%
2Fartifactory%2Fapi%2Fnpm%2Fnpm-virtual%2F%40jupyterlab%2Fservices%2F-%2Fservices-7.4.5.tgz doesn’t provide react (pe19f
1), requested by @jupyterlab/settingregistry
➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements for details,
where is the six-letter p-prefixed code
➤ YN0000: └ Completed in 0s 312ms
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed in 0s 557ms
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed in 0s 546ms
➤ YN0000: Done with warnings in 1s 496ms
INFO:hatch_jupyter_builder.utils:> C:\Users\kkoster\AppData\Local\Temp\1\pip-build-env-v3gw2x59\overlay\Scripts\jl
pm.EXE run build:dev
Entrypoint main =
ERROR in main
Module not found: Error: Can't resolve './src' in 'C:\projects\my-extension2'
resolve './src' in 'C:\projects\my-extension2'
using description file: C:\projects\my-extension2\package.json (relative path: .)
Field 'browser' doesn't contain a valid alias configuration
using description file: C:\projects\my-extension2\package.json (relative path: ./src)
no extension
Field 'browser' doesn't contain a valid alias configuration
C:\projects\my-extension2\src is not a file
.js
Field 'browser' doesn't contain a valid alias configuration
C:\projects\my-extension2\src.js doesn't exist
.json
Field 'browser' doesn't contain a valid alias configuration
C:\projects\my-extension2\src.json doesn't exist
.wasm
Field 'browser' doesn't contain a valid alias configuration
C:\projects\my-extension2\src.wasm doesn't exist
as directory
existing directory C:\projects\my-extension2\src
using description file: C:\projects\my-extension2\package.json (relative path: ./src)
using path: C:\projects\my-extension2\src\index
using description file: C:\projects\my-extension2\package.json (relative path: ./src/
index)
no extension
Field ‘browser’ doesn’t contain a valid alias configuration
C:\projects\my-extension2\src\index doesn’t exist
.js
Field ‘browser’ doesn’t contain a valid alias configuration
C:\projects\my-extension2\src\index.js doesn’t exist
.json
Field ‘browser’ doesn’t contain a valid alias configuration
C:\projects\my-extension2\src\index.json doesn’t exist
.wasm
Field ‘browser’ doesn’t contain a valid alias configuration
C:\projects\my-extension2\src\index.wasm doesn’t exist
webpack 5.101.0 compiled with 1 error in 101 ms
Traceback (most recent call last):
File "C:\projects\my-extension2\python\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\
_in_process.py", line 167, in prepare_metadata_for_build_editable
hook = backend.prepare_metadata_for_build_editable
AttributeError: module ‘hatchling.build’ has no attribute ‘prepare_metadata_for_build_editable’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\projects\my-extension2\python\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\
_in_process.py", line 353, in
main()
File “C:\projects\my-extension2\python\lib\site-packages\pip_vendor\pyproject_hooks_in_process
_in_process.py”, line 335, in main
json_out[‘return_val’] = hook(**hook_input[‘kwargs’])
File “C:\projects\my-extension2\python\lib\site-packages\pip_vendor\pyproject_hooks_in_process
_in_process.py”, line 176, in prepare_metadata_for_build_editable
whl_basename = build_hook(metadata_directory, config_settings)
File “C:\Users\kkoster\AppData\Local\Temp\1\pip-build-env-v3gw2x59\overlay\Lib\site-packages\hatchling\build.py”
, line 83, in build_editable
return os.path.basename(next(builder.build(directory=wheel_directory, versions=[‘editable’])))
File “C:\Users\kkoster\AppData\Local\Temp\1\pip-build-env-v3gw2x59\overlay\Lib\site-packages\hatchling\builders
plugin\interface.py”, line 147, in build
build_hook.initialize(version, build_data)
File “C:\Users\kkoster\AppData\Local\Temp\1\pip-build-env-v3gw2x59\normal\Lib\site-packages\hatch_jupyter_builde
r\plugin.py”, line 94, in initialize
raise e
File “C:\Users\kkoster\AppData\Local\Temp\1\pip-build-env-v3gw2x59\normal\Lib\site-packages\hatch_jupyter_builde
r\plugin.py”, line 89, in initialize
build_func(self.target_name, version, **build_kwargs)
File “C:\Users\kkoster\AppData\Local\Temp\1\pip-build-env-v3gw2x59\normal\Lib\site-packages\hatch_jupyter_builde
r\utils.py”, line 117, in npm_builder
run([*npm_cmd, “run”, build_cmd], cwd=str(abs_path))
File “C:\Users\kkoster\AppData\Local\Temp\1\pip-build-env-v3gw2x59\normal\Lib\site-packages\hatch_jupyter_builde
r\utils.py”, line 231, in run
return subprocess.check_call(cmd, **kwargs)
File “C:\projects\my-extension2\python\lib\subprocess.py”, line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘[‘C:\Users\kkoster\AppData\Local\Temp\1\pip-build-env-v3gw2x59\ove
rlay\Scripts\jlpm.EXE’, ‘run’, ‘build:dev’]’ returned non-zero exit status 1.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
I ran the vanilla pip install . (no -e) and the build completed without incident.
The pyproject.toml keywords for the editable and regular build are identical with the exception of the npm script name (build:dev and build:prod respectively). However, the contents of these script entries are identical except for the mode:
“build:dev”: “webpack --mode development --devtool source-map”,
“build:prod”: “webpack --mode production --devtool source-map”,