Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RBS files to Ruby #12844

Merged
merged 22 commits into from
Nov 20, 2023
Merged

Add RBS files to Ruby #12844

merged 22 commits into from
Nov 20, 2023

Conversation

aguspe
Copy link
Contributor

@aguspe aguspe commented Sep 30, 2023

Description

I created RBS files for the following classes and modules so far:

  • AbstractEventListener
  • ActionBuilder
  • Atoms
  • Bridge
  • Chrome
  • Chromium::Features
  • Driver
  • Element
  • Edge
  • Edge::Features
  • Firefox
  • Firefox::Features
  • HasCasting
  • HasLaunching
  • InputDevice
  • Interaction
  • Logger
  • KeyActions
  • KeyInput
  • Manager
  • Navigation
  • PointerActions
  • PointerInput
  • Remote
  • Response
  • Safari
  • Safari::Features
  • ScrollOrigin
  • SearchContext
  • ShadowRoot
  • TakesScreenshot
  • TargetLocator
  • Timeouts
  • TypingInteracton
  • Version
  • VirtualAuthenticator
  • Webdriver
  • WheelInput

Also, I added support for steep: https://github.com/soutaro/steep

You can run the following to do the type check:
steep check

This PR is the first one of multiple PRs adding support for RBS and type check to the ruby library.

Motivation and Context

Ruby Selenium does a lot of meta-programming which makes it more difficult to use with an IDE like RubyMine.
Adding rbs files, *should make this much easier.

More information and further discussion can be found here: #10943

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@CLAassistant
Copy link

CLAassistant commented Sep 30, 2023

CLA assistant check
All committers have signed the CLA.

@aguspe aguspe marked this pull request as draft September 30, 2023 13:13
@titusfortner
Copy link
Member

Hey, how is it going with this? We don't have to do it all in one go if you don't want; it might be easier to ensure it is all rebased properly. Just mark it as out of draft when you're ready for us to pull something. I'm not familiar yet with these files, but I'm looking forward to using them. Thanks.

@codecov-commenter
Copy link

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (1fa0af4) 56.51% compared to head (5b11216) 56.51%.
Report is 84 commits behind head on trunk.

❗ Current head 5b11216 differs from pull request most recent head 820a474. Consider uploading reports for the commit 820a474 to get more accurate results

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##            trunk   #12844   +/-   ##
=======================================
  Coverage   56.51%   56.51%           
=======================================
  Files          86       86           
  Lines        5255     5255           
  Branches      187      187           
=======================================
  Hits         2970     2970           
  Misses       2098     2098           
  Partials      187      187           
Files Coverage Δ
py/selenium/__init__.py 100.00% <100.00%> (ø)
py/selenium/webdriver/common/service.py 88.70% <100.00%> (ø)
py/selenium/webdriver/common/selenium_manager.py 57.89% <75.00%> (ø)
py/selenium/webdriver/common/bidi/cdp.py 22.64% <0.00%> (ø)
py/selenium/webdriver/remote/remote_connection.py 53.87% <0.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@aguspe
Copy link
Contributor Author

aguspe commented Oct 16, 2023

Hey, how is it going with this? We don't have to do it all in one go if you don't want to; it might be easier to ensure it is all rebased properly. Just mark it as out of draft when you're ready for us to pull something. I'm not familiar yet with these files, but I'm looking forward to using them. Thanks.

