callmephilip
callmephilip
DDeno
Created by callmephilip on 12/17/2024 in #help
Cannot access files inside package when running from jsr
I have the following "init" script populating new project using files in project-template
import path from "node:path";

// ...

if (import.meta.main) {
copySync(new URL("../project-template", import.meta.url), projectPath, {
overwrite: false,
});
}
import path from "node:path";

// ...

if (import.meta.main) {
copySync(new URL("../project-template", import.meta.url), projectPath, {
overwrite: false,
});
}
When invoked locally it works as expected. However, if I attempt to run it from jsr like so
deno run -R -W jsr:@myorg/stuff/init
deno run -R -W jsr:@myorg/stuff/init
It fails since meta resolves as https://jsr.io/@myorg/stuff/0.1.21/project-template. How can I get this to work consistently both locally and remotely? How do you guys usually handle this sorts of stuff?
3 replies
DDeno
Created by callmephilip on 12/16/2024 in #help
Deno Jupyter: get path to the current notebook
Is there a way to get current full path to the current notebook from within a ts cell when running deno kernel in Jupyter? import.meta stuff does not work since it's not a module
1 replies
DDeno
Created by callmephilip on 12/12/2024 in #help
Deno + Jupyter - a couple of hiccups: jupyter execute and tests
First things first, Deno + Jupyter is amazing - kudos to the team. A couple of things that did not work out for me which I would like some more context to understand and try to fix/report on. I've originally reported on them here (https://github.com/rgbkrk/denotebooks/issues/8) and here (https://github.com/rgbkrk/denotebooks/issues/9). jupyter execute fails for certain notebooks Trying to run jupyter execute (e.g. jupyter execute --kernel_name=deno hello.ipynb) on some notebooks fails with the following error (more info: https://github.com/rgbkrk/denotebooks/issues/8):
Traceback (most recent call last):
File "/opt/hostedtoolcache/Python/3.11.10/x64/bin/jupyter-execute", line 8, in <module>
[.........]
line 1103, in process_message
display_id = content.get("transient", {}).get("display_id", None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'
Traceback (most recent call last):
File "/opt/hostedtoolcache/Python/3.11.10/x64/bin/jupyter-execute", line 8, in <module>
[.........]
line 1103, in process_message
display_id = content.get("transient", {}).get("display_id", None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'
tests inside notebooks Failing tests inside notebooks do not cause actual runtime errors but simply print error output. This effectively means that when you run jupyter execute on a notebook, it exits normally instead of reporting an error
import { assert } from "jsr:@std/assert";

Deno.test("failing test", () => {
assert(false);
});
import { assert } from "jsr:@std/assert";

Deno.test("failing test", () => {
assert(false);
});
7 replies