iruby 0.7.3 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +119 -0
- data/CHANGES.md +28 -0
- data/README.md +59 -51
- data/Rakefile +2 -1
- data/exe/iruby +7 -0
- data/ext/Rakefile +19 -0
- data/iruby.gemspec +7 -1
- data/lib/iruby/application.rb +380 -0
- data/lib/iruby/backend.rb +11 -2
- data/lib/iruby/error.rb +12 -0
- data/lib/iruby/jupyter.rb +4 -1
- data/lib/iruby/kernel.rb +4 -2
- data/lib/iruby/kernel_app.rb +108 -0
- data/lib/iruby/logger.rb +12 -2
- data/lib/iruby/session/mixin.rb +1 -1
- data/lib/iruby/session.rb +2 -0
- data/lib/iruby/session_adapter.rb +3 -2
- data/lib/iruby/version.rb +1 -1
- data/test/helper.rb +22 -3
- data/test/integration_test.rb +7 -1
- data/test/iruby/application/application_test.rb +32 -0
- data/test/iruby/application/console_test.rb +97 -0
- data/test/iruby/application/helper.rb +38 -0
- data/test/iruby/application/kernel_test.rb +93 -0
- data/test/iruby/application/register_test.rb +139 -0
- data/test/iruby/application/unregister_test.rb +77 -0
- data/test/iruby/jupyter_test.rb +27 -15
- data/test/iruby/kernel_test.rb +0 -2
- data/test/iruby/multi_logger_test.rb +13 -0
- data/test/iruby/session_adapter_test.rb +0 -28
- data/test/iruby/session_test.rb +0 -4
- data/test/run-test.rb +1 -0
- metadata +57 -15
- data/.github/workflows/ubuntu.yml +0 -69
- data/bin/iruby +0 -5
- data/lib/iruby/command.rb +0 -190
- data/lib/iruby/session_adapter/pyzmq_adapter.rb +0 -77
- data/test/iruby/command_test.rb +0 -207
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e413c79b6abf037b0f2052ee0eed3c5176cdbcce91432330c02a6fabfd1bed2
|
4
|
+
data.tar.gz: c3d551239522d942ef1356f831a48e50bdadc233d0ceb0b8ba3e95a48017902b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e3782105ba5ea49520760220fd88acab086c58600f73be2c74c822be08a7ec094e18e75084ea8bd676486d473f92ad37a40c72b9ebc64325fea1649c40edab3
|
7
|
+
data.tar.gz: 2ed1524ee160602a494192bc3b8734c7f416aa3ae4beb24a3a541852bde3d565938a2ffb43916b4112c7f215cdef1509f1e5326a960b22d213575fa95c3229c6
|
@@ -0,0 +1,119 @@
|
|
1
|
+
name: CI
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
pull_request:
|
6
|
+
types:
|
7
|
+
- opened
|
8
|
+
- synchronize
|
9
|
+
- reopened
|
10
|
+
|
11
|
+
jobs:
|
12
|
+
ubuntu:
|
13
|
+
name: Ubuntu
|
14
|
+
runs-on: ${{ matrix.os }}
|
15
|
+
|
16
|
+
strategy:
|
17
|
+
fail-fast: false
|
18
|
+
matrix:
|
19
|
+
os:
|
20
|
+
- ubuntu-latest
|
21
|
+
ruby:
|
22
|
+
- "3.3"
|
23
|
+
- "3.2"
|
24
|
+
- "3.1"
|
25
|
+
- "3.0"
|
26
|
+
- "2.7"
|
27
|
+
- debug
|
28
|
+
|
29
|
+
steps:
|
30
|
+
- uses: actions/checkout@v4
|
31
|
+
with:
|
32
|
+
fetch-depth: 1
|
33
|
+
|
34
|
+
- uses: ruby/setup-ruby@v1
|
35
|
+
with:
|
36
|
+
ruby-version: ${{ matrix.ruby }}
|
37
|
+
|
38
|
+
- run: rake build
|
39
|
+
|
40
|
+
- name: Install ffi 1.6 for old Ruby
|
41
|
+
if: |
|
42
|
+
matrix.ruby == '2.7'
|
43
|
+
run: |
|
44
|
+
cat <<GEMFILE > Gemfile.irb
|
45
|
+
source 'https://rubygems.org'
|
46
|
+
gem 'ffi', '~> 1.6'
|
47
|
+
GEMFILE
|
48
|
+
BUNDLE_GEMFILE=Gemfile.irb bundle install --jobs 4 --retry 3
|
49
|
+
|
50
|
+
- run: gem install pkg/*.gem
|
51
|
+
|
52
|
+
- run: ruby -r iruby -e "p IRuby::SessionAdapter.select_adapter_class"
|
53
|
+
env:
|
54
|
+
IRUBY_SESSION_ADAPTER: ffi-rzmq
|
55
|
+
|
56
|
+
- name: Install requirements on ubuntu
|
57
|
+
run: |
|
58
|
+
sudo apt update
|
59
|
+
sudo apt install -y --no-install-recommends \
|
60
|
+
libczmq-dev \
|
61
|
+
python3 \
|
62
|
+
python3-pip \
|
63
|
+
python3-setuptools
|
64
|
+
sudo pip3 install wheel
|
65
|
+
sudo pip3 install -r ci/requirements.txt
|
66
|
+
|
67
|
+
- run: bundle install --jobs 4 --retry 3
|
68
|
+
|
69
|
+
- name: Run tests
|
70
|
+
env:
|
71
|
+
PYTHON: python3
|
72
|
+
ADAPTERS: cztop ffi-rzmq
|
73
|
+
run: |
|
74
|
+
for adapter in $ADAPTERS; do
|
75
|
+
export IRUBY_TEST_SESSION_ADAPTER_NAME=$adapter
|
76
|
+
bundle exec rake test TESTOPTS="-v"
|
77
|
+
done
|
78
|
+
|
79
|
+
windows:
|
80
|
+
name: Windows
|
81
|
+
runs-on: windows-latest
|
82
|
+
|
83
|
+
steps:
|
84
|
+
- uses: actions/checkout@v4
|
85
|
+
with:
|
86
|
+
fetch-depth: 1
|
87
|
+
|
88
|
+
- uses: ruby/setup-ruby@v1
|
89
|
+
with:
|
90
|
+
ruby-version: "ruby"
|
91
|
+
|
92
|
+
- run: rake build
|
93
|
+
|
94
|
+
- run: gem install pkg/*.gem
|
95
|
+
|
96
|
+
- run: ruby -r iruby -e "p IRuby::SessionAdapter.select_adapter_class"
|
97
|
+
env:
|
98
|
+
IRUBY_SESSION_ADAPTER: ffi-rzmq
|
99
|
+
|
100
|
+
macos:
|
101
|
+
name: macOS
|
102
|
+
runs-on: macos-latest
|
103
|
+
|
104
|
+
steps:
|
105
|
+
- uses: actions/checkout@v4
|
106
|
+
with:
|
107
|
+
fetch-depth: 1
|
108
|
+
|
109
|
+
- uses: ruby/setup-ruby@v1
|
110
|
+
with:
|
111
|
+
ruby-version: "ruby"
|
112
|
+
|
113
|
+
- run: rake build
|
114
|
+
|
115
|
+
- run: gem install pkg/*.gem
|
116
|
+
|
117
|
+
- run: ruby -r iruby -e "p IRuby::SessionAdapter.select_adapter_class"
|
118
|
+
env:
|
119
|
+
IRUBY_SESSION_ADAPTER: ffi-rzmq
|
data/CHANGES.md
CHANGED
@@ -1,3 +1,31 @@
|
|
1
|
+
# 0.8.0 (2024-07-28)
|
2
|
+
|
3
|
+
* Hide output on assignment by @ankane in https://github.com/SciRuby/iruby/pull/312
|
4
|
+
* Introduce the new Application classes by @mrkn in https://github.com/SciRuby/iruby/pull/317
|
5
|
+
* Fix Gnuplot issues in Ruby 2.7 (#321) by @kojix2 in https://github.com/SciRuby/iruby/pull/322
|
6
|
+
* Add Ruby3.1 to CI by @kojix2 in https://github.com/SciRuby/iruby/pull/323
|
7
|
+
* Update README.md by @marek-witkowski in https://github.com/SciRuby/iruby/pull/324
|
8
|
+
* ci: upgrade actions/checkout by @kojix2 in https://github.com/SciRuby/iruby/pull/325
|
9
|
+
* Add Ruby 3.2 to CI for ubuntu by @petergoldstein in https://github.com/SciRuby/iruby/pull/327
|
10
|
+
* Default to true for `store_history` if not in silent mode by @gartens in https://github.com/SciRuby/iruby/pull/330
|
11
|
+
* Add Ruby 3.3 to CI for Ubuntu by @kojix2 in https://github.com/SciRuby/iruby/pull/331
|
12
|
+
* Remove Ruby 2.3 and 2.4 from CI by @kojix2 in https://github.com/SciRuby/iruby/pull/332
|
13
|
+
* Fix typos by @kojix2 in https://github.com/SciRuby/iruby/pull/335
|
14
|
+
* Format README.md and ci.yml by @kojix2 in https://github.com/SciRuby/iruby/pull/337
|
15
|
+
* Fix PlainBackend for irb v1.13.0 by @zalt50 in https://github.com/SciRuby/iruby/pull/339
|
16
|
+
* Added `date` to header by @ebababi in https://github.com/SciRuby/iruby/pull/342
|
17
|
+
* Update CI Configuration for IRuby by @kojix2 in https://github.com/SciRuby/iruby/pull/344
|
18
|
+
* Add logger and Remove base64 to Fix CI Tests by @kojix2 in https://github.com/SciRuby/iruby/pull/345
|
19
|
+
* Update CI trigger configuration by @kojix2 in https://github.com/SciRuby/iruby/pull/346
|
20
|
+
|
21
|
+
# 0.7.4 (2021-08-18)
|
22
|
+
|
23
|
+
## Enhancements
|
24
|
+
|
25
|
+
* Install zeromq library automatically https://github.com/SciRuby/iruby/pull/307, https://github.com/SciRuby/iruby/pull/308 (@mrkn, @kou)
|
26
|
+
* Remove pyzmq session adapter (@mrkn)
|
27
|
+
* Make cztop session adapter deprecated (@mrkn)
|
28
|
+
|
1
29
|
# 0.7.3 (2021-07-08)
|
2
30
|
|
3
31
|
## Bug Fixes
|
data/README.md
CHANGED
@@ -10,78 +10,74 @@ IRuby is a Ruby kernel for [Jupyter project](http://try.jupyter.org/).
|
|
10
10
|
|
11
11
|
You can try IRuby with a sample notebook on Binder (the same link as the banner placed above):
|
12
12
|
|
13
|
-
https://mybinder.org/v2/gh/RubyData/binder/master?filepath=ruby-data.ipynb
|
13
|
+
<https://mybinder.org/v2/gh/RubyData/binder/master?filepath=ruby-data.ipynb>
|
14
14
|
|
15
15
|
The following URL launches JupyterLab directly on Binder.
|
16
16
|
|
17
|
-
https://mybinder.org/v2/gh/RubyData/binder/master?filepath=../lab
|
17
|
+
<https://mybinder.org/v2/gh/RubyData/binder/master?filepath=../lab>
|
18
18
|
|
19
19
|
## Installation
|
20
20
|
|
21
21
|
### Requirements
|
22
22
|
|
23
23
|
* [Jupyter](https://jupyter.org)
|
24
|
-
* One of the following is required
|
25
|
-
* [ffi-rzmq](https://github.com/chuckremes/ffi-rzmq) and [libzmq](https://github.com/zeromq/libzmq)
|
26
|
-
* [CZTop](https://gitlab.com/paddor/cztop) and [CZMQ](https://github.com/zeromq/czmq)
|
27
24
|
|
28
|
-
|
25
|
+
The following requirements are automatically installed.
|
29
26
|
|
30
|
-
|
31
|
-
|
32
|
-
|
27
|
+
* [ffi-rzmq](https://github.com/chuckremes/ffi-rzmq)
|
28
|
+
* [libzmq](https://github.com/zeromq/libzmq)
|
29
|
+
|
30
|
+
The following dependencies are optional.
|
33
31
|
|
34
32
|
* [Pry][Pry], if you want to use [Pry][Pry] instead of IRB for the code execution backend
|
35
|
-
* If you want to install the development version of IRuby from the source code, try [specific_install](https://github.com/rdp/specific_install).
|
36
33
|
|
37
|
-
|
38
|
-
gem specific_install https://github.com/SciRuby/iruby
|
39
|
-
```
|
34
|
+
### Installing Jupyter Notebook and/or JupyterLab
|
40
35
|
|
41
|
-
|
36
|
+
See the official document to know how to install Jupyter Notebook and/or JupyterLab.
|
42
37
|
|
43
|
-
|
38
|
+
* <https://jupyter.readthedocs.io/en/latest/install/notebook-classic.html>
|
39
|
+
* <https://jupyter.readthedocs.io/en/latest/install.html>
|
40
|
+
|
41
|
+
### Ubuntu
|
44
42
|
|
45
43
|
#### Ubuntu 17+
|
46
44
|
|
47
45
|
```shell
|
48
46
|
sudo apt install libtool libffi-dev ruby ruby-dev make
|
49
|
-
sudo apt install libzmq3-dev libczmq-dev
|
50
47
|
|
51
|
-
gem install
|
52
|
-
gem install iruby --pre
|
48
|
+
gem install --user-install iruby
|
53
49
|
iruby register --force
|
54
50
|
```
|
55
51
|
|
56
52
|
#### Ubuntu 16
|
57
53
|
|
58
|
-
|
54
|
+
The latest IRuby requires Ruby >= 2.4 while Ubuntu's official Ruby package is version 2.3.
|
55
|
+
So you need to install Ruby >= 2.4 by yourself before preparing IRuby.
|
56
|
+
We recommend to use rbenv.
|
59
57
|
|
60
58
|
```shell
|
61
59
|
sudo apt install libtool libffi-dev ruby ruby-dev make
|
62
|
-
|
63
|
-
git clone https://github.com/zeromq/czmq
|
64
|
-
cd czmq
|
65
|
-
./autogen.sh && ./configure && sudo make && sudo make install
|
66
|
-
|
67
|
-
gem install cztop
|
68
|
-
gem install iruby --pre
|
60
|
+
gem install --user-install iruby
|
69
61
|
iruby register --force
|
70
62
|
```
|
71
63
|
|
72
|
-
###
|
64
|
+
### Fedora
|
73
65
|
|
74
|
-
|
75
|
-
[DevKit](https://rubyinstaller.org/add-ons/devkit.html) is necessary for building RubyGems with native C-based extensions.
|
66
|
+
#### Fedora 36
|
76
67
|
|
77
|
-
Install ZeroMQ.
|
78
68
|
```shell
|
79
|
-
|
69
|
+
sudo dnf install ruby ruby-dev make zeromq-devel
|
70
|
+
|
71
|
+
gem install --user-install iruby
|
72
|
+
iruby register --force
|
80
73
|
```
|
81
74
|
|
75
|
+
### Windows
|
76
|
+
|
77
|
+
[DevKit](https://rubyinstaller.org/add-ons/devkit.html) is necessary for building RubyGems with native C-based extensions.
|
78
|
+
|
82
79
|
```shell
|
83
|
-
gem install
|
84
|
-
gem install iruby --pre
|
80
|
+
gem install iruby
|
85
81
|
iruby register --force
|
86
82
|
```
|
87
83
|
|
@@ -93,17 +89,7 @@ Install Jupyter.
|
|
93
89
|
#### Homebrew
|
94
90
|
|
95
91
|
```shell
|
96
|
-
|
97
|
-
brew install zeromq --HEAD
|
98
|
-
brew install czmq --HEAD
|
99
|
-
```
|
100
|
-
|
101
|
-
```shell
|
102
|
-
# export LIBZMQ_PATH=$(brew --prefix zeromq)/lib
|
103
|
-
# export LIBCZMQ_PATH=$(brew --prefix czmq)/lib
|
104
|
-
# gem install cztop
|
105
|
-
gem install ffi-rzmq
|
106
|
-
gem install iruby --pre
|
92
|
+
gem install iruby
|
107
93
|
iruby register --force
|
108
94
|
```
|
109
95
|
|
@@ -113,17 +99,17 @@ If you are using macports, run the following commands.
|
|
113
99
|
|
114
100
|
```shell
|
115
101
|
port install libtool autoconf automake autogen
|
116
|
-
gem install ffi-rzmq
|
117
102
|
gem install iruby
|
103
|
+
iruby register --force
|
118
104
|
```
|
119
105
|
|
120
106
|
### Docker
|
121
107
|
|
122
|
-
Try [RubyData Docker Stacks](https://github.com/RubyData/docker-stacks).
|
108
|
+
Try [RubyData Docker Stacks](https://github.com/RubyData/docker-stacks).
|
123
109
|
Running jupyter notebook:
|
124
110
|
|
125
111
|
```shell
|
126
|
-
docker run -p 8888:8888 rubydata/datascience-notebook
|
112
|
+
docker run --rm -it -p 8888:8888 rubydata/datascience-notebook
|
127
113
|
```
|
128
114
|
|
129
115
|
### Installation for JRuby
|
@@ -131,13 +117,12 @@ docker run -p 8888:8888 rubydata/datascience-notebook
|
|
131
117
|
You can use Java classes in your IRuby notebook.
|
132
118
|
|
133
119
|
* JRuby version >= 9.0.4.0
|
134
|
-
* cztop gem
|
135
120
|
* iruby gem
|
136
121
|
|
137
122
|
After installation, make sure that your `env` is set up to use jruby.
|
138
123
|
|
139
124
|
```shell
|
140
|
-
|
125
|
+
env ruby -v
|
141
126
|
```
|
142
127
|
|
143
128
|
If you use RVM, it is enough to switch the current version to jruby.
|
@@ -145,7 +130,30 @@ If you use RVM, it is enough to switch the current version to jruby.
|
|
145
130
|
If you have already used IRuby with a different version, you need to generate a new kernel:
|
146
131
|
|
147
132
|
```shell
|
148
|
-
|
133
|
+
iruby register --force
|
134
|
+
```
|
135
|
+
|
136
|
+
### Install the development version of IRuby
|
137
|
+
|
138
|
+
**Be careful to use the development version because it is usually unstable.**
|
139
|
+
|
140
|
+
If you want to install the development version of IRuby from the source code, try [specific_install](https://github.com/rdp/specific_install).
|
141
|
+
|
142
|
+
```
|
143
|
+
gem specific_install https://github.com/SciRuby/iruby
|
144
|
+
```
|
145
|
+
|
146
|
+
### Note for using with CZTop and CZMQ
|
147
|
+
|
148
|
+
[CZTop](https://gitlab.com/paddor/cztop) adapter has been deprecated since IRuby version 0.7.4.
|
149
|
+
It will be removed after several versions.
|
150
|
+
|
151
|
+
If you want to use IRuby with CZTop, you need to install it and [CZMQ](https://github.com/zeromq/czmq).
|
152
|
+
|
153
|
+
If both ffi-rzmq and cztop are installed, ffi-rzmq is used. If you prefer cztop, set the following environment variable.
|
154
|
+
|
155
|
+
```sh
|
156
|
+
export IRUBY_SESSION_ADAPTER="cztop"
|
149
157
|
```
|
150
158
|
|
151
159
|
## Backends
|
@@ -173,7 +181,7 @@ Contributions to IRuby are very welcome.
|
|
173
181
|
|
174
182
|
To former contributors
|
175
183
|
|
176
|
-
In February 2021, [IRuby became the canonical repository](https://github.com/SciRuby/iruby/issues/285) and is no longer a fork from [minrk/iruby](https://github.com/minrk/iruby). Please fork from this repository again before making pull requests.
|
184
|
+
In February 2021, [IRuby became the canonical repository](https://github.com/SciRuby/iruby/issues/285) and is no longer a fork from [minrk/iruby](https://github.com/minrk/iruby). Please fork from this repository again before making pull requests.
|
177
185
|
|
178
186
|
## License
|
179
187
|
|
data/Rakefile
CHANGED
data/exe/iruby
ADDED
data/ext/Rakefile
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
task default: :all
|
2
|
+
|
3
|
+
task all: [:ensure_zeromq]
|
4
|
+
|
5
|
+
task :ensure_zeromq do
|
6
|
+
begin
|
7
|
+
require 'ffi-rzmq'
|
8
|
+
rescue LoadError
|
9
|
+
require 'native-package-installer'
|
10
|
+
unless NativePackageInstaller.install(arch_linux: 'zeromq',
|
11
|
+
debian: 'libzmq3-dev',
|
12
|
+
freebsd: 'libzmq4',
|
13
|
+
homebrew: 'zmq',
|
14
|
+
macports: 'zmq',
|
15
|
+
redhat: 'zeromq-devel')
|
16
|
+
raise 'Failed to install ZeroMQ'
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/iruby.gemspec
CHANGED
@@ -11,20 +11,26 @@ Gem::Specification.new do |s|
|
|
11
11
|
s.license = 'MIT'
|
12
12
|
|
13
13
|
s.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
|
14
|
-
s.
|
14
|
+
s.bindir = "exe"
|
15
|
+
s.executables = %w[iruby]
|
15
16
|
s.test_files = s.files.grep(%r{^test/})
|
16
17
|
s.require_paths = %w[lib]
|
18
|
+
s.extensions = %w[ext/Rakefile]
|
17
19
|
|
18
20
|
s.required_ruby_version = '>= 2.3.0'
|
19
21
|
|
20
22
|
s.add_dependency 'data_uri', '~> 0.1'
|
21
23
|
s.add_dependency 'ffi-rzmq'
|
22
24
|
s.add_dependency 'irb'
|
25
|
+
s.add_dependency 'logger'
|
23
26
|
s.add_dependency 'mime-types', '>= 3.3.1'
|
24
27
|
s.add_dependency 'multi_json', '~> 1.11'
|
28
|
+
s.add_dependency 'native-package-installer'
|
25
29
|
|
26
30
|
s.add_development_dependency 'pycall', '>= 1.2.1'
|
27
31
|
s.add_development_dependency 'rake'
|
28
32
|
s.add_development_dependency 'test-unit'
|
29
33
|
s.add_development_dependency 'test-unit-rr'
|
34
|
+
|
35
|
+
s.metadata['msys2_mingw_dependencies'] = 'zeromq'
|
30
36
|
end
|