Hey, it's slowly but surely going, it would definitely be easier to review and test to make smaller PRs.
What I can do is finish with the last files that I'm missing
(Every time I want to add support for a type based on a class I need to create the RBS file for that class, so I'm missing a couple)

I can wrap it up this weekend and prepare it for review and merge.

For now, I created small commits that I will squash afterward just to make the development on the draft easy to follow.

@titusfortner
Copy link
Member

titusfortner commented Oct 16, 2023

what library is needed to use it?
I think we want to add a dev dependency for our tests and make sure the files are working?
Like, we don't change the test code, it is just going to throw an error if the typing is wrong and the user is using that library?

@aguspe
Copy link
Contributor Author

aguspe commented Oct 16, 2023

what library is needed to use it? I think we want to add a dev dependency for our tests and make sure the files are working? Like, we don't change the test code, it is just going to throw an error if the typing is wrong and the user is using that library?

I think steep is the best option, I added a local steep file that I did not commit yet since I'm still testing the config.
Here is the Github to Steep: https://github.com/soutaro/steep, it's well-maintained and it's really simple to use.

I will add to the description of this PR and update the docs on how to use steep, but pretty much once that you have the config you just need to run 'steep check' and that's it

@titusfortner
Copy link
Member

So we can put it in the CI to run the check similar to what we do with rubocop and it will verify our test code?

@aguspe
Copy link
Contributor Author

aguspe commented Oct 17, 2023

So we can put it in the CI to run the check similar to what we do with Rubocop and it will verify our test code?

Exactly, we can add it, the same as a Rubocop check, I can add it as part of the rb actions flows (https://github.com/SeleniumHQ/selenium/blob/trunk/.github/workflows/ci-ruby.yml).

However, I never worked directly on Bazel but I was just looking into that, I could modify the lint test to make it run with steep and validate the types.

Also sorry for the delayed replies, I'm on CET time so I might always be 7 to 8 hours delayed haha.

@titusfortner
Copy link
Member

No worries, we can get the bazel pieces sorted later if needed, and this project is very geographically distributed, so communication delays are the norm.

@aguspe aguspe marked this pull request as ready for review October 22, 2023 16:14
@aguspe
Copy link
Contributor Author

aguspe commented Oct 22, 2023

@titusfortner it's ready for review now, I added RBS and steep as dev dependencies and I would like to update the documentation, where would you suggest I update the documentation for other devs regarding type checking?

@titusfortner titusfortner requested a review from p0deje October 22, 2023 18:44
Copy link
Member

@p0deje p0deje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for submitting this massive PR. I am not familiar with RBS/Steep, so maybe you can clarify few points for me?

  1. Should sig be shipped as part of the gem or pushed to https://github.com/ruby/gem_rbs_collection/?
  2. I see plenty of untyped in definitions, should those be replaced with something more strict at some point?
  3. Should be run type check for spec/ folder as well?
  4. There are some code duplications across RB/RBS files (e.g. URLs in EDGE_COMMANDS or DEFAULT_SECURE_SSL). Is this expected?
  5. There are comments in RBS, but they don't seem to provide any value and look like copies from RB files.
  6. How do we maintain rb/rbs_collection.lock.yaml?

@aguspe
Copy link
Contributor Author

aguspe commented Oct 27, 2023

Thank you for submitting this massive PR. I am not familiar with RBS/Steep, so maybe you can clarify few points for me?

  1. Should sig be shipped as part of the gem or pushed to https://github.com/ruby/gem_rbs_collection/?
  2. I see plenty of untyped in definitions, should those be replaced with something more strict at some point?
  3. Should be run type check for spec/ folder as well?
  4. There are some code duplications across RB/RBS files (e.g. URLs in EDGE_COMMANDS or DEFAULT_SECURE_SSL). Is this expected?
  5. There are comments in RBS, but they don't seem to provide any value and look like copies from RB files.
  6. How do we maintain rb/rbs_collection.lock.yaml?

Hello, sorry for the delay, it's busy week haha

  1. Great question:

So for example in https://github.com/ruby/gem_rbs_collection/blob/main/docs/CONTRIBUTING.md the recommendation is to ship the sig folder as part of the gem if you are the owner of it

  1. Several of the untyped definitions as the ones in WheelInput will be added support, but I think the best approach would be incremental

If I wanted RBS to recognize a class or a module I had to create the file for that class or module to finish the RBS work in that, and it kept expanding more and more ( I could also do it in this PR, it will just take longer and it will probably get bigger)

  1. Yes and we should, we need to add spec as a target on the steep configuration file, but I think it should be outside of this PR

  2. No, I need to fix those duplications, thank you for spotting that :)

  3. I can delete those comments, what I did was use the autogenerate option in ruby mine for RBS files and then modified the templates, and I thought that maybe even though duplicates we might still want the comments

  4. When the Gemfile.lock file is updated we can run rbs collection install to update the rbs_collection.lock.yaml. The same if we update the rbs_collection.yaml

For more info: https://github.com/ruby/rbs/blob/master/docs/collection.md#how-it-works

So @p0deje during the weekend I will be updating point 4 & 5, and I would suggest to do the rest of the support as support for the spec folder and expanding the types in other PRs to limit the size and make it easier to review

@aguspe aguspe force-pushed the add_rbs_files_to_ruby branch from 5a65b70 to 81a1670 Compare October 29, 2023 18:20
@aguspe
Copy link
Contributor Author

aguspe commented Oct 29, 2023

@p0deje It's ready for a re-review now

Copy link
Member

@p0deje p0deje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's a great start, we'd need to integrate it into specs/Bazel/CI at some point, but I agree it should be done in separate PRs.

@titusfortner
Copy link
Member

wow, steep really pulls in all the things, doesn't it?

@p0deje where is bazel supposed to be pulling this from?

Bundler::GemNotFound: Could not find ffi-1.16.3 in any of the sources

@p0deje
Copy link
Member

p0deje commented Nov 6, 2023

@titusfortner It should be pulling from the internet, I wonder if our Gemfile.lock just needs to be properly updated.

@titusfortner
Copy link
Member

Hmm, @aguspe what is your local OS?

Let me pull down a version of jruby and see what happens. 😁

@titusfortner
Copy link
Member

titusfortner commented Nov 6, 2023

Ok, I can reproduce this locally on my mac when I:

rbenv local jruby-9.4.3.0
bundle update
bazel test //rb/spec/unit/...

I get:

/private/var/tmp/_bazel_titusfortner/91f41ba347a35b04e5d76e05512d7e6d/external/rules_ruby_dist/dist/lib/ruby/3.0.0/bundler/definition.rb:480:in `materialize': Could not find rack-2.2.8, rake-13.1.0, rubocop-1.57.2, rubocop-performance-1.19.1, rubocop-rspec-2.25.0, webmock-3.19.1, rexml-3.2.6, rspec-mocks-3.12.6, parser-3.2.2.4, regexp_parser-2.8.2, rubocop-ast-1.30.0, unicode-display_width-2.5.0, rubocop-capybara-2.19.0, rubocop-factory_bot-2.24.0, addressable-2.8.5, irb-1.8.3, reline-0.3.9, racc-1.7.3, public_suffix-5.0.3, rdoc-6.6.0, psych-5.1.1.1, stringio-3.0.8 in any of the sources (Bundler::GemNotFound)

when I run it using RubyMine, everything is fine...

@aguspe
Copy link
Contributor Author

aguspe commented Nov 16, 2023

Hmm, @aguspe what is your local OS?

Let me pull down a version of Jruby and see what happens. 😁

My OS is Sonoma 14.0 and I'm using a mac M1,

So I have been doing some research and testing it locally
(I had some issues the last couple of days with rbenv so I had to uninstall and re-install several times)

I can reproduce the same issue with jruby-9.4.3.0 & jruby-9.4.4.0

And even though I tried to force the installation of different versions of FFI, I still get

'Bundler::GemNotFound: Could not find ffi-1.16.0-java, ffi-1.16.0-java, ffi-1.16.0-java, ffi-1.16.0-java, ffi-1.16.0-java, ffi-1.16.0-java, ffi-1.16.0-java, ffi-1.16.0-java in locally installed gems'

So I'm trying to debug this

@titusfortner
Copy link
Member

(I had some issues the last couple of days with rbenv so I had to uninstall and re-install several times)

I've been there. ☹️

@p0deje any ideas? Is there a way to just skip this for JRuby? 😁

@aguspe
Copy link
Contributor Author

aguspe commented Nov 17, 2023

(I had some issues the last couple of days with rbenv so I had to uninstall and re-install several times)

I've been there. ☹️

@p0deje any ideas? Is there a way to just skip this for JRuby? 😁

So if we want to skip it for JRuby and option is to add this on selenium-webdriver.gemspec, as on the last commit:

s.add_development_dependency 'steep', ['~> 1.5'] unless RUBY_PLATFORM == 'java'

I tested this and it works for Jruby and the tests execute well locally at least

@p0deje
Copy link
Member

p0deje commented Nov 17, 2023

Do we need to include it in gemspec at all? We could use it like that in Gemfile:

gem 'rbs', '~> 3.2', require: false, platforms: %i[mri mingw x64_mingw]
gem 'steep', '~> 1.5', require: false, platforms: %i[mri mingw x64_mingw]

This would allow installing it in MRI on Linux/Mac/Windows ignore both JRuby and TruffleRuby

@p0deje
Copy link
Member

p0deje commented Nov 17, 2023

Here is the full patch that makes this work on MRI and JRuby:

diff --git a/rb/Gemfile b/rb/Gemfile
index 9710e18d99..7b58c4e54f 100644
--- a/rb/Gemfile
+++ b/rb/Gemfile
@@ -6,3 +6,5 @@ Dir["#{__dir__}/*.gemspec"].each do |spec|
 end
 
 gem 'debug', '~> 1.7', require: false, platforms: %i[mri mingw x64_mingw]
+gem 'rbs', '~> 3.2', require: false, platforms: %i[mri mingw x64_mingw]
+gem 'steep', '~> 1.5.0', require: false, platforms: %i[mri mingw x64_mingw]
diff --git a/rb/Gemfile.lock b/rb/Gemfile.lock
index 5c72bfe7f7..bd8604143b 100644
--- a/rb/Gemfile.lock
+++ b/rb/Gemfile.lock
@@ -11,7 +11,8 @@ PATH
 GEM
   remote: https://rubygems.org/
   specs:
-    activesupport (7.1.1)
+    abbrev (0.1.1)
+    activesupport (7.1.2)
       base64
       bigdecimal
       concurrent-ruby (~> 1.0, >= 1.0.2)
@@ -24,41 +25,44 @@ GEM
     addressable (2.8.4)
       public_suffix (>= 2.0.2, < 6.0)
     ast (2.4.2)
-    base64 (0.1.1)
+    base64 (0.2.0)
     bigdecimal (3.1.4)
-    bigdecimal (3.1.4-java)
     concurrent-ruby (1.2.2)
     connection_pool (2.4.1)
     crack (0.4.5)
       rexml
-    csv (3.2.7)
+    csv (3.2.8)
     debug (1.8.0)
       irb (>= 1.5.0)
       reline (>= 0.3.1)
     diff-lcs (1.5.0)
-    drb (2.1.1)
+    drb (2.2.0)
       ruby2_keywords
     ffi (1.16.3)
-    fileutils (1.7.1)
+    ffi (1.16.3-x64-mingw32)
+    fileutils (1.7.2)
     hashdiff (1.0.1)
     i18n (1.14.1)
       concurrent-ruby (~> 1.0)
     io-console (0.6.0)
-    irb (1.7.0)
-      reline (>= 0.3.0)
+    irb (1.9.0)
+      rdoc
+      reline (>= 0.3.8)
     json (2.6.3)
     json (2.6.3-java)
     language_server-protocol (3.17.0.3)
     listen (3.8.0)
       rb-fsevent (~> 0.10, >= 0.10.3)
       rb-inotify (~> 0.9, >= 0.9.10)
-    logger (1.5.3)
+    logger (1.6.0)
     minitest (5.20.0)
-    mutex_m (0.1.2)
+    mutex_m (0.2.0)
     parallel (1.23.0)
     parser (3.2.2.3)
       ast (~> 2.4.1)
       racc
+    psych (5.1.1.1)
+      stringio
     public_suffix (5.0.1)
     racc (1.7.1)
     racc (1.7.1-java)
@@ -68,9 +72,12 @@ GEM
     rb-fsevent (0.11.2)
     rb-inotify (0.10.1)
       ffi (~> 1.0)
-    rbs (3.2.2)
+    rbs (3.3.0)
+      abbrev
+    rdoc (6.6.0)
+      psych (>= 4.0.0)
     regexp_parser (2.8.1)
-    reline (0.3.5)
+    reline (0.4.0)
       io-console (~> 0.5)
     rexml (3.2.5)
     rspec (3.12.0)
@@ -113,7 +120,7 @@ GEM
     ruby-progressbar (1.13.0)
     ruby2_keywords (0.0.5)
     rubyzip (2.3.2)
-    securerandom (0.2.2)
+    securerandom (0.3.0)
     steep (1.5.3)
       activesupport (>= 5.1)
       concurrent-ruby (>= 1.1.10)
@@ -129,8 +136,8 @@ GEM
       securerandom (>= 0.1)
       strscan (>= 1.0.0)
       terminal-table (>= 2, < 4)
+    stringio (3.0.9)
     strscan (3.0.7)
-    strscan (3.0.7-java)
     terminal-table (3.0.2)
       unicode-display_width (>= 1.1.1, < 3)
     tzinfo (2.0.6)
@@ -147,6 +154,8 @@ GEM
 PLATFORMS
   java
   ruby
+  universal-java-1.8
+  universal-java-17
   universal-java-18
   x64-mingw32
 
@@ -154,14 +163,14 @@ DEPENDENCIES
   debug (~> 1.7)
   rack (~> 2.0)
   rake (~> 13.0)
-  rbs (~> 3.2.0)
+  rbs (~> 3.2)
   rspec (~> 3.0)
   rubocop (~> 1.42)
   rubocop-performance (~> 1.15)
   rubocop-rspec (~> 2.16)
   selenium-devtools!
   selenium-webdriver!
-  steep (~> 1.5)
+  steep (~> 1.5.0)
   webmock (~> 3.5)
   webrick (~> 1.7)
   yard (~> 0.9.11)
diff --git a/rb/selenium-webdriver.gemspec b/rb/selenium-webdriver.gemspec
index 42254af43d..35349a72a9 100644
--- a/rb/selenium-webdriver.gemspec
+++ b/rb/selenium-webdriver.gemspec
@@ -62,12 +62,4 @@ Gem::Specification.new do |s|
   s.add_development_dependency 'webmock', ['~> 3.5']
   s.add_development_dependency 'webrick', ['~> 1.7']
   s.add_development_dependency 'yard', ['~> 0.9.11']
-
-  if RUBY_PLATFORM == 'java'
-    s.add_development_dependency 'rbs', ['1.2.0']
-    s.add_development_dependency 'steep', ['0.46.0']
-  else
-    s.add_development_dependency 'rbs', ['~> 3.2.0']
-    s.add_development_dependency 'steep', ['~> 1.5']
-  end
 end

@aguspe I can merge your PR and commit this on top if you believe it's mergeable.

@p0deje
Copy link
Member

p0deje commented Nov 17, 2023

Hooking this into Bazel is going to be non-trivial, I've already submitted ruby/rbs#1624 and soutaro/steep#962, but there is a lot of work still to do. This shouldn't stop us from merging the PR though!

@titusfortner
Copy link
Member

How does this get used with bazel? Isn't this just type hints to show up in IDE or are we looking for bazel to be able to enforce typing?

@p0deje
Copy link
Member

p0deje commented Nov 17, 2023

@titusfortner I suppose we'd like to run typecheck on CI too to make sure we don't introduce invalid RBS sgnatures.

@aguspe
Copy link
Contributor Author

aguspe commented Nov 18, 2023

Here is the full patch that makes this work on MRI and JRuby:

diff --git a/rb/Gemfile b/rb/Gemfile
index 9710e18d99..7b58c4e54f 100644
--- a/rb/Gemfile
+++ b/rb/Gemfile
@@ -6,3 +6,5 @@ Dir["#{__dir__}/*.gemspec"].each do |spec|
 end
 
 gem 'debug', '~> 1.7', require: false, platforms: %i[mri mingw x64_mingw]
+gem 'rbs', '~> 3.2', require: false, platforms: %i[mri mingw x64_mingw]
+gem 'steep', '~> 1.5.0', require: false, platforms: %i[mri mingw x64_mingw]
diff --git a/rb/Gemfile.lock b/rb/Gemfile.lock
index 5c72bfe7f7..bd8604143b 100644
--- a/rb/Gemfile.lock
+++ b/rb/Gemfile.lock
@@ -11,7 +11,8 @@ PATH
 GEM
   remote: https://rubygems.org/
   specs:
-    activesupport (7.1.1)
+    abbrev (0.1.1)
+    activesupport (7.1.2)
       base64
       bigdecimal
       concurrent-ruby (~> 1.0, >= 1.0.2)
@@ -24,41 +25,44 @@ GEM
     addressable (2.8.4)
       public_suffix (>= 2.0.2, < 6.0)
     ast (2.4.2)
-    base64 (0.1.1)
+    base64 (0.2.0)
     bigdecimal (3.1.4)
-    bigdecimal (3.1.4-java)
     concurrent-ruby (1.2.2)
     connection_pool (2.4.1)
     crack (0.4.5)
       rexml
-    csv (3.2.7)
+    csv (3.2.8)
     debug (1.8.0)
       irb (>= 1.5.0)
       reline (>= 0.3.1)
     diff-lcs (1.5.0)
-    drb (2.1.1)
+    drb (2.2.0)
       ruby2_keywords
     ffi (1.16.3)
-    fileutils (1.7.1)
+    ffi (1.16.3-x64-mingw32)
+    fileutils (1.7.2)
     hashdiff (1.0.1)
     i18n (1.14.1)
       concurrent-ruby (~> 1.0)
     io-console (0.6.0)
-    irb (1.7.0)
-      reline (>= 0.3.0)
+    irb (1.9.0)
+      rdoc
+      reline (>= 0.3.8)
     json (2.6.3)
     json (2.6.3-java)
     language_server-protocol (3.17.0.3)
     listen (3.8.0)
       rb-fsevent (~> 0.10, >= 0.10.3)
       rb-inotify (~> 0.9, >= 0.9.10)
-    logger (1.5.3)
+    logger (1.6.0)
     minitest (5.20.0)
-    mutex_m (0.1.2)
+    mutex_m (0.2.0)
     parallel (1.23.0)
     parser (3.2.2.3)
       ast (~> 2.4.1)
       racc
+    psych (5.1.1.1)
+      stringio
     public_suffix (5.0.1)
     racc (1.7.1)
     racc (1.7.1-java)
@@ -68,9 +72,12 @@ GEM
     rb-fsevent (0.11.2)
     rb-inotify (0.10.1)
       ffi (~> 1.0)
-    rbs (3.2.2)
+    rbs (3.3.0)
+      abbrev
+    rdoc (6.6.0)
+      psych (>= 4.0.0)
     regexp_parser (2.8.1)
-    reline (0.3.5)
+    reline (0.4.0)
       io-console (~> 0.5)
     rexml (3.2.5)
     rspec (3.12.0)
@@ -113,7 +120,7 @@ GEM
     ruby-progressbar (1.13.0)
     ruby2_keywords (0.0.5)
     rubyzip (2.3.2)
-    securerandom (0.2.2)
+    securerandom (0.3.0)
     steep (1.5.3)
       activesupport (>= 5.1)
       concurrent-ruby (>= 1.1.10)
@@ -129,8 +136,8 @@ GEM
       securerandom (>= 0.1)
       strscan (>= 1.0.0)
       terminal-table (>= 2, < 4)
+    stringio (3.0.9)
     strscan (3.0.7)
-    strscan (3.0.7-java)
     terminal-table (3.0.2)
       unicode-display_width (>= 1.1.1, < 3)
     tzinfo (2.0.6)
@@ -147,6 +154,8 @@ GEM
 PLATFORMS
   java
   ruby
+  universal-java-1.8
+  universal-java-17
   universal-java-18
   x64-mingw32
 
@@ -154,14 +163,14 @@ DEPENDENCIES
   debug (~> 1.7)
   rack (~> 2.0)
   rake (~> 13.0)
-  rbs (~> 3.2.0)
+  rbs (~> 3.2)
   rspec (~> 3.0)
   rubocop (~> 1.42)
   rubocop-performance (~> 1.15)
   rubocop-rspec (~> 2.16)
   selenium-devtools!
   selenium-webdriver!
-  steep (~> 1.5)
+  steep (~> 1.5.0)
   webmock (~> 3.5)
   webrick (~> 1.7)
   yard (~> 0.9.11)
diff --git a/rb/selenium-webdriver.gemspec b/rb/selenium-webdriver.gemspec
index 42254af43d..35349a72a9 100644
--- a/rb/selenium-webdriver.gemspec
+++ b/rb/selenium-webdriver.gemspec
@@ -62,12 +62,4 @@ Gem::Specification.new do |s|
   s.add_development_dependency 'webmock', ['~> 3.5']
   s.add_development_dependency 'webrick', ['~> 1.7']
   s.add_development_dependency 'yard', ['~> 0.9.11']
-
-  if RUBY_PLATFORM == 'java'
-    s.add_development_dependency 'rbs', ['1.2.0']
-    s.add_development_dependency 'steep', ['0.46.0']
-  else
-    s.add_development_dependency 'rbs', ['~> 3.2.0']
-    s.add_development_dependency 'steep', ['~> 1.5']
-  end
 end

@aguspe I can merge your PR and commit this on top if you believe it's mergeable.

I think it is, thank you @p0deje for looking into this, this is better than having a conditional on the gemspec

@p0deje
Copy link
Member

p0deje commented Nov 18, 2023

@aguspe would you like to commit this or do you want me to?

@aguspe
Copy link
Contributor Author

aguspe commented Nov 18, 2023

@aguspe would you like to commit this or do you want me to?

I added the suggested changes on the last commit, the only difference is that I added Steep from 1.6.0 and remove the need for RBS.

Steep depends on RBS, so when we install Steep we already have access to RBS on the commandline, so there is no need to install it again

@p0deje
Copy link
Member

p0deje commented Nov 19, 2023

@aguspe would you like to commit this or do you want me to?

I added the suggested changes on the last commit, the only difference is that I added Steep from 1.6.0 and remove the need for RBS.

I had to use Steep 1.5 due to soutaro/steep#962

@aguspe
Copy link
Contributor Author

aguspe commented Nov 19, 2023

soutaro/steep#962

Makes sense, reverted to 1.5.0

@aguspe
Copy link
Contributor Author

aguspe commented Nov 20, 2023

@titusfortner After this is merged, I will make a second PR to keep expanding RBS support

@p0deje p0deje merged commit b9ef666 into SeleniumHQ:trunk Nov 20, 2023
24 of 30 checks passed
@p0deje
Copy link
Member

p0deje commented Nov 20, 2023

@aguspe Thank you for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants