Skip to content

Commit 587d408

Browse files
#52 Fix homebrew installation (#62)
1 parent 071d3c7 commit 587d408

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

.github/workflows/release.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,35 +32,41 @@ jobs:
3232
with:
3333
homebrew_owner: dflib
3434
homebrew_tap: homebrew-tap
35-
version: ${{ github.ref_name }}
3635
depends_on: |
37-
"jupyterlab"
36+
"jupyterlab" => :test
3837
"expect" => :test
3938
target: jjava-${{ github.ref_name }}-kernelspec.zip
4039
install: |
4140
libexec.install Dir["*.jar"]
4241
config = buildpath/"kernel.json"
4342
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
4553
test: |
4654
jupyter = Formula["jupyterlab"].opt_bin/"jupyter"
55+
ENV["JUPYTER_PATH"] = share/"jupyter"
4756
assert_match " java ", shell_output("#{jupyter} kernelspec list")
4857
4958
(testpath/"console.exp").write <<~EOS
5059
spawn #{jupyter} console --kernel=java
5160
expect -timeout 30 "In "
52-
send "System.out.println(\\\"Hello world!\\\");\r"
61+
send {System.out.println("Hello world!");\r}
5362
expect -timeout 10 "In "
5463
send "\u0004"
5564
expect -timeout 10 "exit"
5665
send "y\r"
57-
EOS
66+
EOS
5867
output = shell_output("expect -f console.exp")
5968
assert_match "JJava kernel #{version}", output
6069
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.
6470
update_readme_table: true
6571
github_token: ${{ secrets.HOMEBREW_RELEASE_ACCESS_TOKEN }}
6672
debug: ${{ runner.debug }}

0 commit comments

Comments
 (0)