Skip to content

Commit

Permalink
Merge pull request #89 from janpfeifer/newdeps
Browse files Browse the repository at this point in the history
New dependencies
  • Loading branch information
janpfeifer authored Jan 23, 2024
2 parents d425623 + afedc84 commit 73aec64
Show file tree
Hide file tree
Showing 19 changed files with 89 additions and 133 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ You need to install (if not yet there), **GoNB**, `goimports` and `gopls` (for a
```bash
go install github.com/janpfeifer/gonb@latest && \
go install golang.org/x/tools/cmd/goimports@latest && \
go install golang.org/x/tools/gopls@latest && \
go install golang.org/x/tools/gopls@latest
```

And if `GOBIN` is in your `PATH`, run the following to install **GoNB** as a kernel in the Jupyter configuration
Expand Down
16 changes: 13 additions & 3 deletions cmd/nbexec/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
The saved notebook can then be used by `nbconvert` and converted to various formats (html, text, pdf, etc.).

It requires Jupyter Notebook and optionally `nbconvert` and `pandoc` installed.
Typically, in Ubuntu, with `sudo apt install pandoc` and `pip install notebook nbconvert`.

Typically, in Ubuntu, with `sudo apt install pandoc` and `pip install jupyterlab notebook nbconvert`.
But it may vary on different systems.

## How to use it?
Expand Down Expand Up @@ -42,8 +43,17 @@ It also compiles everything with `--coverage` to get full coverage report in the

## How to install it?

Using Go package manager (see details in [Go tutorial](https://go.dev/doc/tutorial/compile-install)).
It will install in the directory `GOBIN` (try `go env GOBIN` to find it if not set), that should be in your `PATH`.
Using Go package manager `go install github.com/janpfeifer/gonb/cmd/nbexec@latest`.
It will install in the directory `GOBIN` (try `go env GOBIN` to find it if not set), that should be in your `PATH`.

It requires Jupyter Notebook and optionally `nbconvert` and `pandoc` installed.

Typically, in Ubuntu, with `sudo apt install pandoc` and `pip install notebook nbconvert`.
But it may vary on different systems.


You will need the following
`sudo apt install pandoc` and `pip install notebook nbconvert`.

```bash
go install github.com/janpfeifer/gonb/cmd/nbexec
Expand Down
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

* Fixed some typos in klog formatting.
* Updated dependencies.
* Updated gopls dependencies: new jsonrpc2 API.

## 0.9.5, 2023/01/10

Expand Down
15 changes: 4 additions & 11 deletions docs/coverage.txt
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ github.com/janpfeifer/gonb/internal/comms/namedpipes.go *State.ProgramSubscrib
github.com/janpfeifer/gonb/internal/comms/namedpipes.go *State.ProgramUnsubscribeRequest 57.1%
github.com/janpfeifer/gonb/internal/comms/namedpipes.go *State.deliverProgramSubscriptionsLocked 62.5%
github.com/janpfeifer/gonb/internal/dispatcher/comms.go handleComms 55.6%
github.com/janpfeifer/gonb/internal/dispatcher/dispatcher.go RunKernel 80.0%
github.com/janpfeifer/gonb/internal/dispatcher/dispatcher.go RunKernel 77.1%
github.com/janpfeifer/gonb/internal/dispatcher/dispatcher.go handleShellMsg 71.0%
github.com/janpfeifer/gonb/internal/dispatcher/dispatcher.go handleBusyMessage 47.8%
github.com/janpfeifer/gonb/internal/dispatcher/dispatcher.go handleShutdownRequest 83.3%
Expand Down Expand Up @@ -275,7 +275,7 @@ github.com/janpfeifer/gonb/internal/goexec/wasm.go *State.RemoveWasmConstants
github.com/janpfeifer/gonb/internal/goexec/goplsclient/conn.go *Client.ConnClose 0.0%
github.com/janpfeifer/gonb/internal/goexec/goplsclient/conn.go *Client.connCloseLocked 100.0%
github.com/janpfeifer/gonb/internal/goexec/goplsclient/conn.go minTimeout 100.0%
github.com/janpfeifer/gonb/internal/goexec/goplsclient/conn.go *Client.Connect 64.3%
github.com/janpfeifer/gonb/internal/goexec/goplsclient/conn.go *Client.Connect 63.4%
github.com/janpfeifer/gonb/internal/goexec/goplsclient/conn.go *Client.NotifyDidOpenOrChange 0.0%
github.com/janpfeifer/gonb/internal/goexec/goplsclient/conn.go *Client.notifyDidOpenOrChangeLocked 0.0%
github.com/janpfeifer/gonb/internal/goexec/goplsclient/conn.go *Client.CallDefinition 0.0%
Expand All @@ -285,15 +285,8 @@ github.com/janpfeifer/gonb/internal/goexec/goplsclient/conn.go *Client.callHove
github.com/janpfeifer/gonb/internal/goexec/goplsclient/conn.go *Client.CallComplete 0.0%
github.com/janpfeifer/gonb/internal/goexec/goplsclient/conn.go *Client.callCompleteLocked 0.0%
github.com/janpfeifer/gonb/internal/goexec/goplsclient/conn.go *Client.ConsumeMessages 0.0%
github.com/janpfeifer/gonb/internal/goexec/goplsclient/conn.go trimString 100.0%
github.com/janpfeifer/gonb/internal/goexec/goplsclient/conn.go *jsonrpc2Handler.Deliver 45.2%
github.com/janpfeifer/gonb/internal/goexec/goplsclient/conn.go *jsonrpc2Handler.Cancel 0.0%
github.com/janpfeifer/gonb/internal/goexec/goplsclient/conn.go *jsonrpc2Handler.Request 100.0%
github.com/janpfeifer/gonb/internal/goexec/goplsclient/conn.go *jsonrpc2Handler.Response 100.0%
github.com/janpfeifer/gonb/internal/goexec/goplsclient/conn.go *jsonrpc2Handler.Done 0.0%
github.com/janpfeifer/gonb/internal/goexec/goplsclient/conn.go *jsonrpc2Handler.Read 100.0%
github.com/janpfeifer/gonb/internal/goexec/goplsclient/conn.go *jsonrpc2Handler.Write 100.0%
github.com/janpfeifer/gonb/internal/goexec/goplsclient/conn.go *jsonrpc2Handler.Error 0.0%
github.com/janpfeifer/gonb/internal/goexec/goplsclient/conn.go trimString 66.7%
github.com/janpfeifer/gonb/internal/goexec/goplsclient/conn.go *Client.Handler 44.4%
github.com/janpfeifer/gonb/internal/goexec/goplsclient/exec.go *Client.Start 79.6%
github.com/janpfeifer/gonb/internal/goexec/goplsclient/exec.go *Client.Stop 0.0%
github.com/janpfeifer/gonb/internal/goexec/goplsclient/exec.go *Client.WaitConnection 0.0%
Expand Down
6 changes: 3 additions & 3 deletions examples/tests/bash_script.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"/tmp/gonb_837c6ea0\n"
"/tmp/gonb_2f6c813c\n"
]
}
],
Expand All @@ -59,7 +59,7 @@
"output_type": "stream",
"text": [
"/home/janpf/Projects/gonb/examples/tests\n",
"/tmp/gonb_837c6ea0\n",
"/tmp/gonb_2f6c813c\n",
"/home/janpf/Projects/gonb\n",
"/home/janpf/Projects/gonb\n"
]
Expand All @@ -86,7 +86,7 @@
"name": "go",
"nbconvert_exporter": "",
"pygments_lexer": "",
"version": "go1.21.2"
"version": "go1.21.6"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion examples/tests/comms.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@
"name": "go",
"nbconvert_exporter": "",
"pygments_lexer": "",
"version": "go1.21.2"
"version": "go1.21.6"
}
},
"nbformat": 4,
Expand Down
6 changes: 3 additions & 3 deletions examples/tests/dom.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
{
"data": {
"text/html": [
"<div id=\"dom.transient_div_f3fe66f0\"></div>"
"<div id=\"dom.transient_div_daab7823\"></div>"
]
},
"metadata": {},
Expand Down Expand Up @@ -152,7 +152,7 @@
{
"data": {
"text/html": [
"<div id=\"dom.transient_div_33c02577\"></div>"
"<div id=\"dom.transient_div_e607ce12\"></div>"
]
},
"metadata": {},
Expand Down Expand Up @@ -197,7 +197,7 @@
"name": "go",
"nbconvert_exporter": "",
"pygments_lexer": "",
"version": "go1.21.2"
"version": "go1.21.6"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion examples/tests/functions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"name": "go",
"nbconvert_exporter": "",
"pygments_lexer": "",
"version": "go1.21.2"
"version": "go1.21.6"
}
},
"nbformat": 4,
Expand Down
10 changes: 5 additions & 5 deletions examples/tests/goflags.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,9 @@
"name": "stdout",
"output_type": "stream",
"text": [
"gonb_4d618e3d/main.go:8:\tA\t\t100.0%\n",
"gonb_4d618e3d/main.go:12:\tB\t\t0.0%\n",
"gonb_4d618e3d/main.go:17:\tmain\t\t100.0%\n",
"gonb_020f1df5/main.go:8:\tA\t\t100.0%\n",
"gonb_020f1df5/main.go:12:\tB\t\t0.0%\n",
"gonb_020f1df5/main.go:17:\tmain\t\t100.0%\n",
"total\t\t\t\t(statements)\t75.0%\n"
]
}
Expand Down Expand Up @@ -238,7 +238,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"# gonb_4d618e3d\n",
"# gonb_020f1df5\n",
"./main.go:10:6: can inline (*Point).ManhattanLen\n",
"./main.go:16:12: inlining call to flag.Parse\n",
"./main.go:18:28: inlining call to (*Point).ManhattanLen\n",
Expand Down Expand Up @@ -267,7 +267,7 @@
"name": "go",
"nbconvert_exporter": "",
"pygments_lexer": "",
"version": "go1.21.2"
"version": "go1.21.6"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions examples/tests/gonbui.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"output_type": "stream",
"text": [
"%goflags=[\"--cover\" \"--covermode=set\"]\n",
"GOCOVERDIR=/tmp/gonb_test_coverage.evu1EyPOAK\n"
"GOCOVERDIR=/tmp/gonb_test_coverage.4btcckxYms\n"
]
}
],
Expand Down Expand Up @@ -133,7 +133,7 @@
"name": "go",
"nbconvert_exporter": "",
"pygments_lexer": "",
"version": "go1.21.2"
"version": "go1.21.6"
}
},
"nbformat": 4,
Expand Down
14 changes: 7 additions & 7 deletions examples/tests/gotest.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -287,12 +287,12 @@
"text": [
"goos: linux\n",
"goarch: amd64\n",
"pkg: gonb_78907e80\n",
"pkg: gonb_ce0aec45\n",
"cpu: 12th Gen Intel(R) Core(TM) i9-12900K\n",
"BenchmarkFibonacciA32\n",
"BenchmarkFibonacciA32-24 \t 177\t 6765530 ns/op\n",
"BenchmarkFibonacciA32-24 \t 157\t 7665168 ns/op\n",
"BenchmarkFibonacciB32\n",
"BenchmarkFibonacciB32-24 \t339602953\t 3.459 ns/op\n",
"BenchmarkFibonacciB32-24 \t298868374\t 3.914 ns/op\n",
"PASS\n",
"coverage: [no statements]\n"
]
Expand Down Expand Up @@ -334,10 +334,10 @@
"text": [
"goos: linux\n",
"goarch: amd64\n",
"pkg: gonb_78907e80\n",
"pkg: gonb_ce0aec45\n",
"cpu: 12th Gen Intel(R) Core(TM) i9-12900K\n",
"BenchmarkFibonacciA32-24 \t 178\t 6716775 ns/op\n",
"BenchmarkFibonacciB32-24 \t355028996\t 3.429 ns/op\n",
"BenchmarkFibonacciA32-24 \t 156\t 7601541 ns/op\n",
"BenchmarkFibonacciB32-24 \t302442891\t 3.894 ns/op\n",
"PASS\n",
"coverage: [no statements]\n"
]
Expand All @@ -361,7 +361,7 @@
"name": "go",
"nbconvert_exporter": "",
"pygments_lexer": "",
"version": "go1.21.2"
"version": "go1.21.6"
}
},
"nbformat": 4,
Expand Down
18 changes: 9 additions & 9 deletions examples/tests/gowork.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"/tmp/gonb_tests_gowork_vCANAyfN"
"/tmp/gonb_tests_gowork_6mPoRnnx"
]
}
],
Expand Down Expand Up @@ -64,7 +64,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Temporary test package: /tmp/gonb_tests_gowork_vCANAyfN\n"
"Temporary test package: /tmp/gonb_tests_gowork_6mPoRnnx\n"
]
}
],
Expand Down Expand Up @@ -136,7 +136,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"\t- Added replace rule for module \"a.com/a/pkg\" to local directory \"/tmp/gonb_tests_gowork_vCANAyfN\".\n"
"\t- Added replace rule for module \"a.com/a/pkg\" to local directory \"/tmp/gonb_tests_gowork_6mPoRnnx\".\n"
]
}
],
Expand All @@ -155,9 +155,9 @@
"name": "stdout",
"output_type": "stream",
"text": [
"module gonb_1cb4210b\n",
"module gonb_19fe2324\n",
"\n",
"go 1.21.2\n",
"go 1.21.6\n",
"\n",
"replace a.com/a/pkg => TMP_PKG\n"
]
Expand Down Expand Up @@ -186,7 +186,7 @@
"text/html": [
"<b>List of files/directories being tracked:</b>\n",
"<ul>\n",
"<li>/tmp/gonb_tests_gowork_vCANAyfN</li>\n",
"<li>/tmp/gonb_tests_gowork_6mPoRnnx</li>\n",
"</ul>\n"
]
},
Expand All @@ -208,9 +208,9 @@
"name": "stdout",
"output_type": "stream",
"text": [
"module gonb_1cb4210b\n",
"module gonb_19fe2324\n",
"\n",
"go 1.21.2\n"
"go 1.21.6\n"
]
}
],
Expand Down Expand Up @@ -280,7 +280,7 @@
"name": "go",
"nbconvert_exporter": "",
"pygments_lexer": "",
"version": "go1.21.2"
"version": "go1.21.6"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion examples/tests/hello.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"name": "go",
"nbconvert_exporter": "",
"pygments_lexer": "",
"version": "go1.21.2"
"version": "go1.21.6"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion examples/tests/init.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
"name": "go",
"nbconvert_exporter": "",
"pygments_lexer": "",
"version": "go1.21.2"
"version": "go1.21.6"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions examples/tests/input_boxes.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"output_type": "stream",
"text": [
"%goflags=[\"--cover\" \"--covermode=set\"]\n",
"GOCOVERDIR=/tmp/gonb_nbtests_gocoverdir_3088752991\n"
"GOCOVERDIR=/tmp/gonb_test_coverage.4btcckxYms\n"
]
}
],
Expand Down Expand Up @@ -196,7 +196,7 @@
"name": "go",
"nbconvert_exporter": "",
"pygments_lexer": "",
"version": "go1.21.5"
"version": "go1.21.6"
}
},
"nbformat": 4,
Expand Down
8 changes: 4 additions & 4 deletions examples/tests/widgets.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
{
"data": {
"text/html": [
"<div id=\"dom.transient_div_f1ee9e43\"></div>"
"<div id=\"dom.transient_div_d906e85f\"></div>"
]
},
"metadata": {},
Expand Down Expand Up @@ -189,7 +189,7 @@
{
"data": {
"text/html": [
"<div id=\"dom.transient_div_bafc9bf5\"></div>"
"<div id=\"dom.transient_div_25dd0c8e\"></div>"
]
},
"metadata": {},
Expand Down Expand Up @@ -304,7 +304,7 @@
{
"data": {
"text/html": [
"<div id=\"dom.transient_div_b760e196\"></div>"
"<div id=\"dom.transient_div_71edbbb5\"></div>"
]
},
"metadata": {},
Expand Down Expand Up @@ -416,7 +416,7 @@
"name": "go",
"nbconvert_exporter": "",
"pygments_lexer": "",
"version": "go1.21.2"
"version": "go1.21.6"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion examples/tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2060,7 +2060,7 @@
"name": "go",
"nbconvert_exporter": "",
"pygments_lexer": "",
"version": "go1.21.2"
"version": "go1.21.6"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 73aec64

Please sign in to comment.