@@ -32,35 +32,41 @@ jobs:
32
32
with :
33
33
homebrew_owner : dflib
34
34
homebrew_tap : homebrew-tap
35
- version : ${{ github.ref_name }}
36
35
depends_on : |
37
- "jupyterlab"
36
+ "jupyterlab" => :test
38
37
"expect" => :test
39
38
target : jjava-${{ github.ref_name }}-kernelspec.zip
40
39
install : |
41
40
libexec.install Dir["*.jar"]
42
41
config = buildpath/"kernel.json"
43
42
inreplace config, "{resource_dir}", libexec
44
- system "jupyter kernelspec install #{buildpath} --config=#{config} --sys-prefix --name=java"
43
+ (share/"jupyter/kernels/java").install config
44
+ caveats : |
45
+ kernel_path = share/"jupyter"
46
+ <<~EOS
47
+ The installation of the Homebrew package takes place in an isolated environment, so ensure JJava visibility by running:
48
+ echo 'export JUPYTER_PATH="#{kernel_path}:$JUPYTER_PATH"' >> ~/.zshrc; source ~/.zshrc (macOS)
49
+ echo 'export JUPYTER_PATH="#{kernel_path}:$JUPYTER_PATH"' >> ~/.bashrc; source ~/.bashrc (Linux)
50
+ Although JJava doesn't depend on java, it requires jre>=11 to run.
51
+ Make sure you have one in your PATH.
52
+ EOS
45
53
test : |
46
54
jupyter = Formula["jupyterlab"].opt_bin/"jupyter"
55
+ ENV["JUPYTER_PATH"] = share/"jupyter"
47
56
assert_match " java ", shell_output("#{jupyter} kernelspec list")
48
57
49
58
(testpath/"console.exp").write <<~EOS
50
59
spawn #{jupyter} console --kernel=java
51
60
expect -timeout 30 "In "
52
- send " System.out.println(\\\ "Hello world!\\\ ");\r"
61
+ send { System.out.println("Hello world!");\r}
53
62
expect -timeout 10 "In "
54
63
send "\u0004"
55
64
expect -timeout 10 "exit"
56
65
send "y\r"
57
- EOS
66
+ EOS
58
67
output = shell_output("expect -f console.exp")
59
68
assert_match "JJava kernel #{version}", output
60
69
assert_match "Hello world!", output
61
- caveats : |
62
- Although JJava doesn't depend on java, it requires jre>=11 to run.
63
- Make sure you have one in your PATH.
64
70
update_readme_table : true
65
71
github_token : ${{ secrets.HOMEBREW_RELEASE_ACCESS_TOKEN }}
66
72
debug : ${{ runner.debug }}
0 commit comments