Can't build extensions on Windows
mattpap opened this issue · comments
Mateusz Paprocki commented
Probably an issue with npm. May be related to #13834. Fails with:
================================== FAILURES ===================================
______________________________ test_ext_commands ______________________________
tmpdir = local('C:\\Users\\runneradmin\\AppData\\Local\\Temp\\pytest-of-runneradmin\\pytest-0\\test_ext_commands0')
def test_ext_commands(tmpdir) -> None:
tmp = str(tmpdir.mkdir("bk_ext_01"))
assert _names(tmp) == []
assert ext.init(tmp, bokehjs_version="3.0.0") is True
assert _names(tmp) == [
"bokeh.ext.json",
"index.ts",
"package.json",
"tsconfig.json",
]
> assert ext.build(tmp) is True
E AssertionError: assert False is True
E + where False = <function build at 0x0000023045EEC3A0>('C:\\Users\\runneradmin\\AppData\\Local\\Temp\\pytest-of-runneradmin\\pytest-0\\test_ext_commands0\\bk_ext_01')
E + where <function build at 0x0000023045EEC3A0> = ext.build
tests\unit\bokeh\test_ext.py:46: AssertionError
---------------------------- Captured stdout call -----------------------------
Working directory: C:\Users\runneradmin\AppData\Local\Temp\pytest-of-runneradmin\pytest-0\test_ext_commands0\bk_ext_01
Wrote C:\Users\runneradmin\AppData\Local\Temp\pytest-of-runneradmin\pytest-0\test_ext_commands0\bk_ext_01\bokeh.ext.json
Wrote C:\Users\runneradmin\AppData\Local\Temp\pytest-of-runneradmin\pytest-0\test_ext_commands0\bk_ext_01\package.json
Wrote C:\Users\runneradmin\AppData\Local\Temp\pytest-of-runneradmin\pytest-0\test_ext_commands0\bk_ext_01\tsconfig.json
Created empty index.ts. This is the entry point of your extension.
You can build your extension with bokeh build C:\Users\runneradmin\AppData\Local\Temp\pytest-of-runneradmin\pytest-0\test_ext_commands0\bk_ext_01
All done.
Working directory: C:\Users\runneradmin\AppData\Local\Temp\pytest-of-runneradmin\pytest-0\test_ext_commands0\bk_ext_01
Using different version of bokeh, rebuilding from scratch.
Running npm install.
TypeScript lib: C:\Miniconda3\envs\bk-test\Lib\site-packages\bokeh\server\static\lib
Using C:\Users\runneradmin\AppData\Local\Temp\pytest-of-runneradmin\pytest-0\test_ext_commands0\bk_ext_01\tsconfig.json
Compiling styles (0 files)
Compiling TypeScript (1 file)
Error: base path C:\Users\runneradmin\AppData\Local\Temp\pytest-of-runneradmin\pytest-0\test_ext_commands0\bk_ext_01\node_modules doesn't exist or isn't a directory
at new Linker (C:\Miniconda3\envs\bk-test\Lib\site-packages\bokeh\server\static\js\compiler.js:184514:27)
at build (C:\Miniconda3\envs\bk-test\Lib\site-packages\bokeh\server\static\js\compiler.js:183168:24)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async main (C:\Miniconda3\envs\bk-test\Lib\site-packages\bokeh\server\static\js\compiler.js:222:32)
__________ Test_bundle_custom_extensions.test_with_INLINE_resources ___________
self = <test_bundle.Test_bundle_custom_extensions object at 0x0000023049624C10>
def test_with_INLINE_resources(self) -> None:
from latex_label import LatexLabel
plot = models.Plot()
plot.add_layout(LatexLabel(x=0, y=0))
> bundle = beb.bundle_for_objs_and_resources([plot], INLINE)
tests\unit\bokeh\embed\test_bundle.py:118:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\Miniconda3\envs\bk-test\lib\site-packages\bokeh\embed\bundle.py:195: in bundle_for_objs_and_resources
js_raw.extend([ Resources._inline(bundle.artifact_path) for bundle in extensions ])
C:\Miniconda3\envs\bk-test\lib\site-packages\bokeh\embed\bundle.py:195: in <listcomp>
js_raw.extend([ Resources._inline(bundle.artifact_path) for bundle in extensions ])
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
path = WindowsPath('D:/a/bokeh/bokeh/tests/unit/bokeh/embed/latex_label/dist/latex_label.js')
@staticmethod
def _inline(path: Path) -> str:
filename = path.name
begin = f"/* BEGIN {filename} */"
> with open(path, "rb") as f:
E FileNotFoundError: [Errno 2] No such file or directory: 'D:\\a\\bokeh\\bokeh\\tests\\unit\\bokeh\\embed\\latex_label\\dist\\latex_label.js'
C:\Miniconda3\envs\bk-test\lib\site-packages\bokeh\resources.py:479: FileNotFoundError
---------------------------- Captured stdout setup ----------------------------
Working directory: D:\a\bokeh\bokeh\tests\unit\bokeh\embed\latex_label
Using different version of bokeh, rebuilding from scratch.
Running npm install.
TypeScript lib: C:\Miniconda3\envs\bk-test\Lib\site-packages\bokeh\server\static\lib
Using D:\a\bokeh\bokeh\tests\unit\bokeh\embed\latex_label\tsconfig.json
Compiling styles (0 files)
Compiling TypeScript (2 files)
tests/unit/bokeh/embed/latex_label/index.ts:3:31 - error TS2307: Cannot find module '@bokehjs/base' or its corresponding type declarations.
3 import {register_models} from "@bokehjs/base"
~~~~~~~~~~~~~~~
tests/unit/bokeh/embed/latex_label/latex_label.ts:1:40 - error TS2307: Cannot find module '@bokehjs/models/annotations/html/label' or its corresponding type declarations.
1 import {HTMLLabel, HTMLLabelView} from "@bokehjs/models/annotations/html/label"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tests/unit/bokeh/embed/latex_label/latex_label.ts:3:24 - error TS2307: Cannot find module 'katex' or its corresponding type declarations.
3 import * as katex from "katex"
~~~~~~~
tests/unit/bokeh/embed/latex_label/latex_label.ts:11:22 - error TS[411](https://github.com/bokeh/bokeh/actions/runs/8858943839/job/24343080009#step:5:412)2: This member cannot have an 'override' modifier because its containing class 'LatexLabelView' does not extend another class.
11 protected override _render(): void {
~~~~~~~
tests/unit/bokeh/embed/latex_label/latex_label.ts:13:29 - error TS2339: Property 'text' does not exist on type 'LatexLabel'.
13 katex.render(this.model.text, this.el, {displayMode: true})
~~~~
tests/unit/bokeh/embed/latex_label/latex_label.ts:13:40 - error TS2339: Property 'el' does not exist on type 'LatexLabelView'.
13 katex.render(this.model.text, this.el, {displayMode: true})
~~
tests/unit/bokeh/embed/latex_label/latex_label.ts:18:19 - error TS4112: This member cannot have an 'override' modifier because its containing class 'LatexLabel' does not extend another class.
18 static override __module__ = "latex_label"
~~~~~~~~~~
tests/unit/bokeh/embed/latex_label/latex_label.ts:21:20 - error TS2339: Property 'default_view' does not exist on type 'LatexLabel'.
21 this.prototype.default_view = LatexLabelView
~~~~~~~~~~~~
Error: base path D:\a\bokeh\bokeh\tests\unit\bokeh\embed\latex_label\node_modules doesn't exist or isn't a directory
at new Linker (C:\Miniconda3\envs\bk-test\Lib\site-packages\bokeh\server\static\js\compiler.js:184514:27)
at build (C:\Miniconda3\envs\bk-test\Lib\site-packages\bokeh\server\static\js\compiler.js:183168:24)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async main (C:\Miniconda3\envs\bk-test\Lib\site-packages\bokeh\server\static\js\compiler.js:222:32)
_________ Test_bundle_ext_package_no_main.test_with_INLINE_resources __________
self = <test_bundle.Test_bundle_ext_package_no_main object at 0x0000023049625330>
def test_with_INLINE_resources(self) -> None:
from ext_package_no_main import AModel
model = AModel()
> bundle = beb.bundle_for_objs_and_resources([model], INLINE)
tests\unit\bokeh\embed\test_bundle.py:165:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\Miniconda3\envs\bk-test\lib\site-packages\bokeh\embed\bundle.py:195: in bundle_for_objs_and_resources
js_raw.extend([ Resources._inline(bundle.artifact_path) for bundle in extensions ])
C:\Miniconda3\envs\bk-test\lib\site-packages\bokeh\embed\bundle.py:195: in <listcomp>
js_raw.extend([ Resources._inline(bundle.artifact_path) for bundle in extensions ])
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
path = WindowsPath('D:/a/bokeh/bokeh/tests/unit/bokeh/embed/ext_package_no_main/dist/ext_package_no_main.js')
@staticmethod
def _inline(path: Path) -> str:
filename = path.name
begin = f"/* BEGIN {filename} */"
> with open(path, "rb") as f:
E FileNotFoundError: [Errno 2] No such file or directory: 'D:\\a\\bokeh\\bokeh\\tests\\unit\\bokeh\\embed\\ext_package_no_main\\dist\\ext_package_no_main.js'
C:\Miniconda3\envs\bk-test\lib\site-packages\bokeh\resources.py:479: FileNotFoundError
---------------------------- Captured stdout setup ----------------------------
Working directory: D:\a\bokeh\bokeh\tests\unit\bokeh\embed\ext_package_no_main
Using different version of bokeh, rebuilding from scratch.
Running npm install.
TypeScript lib: C:\Miniconda3\envs\bk-test\Lib\site-packages\bokeh\server\static\lib
Using D:\a\bokeh\bokeh\tests\unit\bokeh\embed\ext_package_no_main\tsconfig.json
Compiling styles (0 files)
Compiling TypeScript (1 file)
tests/unit/bokeh/embed/ext_package_no_main/index.ts:1:21 - error TS2307: Cannot find module '@bokehjs/model' or its corresponding type declarations.
1 import {Model} from "@bokehjs/model"
~~~~~~~~~~~~~~~~
tests/unit/bokeh/embed/ext_package_no_main/index.ts:4:19 - error TS4112: This member cannot have an 'override' modifier because its containing class 'AModel' does not extend another class.
4 static override __module__ = "ext_package_no_main"
~~~~~~~~~~
tests/unit/bokeh/embed/ext_package_no_main/index.ts:7:31 - error TS2307: Cannot find module '@bokehjs/base' or its corresponding type declarations.
7 import {register_models} from "@bokehjs/base"
~~~~~~~~~~~~~~~
Error: base path D:\a\bokeh\bokeh\tests\unit\bokeh\embed\ext_package_no_main\node_modules doesn't exist or isn't a directory
at new Linker (C:\Miniconda3\envs\bk-test\Lib\site-packages\bokeh\server\static\js\compiler.js:18[451](https://github.com/bokeh/bokeh/actions/runs/8858943839/job/24343080009#step:5:452)4:27)
at build (C:\Miniconda3\envs\bk-test\Lib\site-packages\bokeh\server\static\js\compiler.js:183168:24)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async main (C:\Miniconda3\envs\bk-test\Lib\site-packages\bokeh\server\static\js\compiler.js:222:32)
___________ Test_bundle_ext_package_no_main.test_with_CDN_resources ___________
self = <test_bundle.Test_bundle_ext_package_no_main object at 0x0000023049625480>
def test_with_CDN_resources(self) -> None:
from ext_package_no_main import AModel
model = AModel()
> bundle = beb.bundle_for_objs_and_resources([model], CDN)
tests\unit\bokeh\embed\test_bundle.py:172:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\Miniconda3\envs\bk-test\lib\site-packages\bokeh\embed\bundle.py:203: in bundle_for_objs_and_resources
js_raw.append(Resources._inline(bundle.artifact_path))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
path = WindowsPath('D:/a/bokeh/bokeh/tests/unit/bokeh/embed/ext_package_no_main/dist/ext_package_no_main.js')
@staticmethod
def _inline(path: Path) -> str:
filename = path.name
begin = f"/* BEGIN {filename} */"
> with open(path, "rb") as f:
E FileNotFoundError: [Errno 2] No such file or directory: 'D:\\a\\bokeh\\bokeh\\tests\\unit\\bokeh\\embed\\ext_package_no_main\\dist\\ext_package_no_main.js'
C:\Miniconda3\envs\bk-test\lib\site-packages\bokeh\resources.py:479: FileNotFoundError
---------- coverage: platform win32, python 3.10.14-final-0 ----------
Coverage XML written to file coverage.xml
=========================== short test summary info ===========================
FAILED tests/unit/bokeh/test_ext.py::test_ext_commands - AssertionError: assert False is True
+ where False = <function build at 0x0000023045EEC3A0>('C:\\Users\\runneradmin\\AppData\\Local\\Temp\\pytest-of-runneradmin\\pytest-0\\test_ext_commands0\\bk_ext_01')
+ where <function build at 0x0000023045EEC3A0> = ext.build
FAILED tests/unit/bokeh/embed/test_bundle.py::Test_bundle_custom_extensions::test_with_INLINE_resources - FileNotFoundError: [Errno 2] No such file or directory: 'D:\\a\\bokeh\\bokeh\\tests\\unit\\bokeh\\embed\\latex_label\\dist\\latex_label.js'
FAILED tests/unit/bokeh/embed/test_bundle.py::Test_bundle_ext_package_no_main::test_with_INLINE_resources - FileNotFoundError: [Errno 2] No such file or directory: 'D:\\a\\bokeh\\bokeh\\tests\\unit\\bokeh\\embed\\ext_package_no_main\\dist\\ext_package_no_main.js'
FAILED tests/unit/bokeh/embed/test_bundle.py::Test_bundle_ext_package_no_main::test_with_CDN_resources - FileNotFoundError: [Errno 2] No such file or directory: 'D:\\a\\bokeh\\bokeh\\tests\\unit\\bokeh\\embed\\ext_package_no_main\\dist\\ext_package_no_main.js'
=== 4 failed, 11162 passed, 23 skipped, 129 deselected in 283.34s (0:04:43) ===