Skip to content

Commit

Permalink
(PUP-6894) Update gems now that puppet requires ruby 2.3 and up
Browse files Browse the repository at this point in the history
When another project depends on puppet and references it using `git` or
`path` in its Gemfile, then bundler will load puppet's .gemspec. As such
the following dependencies are not needed.

* Drop net-ssh
* Drop hocon

When building puppet as a gem using project_data.yaml:

* Add missing httpclient required dependency
* Bump ffi to >= 1.9.25, < 1.10

When running via bundler using Gemfile:

* Drop conditional ruby version logic for rubocop
* Relax rubocop constraint to allow y component to float.
* Unpin transitive rainbow dependency as the original problem[1] was
  resolved in rainbow 3.0 (which requires ruby >= 2.1)
* Delete outdated mocha comment
* Add optional hocon dependency

[1] ku1ik/rainbow#48
  • Loading branch information
joshcooper committed Jun 6, 2018
1 parent 328115e commit c483351
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 28 deletions.
10 changes: 1 addition & 9 deletions .gemspec
Expand Up @@ -33,19 +33,11 @@ Gem::Specification.new do |s|
s.specification_version = 3
s.add_runtime_dependency(%q<facter>, [">= 2.0.1", "< 4"])
s.add_runtime_dependency(%q<hiera>, [">= 3.2.1", "< 4"])
s.add_runtime_dependency(%q<semantic_puppet>, ["~> 1.0"])
# i18n support (gettext-setup and dependencies)
s.add_runtime_dependency(%q<semantic_puppet>, "~> 1.0")
s.add_runtime_dependency(%q<fast_gettext>, "~> 1.1.2")
s.add_runtime_dependency(%q<locale>, "~> 2.1")
s.add_runtime_dependency(%q<multi_json>, "~> 1.13")
s.add_runtime_dependency(%q<httpclient>, "~> 2.8")
# hocon is an optional hiera backend shipped in puppet-agent packages
s.add_runtime_dependency(%q<hocon>, "~> 1.0")
# net-ssh is a runtime dependency of Puppet::Util::NetworkDevice::Transport::Ssh
# Beaker 3.0.0 to 3.10.0 depends on net-ssh 3.3.0beta1
# Beaker 3.11.0+ depends on net-ssh 4.0+
# be lenient to allow module testing where Beaker and Puppet are in same Gemfile
s.add_runtime_dependency(%q<net-ssh>, [">= 3.0", "< 5"]) if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.0.0')

# loads platform specific gems like ffi, win32 platform gems
# as additional runtime dependencies
Expand Down
15 changes: 3 additions & 12 deletions Gemfile
Expand Up @@ -39,25 +39,16 @@ group(:development, :test) do
gem "rspec-its", "~> 1.1", :require => false
gem "rspec-collection_matchers", "~> 1.1", :require => false
gem "rspec-legacy_formatters", "~> 1.0", :require => false

# Mocha is not compatible across minor version changes; because of this only
# versions matching ~> 0.10.5 are supported. All other versions are unsupported
# and can be expected to fail.
gem "mocha", '~> 1.5.0', :require => false

gem "yarjuf", "~> 2.0"

# json-schema does not support windows, so omit it from the platforms list
gem "json-schema", "~> 2.0", :require => false, :platforms => [:ruby, :jruby]

if RUBY_VERSION >= '2.0'
# pin rubocop as 0.50 requires a higher version of the rainbow gem (see below)
gem 'rubocop', '~> 0.49.1', :platforms => [:ruby]
gem 'rubocop-i18n', '~> 1.2.0', :platforms => [:ruby]
end
gem 'rubocop', '~> 0.49', :platforms => [:ruby]
gem 'rubocop-i18n', '~> 1.2.0', :platforms => [:ruby]

# pin rainbow gem as 2.2.1 requires rubygems 2.6.9+ and (donotwant)
gem "rainbow", "< 2.2.1", :platforms => [:ruby]

gem 'rdoc', "~> 4.1", :platforms => [:ruby]
gem 'yard'
Expand All @@ -68,6 +59,7 @@ group(:development, :test) do
gem 'webmock', '~> 1.24'
gem 'vcr', '~> 2.9'
gem "hiera-eyaml", :require => false
gem "hocon", '~> 1.0', :require => false

gem 'memory_profiler', :platforms => [:mri_21, :mri_22, :mri_23, :mri_24, :mri_25]
end
Expand All @@ -81,7 +73,6 @@ group(:development) do
end

group(:extra) do
gem "rack", "~> 1.4", :require => false
gem "puppetlabs_spec_helper", :require => false
gem "msgpack", :require => false
end
Expand Down
11 changes: 4 additions & 7 deletions ext/project_data.yaml
Expand Up @@ -19,11 +19,11 @@ gem_required_rubygems_version: '> 1.3.1'
gem_runtime_dependencies:
facter: ['> 2.0.1', '< 4']
hiera: ['>= 3.2.1', '< 4']
# PUP-7115 - return to a gem dependency in Puppet 5
semantic_puppet: ['~> 1.0']
semantic_puppet: '~> 1.0'
fast_gettext: '~> 1.1.2'
locale: '~> 2.1'
multi_json: '~> 1.10'
httpclient: '~> 2.8'
gem_rdoc_options:
- --title
- "Puppet - Configuration Management"
Expand All @@ -36,9 +36,7 @@ gem_platform_dependencies:
CFPropertyList: '~> 2.2'
x86-mingw32:
gem_runtime_dependencies:
# Pinning versions that require native extensions
# ffi is pinned due to PUP-8438
ffi: '<= 1.9.18'
ffi: '~> 1.9.25'
# win32-xxxx gems are pinned due to PUP-6445
win32-dir: '= 0.4.9'
win32-process: '= 0.7.5'
Expand All @@ -48,8 +46,7 @@ gem_platform_dependencies:
minitar: '~> 0.6.1'
x64-mingw32:
gem_runtime_dependencies:
# ffi is pinned due to PUP-8438
ffi: '<= 1.9.18'
ffi: '~> 1.9.25'
# win32-xxxx gems are pinned due to PUP-6445
win32-dir: '= 0.4.9'
win32-process: '= 0.7.5'
Expand Down

0 comments on commit c483351

Please sign in to comment.