From 53e89fae90d7e68a5ced9e9121dea377b3f63084 Mon Sep 17 00:00:00 2001 From: Noah Kantrowitz Date: Sun, 4 Feb 2018 16:34:24 -0800 Subject: [PATCH 01/31] Update boilerplate. --- .travis.yml | 17 ++++++++++++++++- poise-python.gemspec | 2 +- test/gemfiles/chef-12.1.gemfile | 2 ++ test/gemfiles/chef-12.10.gemfile | 2 ++ test/gemfiles/chef-12.11.gemfile | 2 ++ test/gemfiles/chef-12.12.gemfile | 2 ++ test/gemfiles/chef-12.13.gemfile | 2 ++ test/gemfiles/chef-12.2.gemfile | 2 ++ test/gemfiles/chef-12.20.gemfile | 19 +++++++++++++++++++ test/gemfiles/chef-12.21.gemfile | 19 +++++++++++++++++++ test/gemfiles/chef-12.3.gemfile | 2 ++ test/gemfiles/chef-12.4.gemfile | 2 ++ test/gemfiles/chef-12.5.gemfile | 2 ++ test/gemfiles/chef-12.6.gemfile | 2 ++ test/gemfiles/chef-12.7.gemfile | 2 ++ test/gemfiles/chef-12.8.gemfile | 2 ++ test/gemfiles/chef-12.9.gemfile | 2 ++ test/gemfiles/chef-12.gemfile | 2 +- test/gemfiles/chef-13.3.gemfile | 19 +++++++++++++++++++ test/gemfiles/chef-13.4.gemfile | 19 +++++++++++++++++++ test/gemfiles/chef-13.5.gemfile | 19 +++++++++++++++++++ test/gemfiles/chef-13.6.gemfile | 19 +++++++++++++++++++ test/gemfiles/chef-13.7.gemfile | 19 +++++++++++++++++++ test/gemfiles/chef-13.gemfile | 2 +- 24 files changed, 178 insertions(+), 4 deletions(-) create mode 100644 test/gemfiles/chef-12.20.gemfile create mode 100644 test/gemfiles/chef-12.21.gemfile create mode 100644 test/gemfiles/chef-13.3.gemfile create mode 100644 test/gemfiles/chef-13.4.gemfile create mode 100644 test/gemfiles/chef-13.5.gemfile create mode 100644 test/gemfiles/chef-13.6.gemfile create mode 100644 test/gemfiles/chef-13.7.gemfile diff --git a/.travis.yml b/.travis.yml index 25c0084..d708b0f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,4 @@ +dist: trusty sudo: false cache: bundler language: ruby @@ -18,7 +19,7 @@ matrix: include: - rvm: 2.3.1 gemfile: test/gemfiles/chef-12.gemfile - - rvm: 2.4.1 + - rvm: 2.4.3 gemfile: test/gemfiles/chef-13.gemfile - rvm: 2.1.4 gemfile: test/gemfiles/chef-12.1.gemfile @@ -58,6 +59,10 @@ matrix: gemfile: test/gemfiles/chef-12.18.gemfile - rvm: 2.3.1 gemfile: test/gemfiles/chef-12.19.gemfile + - rvm: 2.3.1 + gemfile: test/gemfiles/chef-12.20.gemfile + - rvm: 2.3.1 + gemfile: test/gemfiles/chef-12.21.gemfile - rvm: 2.4.1 gemfile: test/gemfiles/chef-13.0.gemfile - rvm: 2.4.1 @@ -65,4 +70,14 @@ matrix: - rvm: 2.4.1 gemfile: test/gemfiles/chef-13.2.gemfile - rvm: 2.4.1 + gemfile: test/gemfiles/chef-13.3.gemfile + - rvm: 2.4.2 + gemfile: test/gemfiles/chef-13.4.gemfile + - rvm: 2.4.2 + gemfile: test/gemfiles/chef-13.5.gemfile + - rvm: 2.4.2 + gemfile: test/gemfiles/chef-13.6.gemfile + - rvm: 2.4.3 + gemfile: test/gemfiles/chef-13.7.gemfile + - rvm: 2.5.0 gemfile: test/gemfiles/master.gemfile diff --git a/poise-python.gemspec b/poise-python.gemspec index 0bbd12a..a4186b9 100644 --- a/poise-python.gemspec +++ b/poise-python.gemspec @@ -34,7 +34,7 @@ Gem::Specification.new do |spec| spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = %w{lib} - spec.add_dependency 'chef', '>= 12.1', '< 14' + spec.add_dependency 'chef', '>= 12.1', '< 15' spec.add_dependency 'halite', '~> 1.0' spec.add_dependency 'poise', '~> 2.7' spec.add_dependency 'poise-languages', '~> 2.0' diff --git a/test/gemfiles/chef-12.1.gemfile b/test/gemfiles/chef-12.1.gemfile index 83ee246..806b84d 100644 --- a/test/gemfiles/chef-12.1.gemfile +++ b/test/gemfiles/chef-12.1.gemfile @@ -17,8 +17,10 @@ eval_gemfile File.expand_path('../../../Gemfile', __FILE__) gem 'chef', '~> 12.1.2' +gem 'byebug', '< 9.1.0' gem 'chefspec', '< 6' gem 'fauxhai', '<= 3.9.0' gem 'ffi-yajl', '< 2.3.1' gem 'foodcritic', '< 8' +gem 'mixlib-shellout', '< 2.3.0' gem 'rack', '< 2' diff --git a/test/gemfiles/chef-12.10.gemfile b/test/gemfiles/chef-12.10.gemfile index b3f1bce..3d89023 100644 --- a/test/gemfiles/chef-12.10.gemfile +++ b/test/gemfiles/chef-12.10.gemfile @@ -17,8 +17,10 @@ eval_gemfile File.expand_path('../../../Gemfile', __FILE__) gem 'chef', '~> 12.10.24' +gem 'byebug', '< 9.1.0' gem 'chefspec', '< 6' gem 'fauxhai', '<= 3.9.0' gem 'ffi-yajl', '< 2.3.1' gem 'foodcritic', '< 8' +gem 'mixlib-shellout', '< 2.3.0' gem 'rack', '< 2' diff --git a/test/gemfiles/chef-12.11.gemfile b/test/gemfiles/chef-12.11.gemfile index e1a1b77..ed110d4 100644 --- a/test/gemfiles/chef-12.11.gemfile +++ b/test/gemfiles/chef-12.11.gemfile @@ -17,8 +17,10 @@ eval_gemfile File.expand_path('../../../Gemfile', __FILE__) gem 'chef', '~> 12.11.18' +gem 'byebug', '< 9.1.0' gem 'chefspec', '< 6' gem 'fauxhai', '<= 3.9.0' gem 'ffi-yajl', '< 2.3.1' gem 'foodcritic', '< 8' +gem 'mixlib-shellout', '< 2.3.0' gem 'rack', '< 2' diff --git a/test/gemfiles/chef-12.12.gemfile b/test/gemfiles/chef-12.12.gemfile index cdbf048..3fa97fa 100644 --- a/test/gemfiles/chef-12.12.gemfile +++ b/test/gemfiles/chef-12.12.gemfile @@ -17,7 +17,9 @@ eval_gemfile File.expand_path('../../../Gemfile', __FILE__) gem 'chef', '~> 12.12.15' +gem 'byebug', '< 9.1.0' gem 'chefspec', '< 6' gem 'fauxhai', '<= 3.9.0' gem 'ffi-yajl', '< 2.3.1' gem 'foodcritic', '< 8' +gem 'mixlib-shellout', '< 2.3.0' diff --git a/test/gemfiles/chef-12.13.gemfile b/test/gemfiles/chef-12.13.gemfile index 76b2217..4f04cb0 100644 --- a/test/gemfiles/chef-12.13.gemfile +++ b/test/gemfiles/chef-12.13.gemfile @@ -17,7 +17,9 @@ eval_gemfile File.expand_path('../../../Gemfile', __FILE__) gem 'chef', '~> 12.13.37' +gem 'byebug', '< 9.1.0' gem 'chefspec', '< 6' gem 'fauxhai', '<= 3.9.0' gem 'ffi-yajl', '< 2.3.1' gem 'foodcritic', '< 8' +gem 'mixlib-shellout', '< 2.3.0' diff --git a/test/gemfiles/chef-12.2.gemfile b/test/gemfiles/chef-12.2.gemfile index 1be9dc1..eae825c 100644 --- a/test/gemfiles/chef-12.2.gemfile +++ b/test/gemfiles/chef-12.2.gemfile @@ -17,8 +17,10 @@ eval_gemfile File.expand_path('../../../Gemfile', __FILE__) gem 'chef', '~> 12.2.1' +gem 'byebug', '< 9.1.0' gem 'chefspec', '< 6' gem 'fauxhai', '<= 3.9.0' gem 'ffi-yajl', '< 2.3.1' gem 'foodcritic', '< 8' +gem 'mixlib-shellout', '< 2.3.0' gem 'rack', '< 2' diff --git a/test/gemfiles/chef-12.20.gemfile b/test/gemfiles/chef-12.20.gemfile new file mode 100644 index 0000000..24473c3 --- /dev/null +++ b/test/gemfiles/chef-12.20.gemfile @@ -0,0 +1,19 @@ +# +# Copyright 2018, Noah Kantrowitz +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +eval_gemfile File.expand_path('../../../Gemfile', __FILE__) + +gem 'chef', '~> 12.20.3' diff --git a/test/gemfiles/chef-12.21.gemfile b/test/gemfiles/chef-12.21.gemfile new file mode 100644 index 0000000..b15de0b --- /dev/null +++ b/test/gemfiles/chef-12.21.gemfile @@ -0,0 +1,19 @@ +# +# Copyright 2018, Noah Kantrowitz +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +eval_gemfile File.expand_path('../../../Gemfile', __FILE__) + +gem 'chef', '~> 12.21.31' diff --git a/test/gemfiles/chef-12.3.gemfile b/test/gemfiles/chef-12.3.gemfile index f467b24..71d9b26 100644 --- a/test/gemfiles/chef-12.3.gemfile +++ b/test/gemfiles/chef-12.3.gemfile @@ -17,8 +17,10 @@ eval_gemfile File.expand_path('../../../Gemfile', __FILE__) gem 'chef', '~> 12.3.0' +gem 'byebug', '< 9.1.0' gem 'chefspec', '< 6' gem 'fauxhai', '<= 3.9.0' gem 'ffi-yajl', '< 2.3.1' gem 'foodcritic', '< 8' +gem 'mixlib-shellout', '< 2.3.0' gem 'rack', '< 2' diff --git a/test/gemfiles/chef-12.4.gemfile b/test/gemfiles/chef-12.4.gemfile index 3982e37..2704229 100644 --- a/test/gemfiles/chef-12.4.gemfile +++ b/test/gemfiles/chef-12.4.gemfile @@ -17,9 +17,11 @@ eval_gemfile File.expand_path('../../../Gemfile', __FILE__) gem 'chef', '~> 12.4.3' +gem 'byebug', '< 9.1.0' gem 'chefspec', '< 6' gem 'fauxhai', '<= 3.9.0' gem 'ffi-yajl', '< 2.3.1' gem 'foodcritic', '< 8' gem 'gh', '0.14.0' +gem 'mixlib-shellout', '< 2.3.0' gem 'rack', '< 2' diff --git a/test/gemfiles/chef-12.5.gemfile b/test/gemfiles/chef-12.5.gemfile index cce7846..c5c75a7 100644 --- a/test/gemfiles/chef-12.5.gemfile +++ b/test/gemfiles/chef-12.5.gemfile @@ -17,8 +17,10 @@ eval_gemfile File.expand_path('../../../Gemfile', __FILE__) gem 'chef', '~> 12.5.1' +gem 'byebug', '< 9.1.0' gem 'chefspec', '< 6' gem 'fauxhai', '<= 3.9.0' gem 'ffi-yajl', '< 2.3.1' gem 'foodcritic', '< 8' +gem 'mixlib-shellout', '< 2.3.0' gem 'rack', '< 2' diff --git a/test/gemfiles/chef-12.6.gemfile b/test/gemfiles/chef-12.6.gemfile index 5f699c5..d3bb13c 100644 --- a/test/gemfiles/chef-12.6.gemfile +++ b/test/gemfiles/chef-12.6.gemfile @@ -17,8 +17,10 @@ eval_gemfile File.expand_path('../../../Gemfile', __FILE__) gem 'chef', '~> 12.6.0' +gem 'byebug', '< 9.1.0' gem 'chefspec', '< 6' gem 'fauxhai', '<= 3.9.0' gem 'ffi-yajl', '< 2.3.1' gem 'foodcritic', '< 8' +gem 'mixlib-shellout', '< 2.3.0' gem 'rack', '< 2' diff --git a/test/gemfiles/chef-12.7.gemfile b/test/gemfiles/chef-12.7.gemfile index a5930c6..d0ecb07 100644 --- a/test/gemfiles/chef-12.7.gemfile +++ b/test/gemfiles/chef-12.7.gemfile @@ -17,8 +17,10 @@ eval_gemfile File.expand_path('../../../Gemfile', __FILE__) gem 'chef', '~> 12.7.2' +gem 'byebug', '< 9.1.0' gem 'chefspec', '< 6' gem 'fauxhai', '<= 3.9.0' gem 'ffi-yajl', '< 2.3.1' gem 'foodcritic', '< 8' +gem 'mixlib-shellout', '< 2.3.0' gem 'rack', '< 2' diff --git a/test/gemfiles/chef-12.8.gemfile b/test/gemfiles/chef-12.8.gemfile index 49da969..c9d0175 100644 --- a/test/gemfiles/chef-12.8.gemfile +++ b/test/gemfiles/chef-12.8.gemfile @@ -17,8 +17,10 @@ eval_gemfile File.expand_path('../../../Gemfile', __FILE__) gem 'chef', '~> 12.8.1' +gem 'byebug', '< 9.1.0' gem 'chefspec', '< 6' gem 'fauxhai', '<= 3.9.0' gem 'ffi-yajl', '< 2.3.1' gem 'foodcritic', '< 8' +gem 'mixlib-shellout', '< 2.3.0' gem 'rack', '< 2' diff --git a/test/gemfiles/chef-12.9.gemfile b/test/gemfiles/chef-12.9.gemfile index 4295ec5..965468f 100644 --- a/test/gemfiles/chef-12.9.gemfile +++ b/test/gemfiles/chef-12.9.gemfile @@ -17,8 +17,10 @@ eval_gemfile File.expand_path('../../../Gemfile', __FILE__) gem 'chef', '~> 12.9.41' +gem 'byebug', '< 9.1.0' gem 'chefspec', '< 6' gem 'fauxhai', '<= 3.9.0' gem 'ffi-yajl', '< 2.3.1' gem 'foodcritic', '< 8' +gem 'mixlib-shellout', '< 2.3.0' gem 'rack', '< 2' diff --git a/test/gemfiles/chef-12.gemfile b/test/gemfiles/chef-12.gemfile index bd22a0f..1209719 100644 --- a/test/gemfiles/chef-12.gemfile +++ b/test/gemfiles/chef-12.gemfile @@ -16,4 +16,4 @@ eval_gemfile File.expand_path('../../../Gemfile', __FILE__) -gem 'chef', '~> 12.19' +gem 'chef', '~> 12.21' diff --git a/test/gemfiles/chef-13.3.gemfile b/test/gemfiles/chef-13.3.gemfile new file mode 100644 index 0000000..cf2a9bc --- /dev/null +++ b/test/gemfiles/chef-13.3.gemfile @@ -0,0 +1,19 @@ +# +# Copyright 2018, Noah Kantrowitz +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +eval_gemfile File.expand_path('../../../Gemfile', __FILE__) + +gem 'chef', '~> 13.3.42' diff --git a/test/gemfiles/chef-13.4.gemfile b/test/gemfiles/chef-13.4.gemfile new file mode 100644 index 0000000..ea6fbee --- /dev/null +++ b/test/gemfiles/chef-13.4.gemfile @@ -0,0 +1,19 @@ +# +# Copyright 2018, Noah Kantrowitz +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +eval_gemfile File.expand_path('../../../Gemfile', __FILE__) + +gem 'chef', '~> 13.4.24' diff --git a/test/gemfiles/chef-13.5.gemfile b/test/gemfiles/chef-13.5.gemfile new file mode 100644 index 0000000..ecffdfa --- /dev/null +++ b/test/gemfiles/chef-13.5.gemfile @@ -0,0 +1,19 @@ +# +# Copyright 2018, Noah Kantrowitz +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +eval_gemfile File.expand_path('../../../Gemfile', __FILE__) + +gem 'chef', '~> 13.5.3' diff --git a/test/gemfiles/chef-13.6.gemfile b/test/gemfiles/chef-13.6.gemfile new file mode 100644 index 0000000..315d54e --- /dev/null +++ b/test/gemfiles/chef-13.6.gemfile @@ -0,0 +1,19 @@ +# +# Copyright 2018, Noah Kantrowitz +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +eval_gemfile File.expand_path('../../../Gemfile', __FILE__) + +gem 'chef', '~> 13.6.4' diff --git a/test/gemfiles/chef-13.7.gemfile b/test/gemfiles/chef-13.7.gemfile new file mode 100644 index 0000000..e5cafc5 --- /dev/null +++ b/test/gemfiles/chef-13.7.gemfile @@ -0,0 +1,19 @@ +# +# Copyright 2018, Noah Kantrowitz +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +eval_gemfile File.expand_path('../../../Gemfile', __FILE__) + +gem 'chef', '~> 13.7.16' diff --git a/test/gemfiles/chef-13.gemfile b/test/gemfiles/chef-13.gemfile index 3f49de1..c7b03b6 100644 --- a/test/gemfiles/chef-13.gemfile +++ b/test/gemfiles/chef-13.gemfile @@ -16,4 +16,4 @@ eval_gemfile File.expand_path('../../../Gemfile', __FILE__) -gem 'chef', '~> 13.2' +gem 'chef', '~> 13.7' From 9fed642c15ef8df6f1d8383ce0b730536d2b23f1 Mon Sep 17 00:00:00 2001 From: Noah Kantrowitz Date: Sat, 3 Mar 2018 20:40:53 -0800 Subject: [PATCH 02/31] Update boilerplate and min chef version. --- .travis.yml | 32 ++----------------- poise-python.gemspec | 2 +- test/gemfiles/chef-12.1.gemfile | 26 --------------- test/gemfiles/chef-12.10.gemfile | 26 --------------- test/gemfiles/chef-12.11.gemfile | 26 --------------- test/gemfiles/chef-12.12.gemfile | 25 --------------- test/gemfiles/chef-12.13.gemfile | 25 --------------- test/gemfiles/chef-12.2.gemfile | 26 --------------- test/gemfiles/chef-12.3.gemfile | 26 --------------- test/gemfiles/chef-12.4.gemfile | 27 ---------------- test/gemfiles/chef-12.5.gemfile | 26 --------------- test/gemfiles/chef-12.6.gemfile | 26 --------------- test/gemfiles/chef-12.7.gemfile | 26 --------------- test/gemfiles/chef-12.8.gemfile | 26 --------------- test/gemfiles/chef-12.9.gemfile | 26 --------------- .../{chef-13.7.gemfile => chef-13.8.gemfile} | 2 +- test/gemfiles/chef-13.gemfile | 2 +- 17 files changed, 6 insertions(+), 369 deletions(-) delete mode 100644 test/gemfiles/chef-12.1.gemfile delete mode 100644 test/gemfiles/chef-12.10.gemfile delete mode 100644 test/gemfiles/chef-12.11.gemfile delete mode 100644 test/gemfiles/chef-12.12.gemfile delete mode 100644 test/gemfiles/chef-12.13.gemfile delete mode 100644 test/gemfiles/chef-12.2.gemfile delete mode 100644 test/gemfiles/chef-12.3.gemfile delete mode 100644 test/gemfiles/chef-12.4.gemfile delete mode 100644 test/gemfiles/chef-12.5.gemfile delete mode 100644 test/gemfiles/chef-12.6.gemfile delete mode 100644 test/gemfiles/chef-12.7.gemfile delete mode 100644 test/gemfiles/chef-12.8.gemfile delete mode 100644 test/gemfiles/chef-12.9.gemfile rename test/gemfiles/{chef-13.7.gemfile => chef-13.8.gemfile} (96%) diff --git a/.travis.yml b/.travis.yml index d708b0f..3f845de 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,32 +21,8 @@ matrix: gemfile: test/gemfiles/chef-12.gemfile - rvm: 2.4.3 gemfile: test/gemfiles/chef-13.gemfile - - rvm: 2.1.4 - gemfile: test/gemfiles/chef-12.1.gemfile - - rvm: 2.1.4 - gemfile: test/gemfiles/chef-12.2.gemfile - - rvm: 2.1.4 - gemfile: test/gemfiles/chef-12.3.gemfile - - rvm: 2.1.6 - gemfile: test/gemfiles/chef-12.4.gemfile - - rvm: 2.1.6 - gemfile: test/gemfiles/chef-12.5.gemfile - - rvm: 2.1.6 - gemfile: test/gemfiles/chef-12.6.gemfile - - rvm: 2.1.6 - gemfile: test/gemfiles/chef-12.7.gemfile - - rvm: 2.1.6 - gemfile: test/gemfiles/chef-12.8.gemfile - - rvm: 2.1.8 - gemfile: test/gemfiles/chef-12.9.gemfile - - rvm: 2.1.8 - gemfile: test/gemfiles/chef-12.10.gemfile - - rvm: 2.1.8 - gemfile: test/gemfiles/chef-12.11.gemfile - - rvm: 2.1.8 - gemfile: test/gemfiles/chef-12.12.gemfile - - rvm: 2.1.9 - gemfile: test/gemfiles/chef-12.13.gemfile + - rvm: 2.5.0 + gemfile: test/gemfiles/master.gemfile - rvm: 2.3.1 gemfile: test/gemfiles/chef-12.14.gemfile - rvm: 2.3.1 @@ -78,6 +54,4 @@ matrix: - rvm: 2.4.2 gemfile: test/gemfiles/chef-13.6.gemfile - rvm: 2.4.3 - gemfile: test/gemfiles/chef-13.7.gemfile - - rvm: 2.5.0 - gemfile: test/gemfiles/master.gemfile + gemfile: test/gemfiles/chef-13.8.gemfile diff --git a/poise-python.gemspec b/poise-python.gemspec index a4186b9..7263cd1 100644 --- a/poise-python.gemspec +++ b/poise-python.gemspec @@ -34,7 +34,7 @@ Gem::Specification.new do |spec| spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = %w{lib} - spec.add_dependency 'chef', '>= 12.1', '< 15' + spec.add_dependency 'chef', '>= 12.14', '< 15' spec.add_dependency 'halite', '~> 1.0' spec.add_dependency 'poise', '~> 2.7' spec.add_dependency 'poise-languages', '~> 2.0' diff --git a/test/gemfiles/chef-12.1.gemfile b/test/gemfiles/chef-12.1.gemfile deleted file mode 100644 index 806b84d..0000000 --- a/test/gemfiles/chef-12.1.gemfile +++ /dev/null @@ -1,26 +0,0 @@ -# -# Copyright 2015-2017, Noah Kantrowitz -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -eval_gemfile File.expand_path('../../../Gemfile', __FILE__) - -gem 'chef', '~> 12.1.2' -gem 'byebug', '< 9.1.0' -gem 'chefspec', '< 6' -gem 'fauxhai', '<= 3.9.0' -gem 'ffi-yajl', '< 2.3.1' -gem 'foodcritic', '< 8' -gem 'mixlib-shellout', '< 2.3.0' -gem 'rack', '< 2' diff --git a/test/gemfiles/chef-12.10.gemfile b/test/gemfiles/chef-12.10.gemfile deleted file mode 100644 index 3d89023..0000000 --- a/test/gemfiles/chef-12.10.gemfile +++ /dev/null @@ -1,26 +0,0 @@ -# -# Copyright 2016-2017, Noah Kantrowitz -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -eval_gemfile File.expand_path('../../../Gemfile', __FILE__) - -gem 'chef', '~> 12.10.24' -gem 'byebug', '< 9.1.0' -gem 'chefspec', '< 6' -gem 'fauxhai', '<= 3.9.0' -gem 'ffi-yajl', '< 2.3.1' -gem 'foodcritic', '< 8' -gem 'mixlib-shellout', '< 2.3.0' -gem 'rack', '< 2' diff --git a/test/gemfiles/chef-12.11.gemfile b/test/gemfiles/chef-12.11.gemfile deleted file mode 100644 index ed110d4..0000000 --- a/test/gemfiles/chef-12.11.gemfile +++ /dev/null @@ -1,26 +0,0 @@ -# -# Copyright 2016-2017, Noah Kantrowitz -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -eval_gemfile File.expand_path('../../../Gemfile', __FILE__) - -gem 'chef', '~> 12.11.18' -gem 'byebug', '< 9.1.0' -gem 'chefspec', '< 6' -gem 'fauxhai', '<= 3.9.0' -gem 'ffi-yajl', '< 2.3.1' -gem 'foodcritic', '< 8' -gem 'mixlib-shellout', '< 2.3.0' -gem 'rack', '< 2' diff --git a/test/gemfiles/chef-12.12.gemfile b/test/gemfiles/chef-12.12.gemfile deleted file mode 100644 index 3fa97fa..0000000 --- a/test/gemfiles/chef-12.12.gemfile +++ /dev/null @@ -1,25 +0,0 @@ -# -# Copyright 2016-2017, Noah Kantrowitz -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -eval_gemfile File.expand_path('../../../Gemfile', __FILE__) - -gem 'chef', '~> 12.12.15' -gem 'byebug', '< 9.1.0' -gem 'chefspec', '< 6' -gem 'fauxhai', '<= 3.9.0' -gem 'ffi-yajl', '< 2.3.1' -gem 'foodcritic', '< 8' -gem 'mixlib-shellout', '< 2.3.0' diff --git a/test/gemfiles/chef-12.13.gemfile b/test/gemfiles/chef-12.13.gemfile deleted file mode 100644 index 4f04cb0..0000000 --- a/test/gemfiles/chef-12.13.gemfile +++ /dev/null @@ -1,25 +0,0 @@ -# -# Copyright 2016-2017, Noah Kantrowitz -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -eval_gemfile File.expand_path('../../../Gemfile', __FILE__) - -gem 'chef', '~> 12.13.37' -gem 'byebug', '< 9.1.0' -gem 'chefspec', '< 6' -gem 'fauxhai', '<= 3.9.0' -gem 'ffi-yajl', '< 2.3.1' -gem 'foodcritic', '< 8' -gem 'mixlib-shellout', '< 2.3.0' diff --git a/test/gemfiles/chef-12.2.gemfile b/test/gemfiles/chef-12.2.gemfile deleted file mode 100644 index eae825c..0000000 --- a/test/gemfiles/chef-12.2.gemfile +++ /dev/null @@ -1,26 +0,0 @@ -# -# Copyright 2015-2017, Noah Kantrowitz -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -eval_gemfile File.expand_path('../../../Gemfile', __FILE__) - -gem 'chef', '~> 12.2.1' -gem 'byebug', '< 9.1.0' -gem 'chefspec', '< 6' -gem 'fauxhai', '<= 3.9.0' -gem 'ffi-yajl', '< 2.3.1' -gem 'foodcritic', '< 8' -gem 'mixlib-shellout', '< 2.3.0' -gem 'rack', '< 2' diff --git a/test/gemfiles/chef-12.3.gemfile b/test/gemfiles/chef-12.3.gemfile deleted file mode 100644 index 71d9b26..0000000 --- a/test/gemfiles/chef-12.3.gemfile +++ /dev/null @@ -1,26 +0,0 @@ -# -# Copyright 2015-2017, Noah Kantrowitz -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -eval_gemfile File.expand_path('../../../Gemfile', __FILE__) - -gem 'chef', '~> 12.3.0' -gem 'byebug', '< 9.1.0' -gem 'chefspec', '< 6' -gem 'fauxhai', '<= 3.9.0' -gem 'ffi-yajl', '< 2.3.1' -gem 'foodcritic', '< 8' -gem 'mixlib-shellout', '< 2.3.0' -gem 'rack', '< 2' diff --git a/test/gemfiles/chef-12.4.gemfile b/test/gemfiles/chef-12.4.gemfile deleted file mode 100644 index 2704229..0000000 --- a/test/gemfiles/chef-12.4.gemfile +++ /dev/null @@ -1,27 +0,0 @@ -# -# Copyright 2015-2017, Noah Kantrowitz -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -eval_gemfile File.expand_path('../../../Gemfile', __FILE__) - -gem 'chef', '~> 12.4.3' -gem 'byebug', '< 9.1.0' -gem 'chefspec', '< 6' -gem 'fauxhai', '<= 3.9.0' -gem 'ffi-yajl', '< 2.3.1' -gem 'foodcritic', '< 8' -gem 'gh', '0.14.0' -gem 'mixlib-shellout', '< 2.3.0' -gem 'rack', '< 2' diff --git a/test/gemfiles/chef-12.5.gemfile b/test/gemfiles/chef-12.5.gemfile deleted file mode 100644 index c5c75a7..0000000 --- a/test/gemfiles/chef-12.5.gemfile +++ /dev/null @@ -1,26 +0,0 @@ -# -# Copyright 2015-2017, Noah Kantrowitz -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -eval_gemfile File.expand_path('../../../Gemfile', __FILE__) - -gem 'chef', '~> 12.5.1' -gem 'byebug', '< 9.1.0' -gem 'chefspec', '< 6' -gem 'fauxhai', '<= 3.9.0' -gem 'ffi-yajl', '< 2.3.1' -gem 'foodcritic', '< 8' -gem 'mixlib-shellout', '< 2.3.0' -gem 'rack', '< 2' diff --git a/test/gemfiles/chef-12.6.gemfile b/test/gemfiles/chef-12.6.gemfile deleted file mode 100644 index d3bb13c..0000000 --- a/test/gemfiles/chef-12.6.gemfile +++ /dev/null @@ -1,26 +0,0 @@ -# -# Copyright 2015-2017, Noah Kantrowitz -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -eval_gemfile File.expand_path('../../../Gemfile', __FILE__) - -gem 'chef', '~> 12.6.0' -gem 'byebug', '< 9.1.0' -gem 'chefspec', '< 6' -gem 'fauxhai', '<= 3.9.0' -gem 'ffi-yajl', '< 2.3.1' -gem 'foodcritic', '< 8' -gem 'mixlib-shellout', '< 2.3.0' -gem 'rack', '< 2' diff --git a/test/gemfiles/chef-12.7.gemfile b/test/gemfiles/chef-12.7.gemfile deleted file mode 100644 index d0ecb07..0000000 --- a/test/gemfiles/chef-12.7.gemfile +++ /dev/null @@ -1,26 +0,0 @@ -# -# Copyright 2015-2017, Noah Kantrowitz -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -eval_gemfile File.expand_path('../../../Gemfile', __FILE__) - -gem 'chef', '~> 12.7.2' -gem 'byebug', '< 9.1.0' -gem 'chefspec', '< 6' -gem 'fauxhai', '<= 3.9.0' -gem 'ffi-yajl', '< 2.3.1' -gem 'foodcritic', '< 8' -gem 'mixlib-shellout', '< 2.3.0' -gem 'rack', '< 2' diff --git a/test/gemfiles/chef-12.8.gemfile b/test/gemfiles/chef-12.8.gemfile deleted file mode 100644 index c9d0175..0000000 --- a/test/gemfiles/chef-12.8.gemfile +++ /dev/null @@ -1,26 +0,0 @@ -# -# Copyright 2015-2017, Noah Kantrowitz -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -eval_gemfile File.expand_path('../../../Gemfile', __FILE__) - -gem 'chef', '~> 12.8.1' -gem 'byebug', '< 9.1.0' -gem 'chefspec', '< 6' -gem 'fauxhai', '<= 3.9.0' -gem 'ffi-yajl', '< 2.3.1' -gem 'foodcritic', '< 8' -gem 'mixlib-shellout', '< 2.3.0' -gem 'rack', '< 2' diff --git a/test/gemfiles/chef-12.9.gemfile b/test/gemfiles/chef-12.9.gemfile deleted file mode 100644 index 965468f..0000000 --- a/test/gemfiles/chef-12.9.gemfile +++ /dev/null @@ -1,26 +0,0 @@ -# -# Copyright 2016-2017, Noah Kantrowitz -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -eval_gemfile File.expand_path('../../../Gemfile', __FILE__) - -gem 'chef', '~> 12.9.41' -gem 'byebug', '< 9.1.0' -gem 'chefspec', '< 6' -gem 'fauxhai', '<= 3.9.0' -gem 'ffi-yajl', '< 2.3.1' -gem 'foodcritic', '< 8' -gem 'mixlib-shellout', '< 2.3.0' -gem 'rack', '< 2' diff --git a/test/gemfiles/chef-13.7.gemfile b/test/gemfiles/chef-13.8.gemfile similarity index 96% rename from test/gemfiles/chef-13.7.gemfile rename to test/gemfiles/chef-13.8.gemfile index e5cafc5..60aa2c3 100644 --- a/test/gemfiles/chef-13.7.gemfile +++ b/test/gemfiles/chef-13.8.gemfile @@ -16,4 +16,4 @@ eval_gemfile File.expand_path('../../../Gemfile', __FILE__) -gem 'chef', '~> 13.7.16' +gem 'chef', '~> 13.8.0' diff --git a/test/gemfiles/chef-13.gemfile b/test/gemfiles/chef-13.gemfile index c7b03b6..e052337 100644 --- a/test/gemfiles/chef-13.gemfile +++ b/test/gemfiles/chef-13.gemfile @@ -16,4 +16,4 @@ eval_gemfile File.expand_path('../../../Gemfile', __FILE__) -gem 'chef', '~> 13.7' +gem 'chef', '~> 13.8' From df4685bff206868d2d0c9582a667d35828149537 Mon Sep 17 00:00:00 2001 From: Noah Kantrowitz Date: Sun, 4 Mar 2018 17:05:58 -0800 Subject: [PATCH 03/31] Compat fix for newer Chef. Upstream fix is in https://github.com/chef/chef/pull/6942. --- lib/poise_python/resources/python_package.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/poise_python/resources/python_package.rb b/lib/poise_python/resources/python_package.rb index dc1819b..034aca5 100644 --- a/lib/poise_python/resources/python_package.rb +++ b/lib/poise_python/resources/python_package.rb @@ -113,6 +113,12 @@ class Resource < Chef::Resource::Package # @return [String, Integer, nil] attribute(:user, kind_of: [String, Integer, NilClass], default: lazy { default_user }) + # This should probably be in the base class but ¯\_(ツ)_/¯. + # @!attribute allow_downgrade + # Allow downgrading the package. + # @return [Boolean] + attribute(:allow_downgrade, kind_of: [TrueClass, FalseClass], default: false) + def initialize(*args) super # For older Chef. From 6447a30ce12aa5b3c59f34b17f8d86350ac5253d Mon Sep 17 00:00:00 2001 From: Noah Kantrowitz Date: Mon, 16 Apr 2018 22:53:42 -0700 Subject: [PATCH 04/31] Update fauxhai version strings. --- test/spec/python_providers/scl_spec.rb | 4 ++-- test/spec/python_providers/system_spec.rb | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/test/spec/python_providers/scl_spec.rb b/test/spec/python_providers/scl_spec.rb index 05cbbc1..1b389cb 100644 --- a/test/spec/python_providers/scl_spec.rb +++ b/test/spec/python_providers/scl_spec.rb @@ -18,7 +18,7 @@ describe PoisePython::PythonProviders::Scl do let(:python_version) { '' } - let(:chefspec_options) { {platform: 'centos', version: '7.0'} } + let(:chefspec_options) { {platform: 'centos', version: '7.4.1708'} } let(:default_attributes) { {poise_python_version: python_version} } let(:python_runtime) { chef_run.python_runtime('test') } step_into(:python_runtime) @@ -60,7 +60,7 @@ end # /context with version "3.3" context 'with version "" on CentOS 6' do - let(:chefspec_options) { {platform: 'centos', version: '6.0'} } + let(:chefspec_options) { {platform: 'centos', version: '6.9'} } let(:python_version) { '' } it_behaves_like 'scl provider', 'rh-python34' end # /context with version "" on CentOS 6 diff --git a/test/spec/python_providers/system_spec.rb b/test/spec/python_providers/system_spec.rb index 1d2e565..cd7080b 100644 --- a/test/spec/python_providers/system_spec.rb +++ b/test/spec/python_providers/system_spec.rb @@ -65,13 +65,13 @@ it_behaves_like 'system provider', %w{python2.3 python23 python}, 'python2.3' end # /context with version 2.3 - context 'on Debian 8.1' do - before { chefspec_options.update(platform: 'debian', version: '8.1') } + context 'on Debian 8' do + before { chefspec_options.update(platform: 'debian', version: '8.9') } it_behaves_like 'system provider', 'python3.4' - end # /context on Debian 8.1 + end # /context on Debian 8 context 'on CentOS 7' do - before { chefspec_options.update(platform: 'centos', version: '7.0') } + before { chefspec_options.update(platform: 'centos', version: '7.4.1708') } recipe do python_runtime 'test' do provider :system @@ -80,7 +80,7 @@ end end it_behaves_like 'system provider', 'python' - end # /context on Debian 8.1 + end # /context on CentOS 7 context 'action :uninstall' do recipe do From f10347c77e4e38a713a54bdbf9c3e3376b2f1f08 Mon Sep 17 00:00:00 2001 From: Noah Kantrowitz Date: Mon, 16 Apr 2018 22:53:54 -0700 Subject: [PATCH 05/31] Always pass in a real resource. --- test/spec/resources/python_package_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/spec/resources/python_package_spec.rb b/test/spec/resources/python_package_spec.rb index 9583d3d..082e6d9 100644 --- a/test/spec/resources/python_package_spec.rb +++ b/test/spec/resources/python_package_spec.rb @@ -50,7 +50,7 @@ end # /describe PoisePython::Resources::PythonPackage::Resource describe PoisePython::Resources::PythonPackage::Provider do - let(:test_resource) { nil } + let(:test_resource) { PoisePython::Resources::PythonPackage::Resource.new('package', chef_run.run_context) } let(:test_provider) { described_class.new(test_resource, chef_run.run_context) } def stub_cmd(cmd, **options) options = options.dup From b61bb649a30814c59cc5d1bbbd3e07e5bee0d0a9 Mon Sep 17 00:00:00 2001 From: Noah Kantrowitz Date: Tue, 17 Apr 2018 02:28:37 -0700 Subject: [PATCH 06/31] Don't incorrectly mark Pip 10 as unsupported. --- lib/poise_python/resources/python_package.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/poise_python/resources/python_package.rb b/lib/poise_python/resources/python_package.rb index 034aca5..d83db36 100644 --- a/lib/poise_python/resources/python_package.rb +++ b/lib/poise_python/resources/python_package.rb @@ -38,7 +38,7 @@ module PythonPackage import pip # Don't use pkg_resources because I don't want to require it before this anyway. -if re.match(r'0|1|6\\.0', pip.__version__): +if re.match(r'0\\.|1\\.|6\\.0', pip.__version__): sys.stderr.write('The python_package resource requires pip >= 6.1.0, currently '+pip.__version__+'\\n') sys.exit(1) From f08d5e5ba11f0234f648dc48c9a352e9170d1052 Mon Sep 17 00:00:00 2001 From: Noah Kantrowitz Date: Tue, 17 Apr 2018 02:29:53 -0700 Subject: [PATCH 07/31] Fix compat for Pip 10. Update for the `pip._internal` package and fix the parsing for `pip list`. --- lib/poise_python/resources/python_package.rb | 39 +++++++++++++------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/lib/poise_python/resources/python_package.rb b/lib/poise_python/resources/python_package.rb index d83db36..9eeeee5 100644 --- a/lib/poise_python/resources/python_package.rb +++ b/lib/poise_python/resources/python_package.rb @@ -42,10 +42,15 @@ module PythonPackage sys.stderr.write('The python_package resource requires pip >= 6.1.0, currently '+pip.__version__+'\\n') sys.exit(1) -from pip.commands import InstallCommand -from pip.index import PackageFinder -from pip.req import InstallRequirement - +try: + from pip.commands import InstallCommand + from pip.index import PackageFinder + from pip.req import InstallRequirement +except ImportError: + # Pip 10 moved all internals to their own package. + from pip._internal.commands import InstallCommand + from pip._internal.index import PackageFinder + from pip._internal.req import InstallRequirement packages = {} cmd = InstallCommand() @@ -193,6 +198,7 @@ def load_current_resource @current_resource = new_resource.class.new(new_resource.name, run_context) current_resource.package_name(new_resource.package_name) check_package_versions(current_resource) + Chef::Log.debug("[#{new_resource}] Current version: #{current_resource.version}, candidate version: #{@candidate_version}") current_resource end @@ -206,7 +212,7 @@ def load_current_resource def check_package_versions(resource, version=new_resource.version) version_data = Hash.new {|hash, key| hash[key] = {current: nil, candidate: nil} } # Get the version for everything currently installed. - list = pip_command('list', :list).stdout + list = pip_command('list', :list, [], environment: {'PIP_FORMAT' => 'json'}).stdout parse_pip_list(list).each do |name, current| # Merge current versions in to the data. version_data[name][:current] = current @@ -353,15 +359,22 @@ def pip_outdated(requirements) # @param text [String] Output to parse. # @return [Hash] def parse_pip_list(text) - text.split(/\r?\n/).inject({}) do |memo, line| - # Example of a line: - # boto (2.25.0) - if md = line.match(/^(\S+)\s+\(([^\s,]+).*\)$/i) - memo[parse_package_name(md[1])] = md[2] - else - Chef::Log.debug("[#{new_resource}] Unparsable line in pip list: #{line}") + if text[0] == '[' + # Pip 9 or newer, so it understood $PIP_FORMAT=json. + Chef::JSONCompat.parse(text).each_with_object({}) do |data, memo| + memo[data['name']] = data['version'] + end + else + # Pip 8 or earlier, which doesn't support JSON output. + text.split(/\r?\n/).each_with_object({}) do |line, memo| + # Example of a line: + # boto (2.25.0) + if md = line.match(/^(\S+)\s+\(([^\s,]+).*\)$/i) + memo[parse_package_name(md[1])] = md[2] + else + Chef::Log.debug("[#{new_resource}] Unparsable line in pip list: #{line}") + end end - memo end end From 7296fd317f54e93b2069a2d8afc5fe259126e43c Mon Sep 17 00:00:00 2001 From: Noah Kantrowitz Date: Tue, 17 Apr 2018 02:30:07 -0700 Subject: [PATCH 08/31] Add package info for Ubuntu 18.04 and Debian 9/10. --- lib/poise_python/python_providers/system.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/poise_python/python_providers/system.rb b/lib/poise_python/python_providers/system.rb index 4c341e9..e166173 100644 --- a/lib/poise_python/python_providers/system.rb +++ b/lib/poise_python/python_providers/system.rb @@ -28,11 +28,14 @@ class System < Base provides(:system) packages('python', { debian: { + '~> 10.0' => %w{python3.6 python2.7}, + '~> 9.0' => %w{python3.5 python2.7}, '~> 8.0' => %w{python3.4 python2.7}, '~> 7.0' => %w{python3.2 python2.7 python2.6}, '~> 6.0' => %w{python3.1 python2.6 python2.5}, }, ubuntu: { + '18.04' => %w{python3.6 python2.7}, '16.04' => %w{python3.5 python2.7}, '14.04' => %w{python3.4 python2.7}, '12.04' => %w{python3.2 python2.7}, From 63f31624795d471e9f65e11eb029d5278bf3cd88 Mon Sep 17 00:00:00 2001 From: Noah Kantrowitz Date: Tue, 17 Apr 2018 02:30:29 -0700 Subject: [PATCH 09/31] Make sure to allow downgrade when working with pip, since that's almost always what we want. --- lib/poise_python/resources/python_runtime_pip.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/poise_python/resources/python_runtime_pip.rb b/lib/poise_python/resources/python_runtime_pip.rb index 4a51cb8..dac30aa 100644 --- a/lib/poise_python/resources/python_runtime_pip.rb +++ b/lib/poise_python/resources/python_runtime_pip.rb @@ -165,6 +165,7 @@ def install_pip action :upgrade parent_python new_resource.parent version new_resource.version if new_resource.version + allow_downgrade true end end end From 1ffc3123ae5b0abd7a4ba61954d8a86831161ad7 Mon Sep 17 00:00:00 2001 From: Noah Kantrowitz Date: Tue, 17 Apr 2018 02:30:56 -0700 Subject: [PATCH 10/31] Beef up the pip version handling integration tests. --- test/cookbook/recipes/default.rb | 31 ++++++++++++++++--- .../default/serverspec/default_spec.rb | 30 +++++++++++++++++- 2 files changed, 56 insertions(+), 5 deletions(-) diff --git a/test/cookbook/recipes/default.rb b/test/cookbook/recipes/default.rb index 93f5e7f..0a1c1ef 100644 --- a/test/cookbook/recipes/default.rb +++ b/test/cookbook/recipes/default.rb @@ -55,24 +55,47 @@ when 'pypy' python_runtime_test 'pypy' when 'pip' - # Specific test for pip reversion working correctly. + # Some pip-related tests that I don't need to run on every Python version. + # Pip does plenty of testing on different Python versions and I already touch + # the basics. pip_provider = value_for_platform_family(default: :portable_pypy, windows: :msi) + # Check the baseline state, should pull the latest pip. python_runtime 'pip1' do - pip_version '7.1.2' provider pip_provider options path: '/test_pip1' version '' end + # Check installing a requested version. python_runtime 'pip2' do + pip_version '8.1.2' provider pip_provider options path: '/test_pip2' version '' end - python_runtime 'pip2b' do + # Check installing the latest and reverting to an old version. + python_runtime 'pip3' do + provider pip_provider + options path: '/test_pip3' + version '' + end + python_runtime 'pip3b' do pip_version '7.1.2' provider pip_provider - options path: '/test_pip2' + options path: '/test_pip3' version '' end + # Test pip9 specifically just to be safe. + python_runtime 'pip4' do + pip_version '9.0.3' + provider pip_provider + options path: '/test_pip4' + version '' + end + # Run a simple package install on each just to test things. + (1..4).each do |n| + python_package 'structlog' do + python "pip#{n}" + end + end end end diff --git a/test/integration/default/serverspec/default_spec.rb b/test/integration/default/serverspec/default_spec.rb index 31f7612..a286e3e 100644 --- a/test/integration/default/serverspec/default_spec.rb +++ b/test/integration/default/serverspec/default_spec.rb @@ -128,13 +128,41 @@ def self.assert_file(rel_path, should_exist=true, &block) '/bin/pypy' end + # Confirm pip verisons. describe command("/test_pip1#{path_suffix} -m pip --version") do its(:exit_status) { is_expected.to eq 0 } - its(:stdout) { is_expected.to include '7.1.2' } + its(:stdout) { is_expected.to include ' 10.' } end describe command("/test_pip2#{path_suffix} -m pip --version") do + its(:exit_status) { is_expected.to eq 0 } + its(:stdout) { is_expected.to include '8.1.2' } + end + + describe command("/test_pip3#{path_suffix} -m pip --version") do its(:exit_status) { is_expected.to eq 0 } its(:stdout) { is_expected.to include '7.1.2' } end + + describe command("/test_pip4#{path_suffix} -m pip --version") do + its(:exit_status) { is_expected.to eq 0 } + its(:stdout) { is_expected.to include '9.0.3' } + end + + # Check that structlog installed. + describe command("/test_pip1#{path_suffix} -c 'import structlog'") do + its(:exit_status) { is_expected.to eq 0 } + end + + describe command("/test_pip2#{path_suffix} -c 'import structlog'") do + its(:exit_status) { is_expected.to eq 0 } + end + + describe command("/test_pip3#{path_suffix} -c 'import structlog'") do + its(:exit_status) { is_expected.to eq 0 } + end + + describe command("/test_pip4#{path_suffix} -c 'import structlog'") do + its(:exit_status) { is_expected.to eq 0 } + end end From d1060e324bf7b6544f19dc77630e07c52906e9af Mon Sep 17 00:00:00 2001 From: Noah Kantrowitz Date: Tue, 17 Apr 2018 02:31:24 -0700 Subject: [PATCH 11/31] Update test boilerplate. --- .travis.yml | 6 +++++- test/gemfiles/chef-14.0.gemfile | 19 +++++++++++++++++++ test/gemfiles/chef-14.gemfile | 19 +++++++++++++++++++ 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 test/gemfiles/chef-14.0.gemfile create mode 100644 test/gemfiles/chef-14.gemfile diff --git a/.travis.yml b/.travis.yml index 3f845de..174b92e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,9 @@ matrix: gemfile: test/gemfiles/chef-12.gemfile - rvm: 2.4.3 gemfile: test/gemfiles/chef-13.gemfile - - rvm: 2.5.0 + - rvm: 2.5.1 + gemfile: test/gemfiles/chef-14.gemfile + - rvm: 2.5.1 gemfile: test/gemfiles/master.gemfile - rvm: 2.3.1 gemfile: test/gemfiles/chef-12.14.gemfile @@ -55,3 +57,5 @@ matrix: gemfile: test/gemfiles/chef-13.6.gemfile - rvm: 2.4.3 gemfile: test/gemfiles/chef-13.8.gemfile + - rvm: 2.5.1 + gemfile: test/gemfiles/chef-14.0.gemfile diff --git a/test/gemfiles/chef-14.0.gemfile b/test/gemfiles/chef-14.0.gemfile new file mode 100644 index 0000000..31ec48c --- /dev/null +++ b/test/gemfiles/chef-14.0.gemfile @@ -0,0 +1,19 @@ +# +# Copyright 2018, Noah Kantrowitz +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +eval_gemfile File.expand_path('../../../Gemfile', __FILE__) + +gem 'chef', '~> 14.0.202' diff --git a/test/gemfiles/chef-14.gemfile b/test/gemfiles/chef-14.gemfile new file mode 100644 index 0000000..e197a6f --- /dev/null +++ b/test/gemfiles/chef-14.gemfile @@ -0,0 +1,19 @@ +# +# Copyright 2018, Noah Kantrowitz +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +eval_gemfile File.expand_path('../../../Gemfile', __FILE__) + +gem 'chef', '~> 14.0' From 17a02be38c2232b868ac9334936b8e2314db801d Mon Sep 17 00:00:00 2001 From: Noah Kantrowitz Date: Tue, 17 Apr 2018 02:42:33 -0700 Subject: [PATCH 12/31] Do the same name fixing on JSON list output. --- lib/poise_python/resources/python_package.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/poise_python/resources/python_package.rb b/lib/poise_python/resources/python_package.rb index 9eeeee5..059642f 100644 --- a/lib/poise_python/resources/python_package.rb +++ b/lib/poise_python/resources/python_package.rb @@ -362,7 +362,7 @@ def parse_pip_list(text) if text[0] == '[' # Pip 9 or newer, so it understood $PIP_FORMAT=json. Chef::JSONCompat.parse(text).each_with_object({}) do |data, memo| - memo[data['name']] = data['version'] + memo[parse_package_name(data['name'])] = data['version'] end else # Pip 8 or earlier, which doesn't support JSON output. From 2870ae1744cd78620079984d88b49d4def3d18ad Mon Sep 17 00:00:00 2001 From: Noah Kantrowitz Date: Tue, 17 Apr 2018 02:42:39 -0700 Subject: [PATCH 13/31] Fix up unit tests. --- test/spec/resources/python_package_spec.rb | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/test/spec/resources/python_package_spec.rb b/test/spec/resources/python_package_spec.rb index 082e6d9..6e608d8 100644 --- a/test/spec/resources/python_package_spec.rb +++ b/test/spec/resources/python_package_spec.rb @@ -72,7 +72,7 @@ def stub_cmd(cmd, **options) context 'with package_name foo' do let(:package_name) { 'foo' } before do - stub_cmd(%w{-m pip.__main__ list}, stdout: '') + stub_cmd(%w{-m pip.__main__ list}, environment: {'PIP_FORMAT' => 'json'}, stdout: '') stub_cmd(%w{- foo}, input: kind_of(String), stdout: '{"foo":"1.0.0"}') end @@ -83,7 +83,7 @@ def stub_cmd(cmd, **options) context 'with package_name ["foo", "bar"]' do let(:package_name) { %w{foo bar} } before do - stub_cmd(%w{-m pip.__main__ list}, stdout: '') + stub_cmd(%w{-m pip.__main__ list}, environment: {'PIP_FORMAT' => 'json'}, stdout: '') stub_cmd(%w{- foo bar}, input: kind_of(String), stdout: '{"foo":"1.0.0","bar":"2.0.0"}') end @@ -94,7 +94,7 @@ def stub_cmd(cmd, **options) context 'with a package with extras' do let(:package_name) { 'foo[bar]' } before do - stub_cmd(%w{-m pip.__main__ list}, stdout: '') + stub_cmd(%w{-m pip.__main__ list}, environment: {'PIP_FORMAT' => 'json'}, stdout: '') stub_cmd(%w{- foo}, input: kind_of(String), stdout: '{"foo":"1.0.0"}') end @@ -105,7 +105,7 @@ def stub_cmd(cmd, **options) context 'with a package with underscores' do let(:package_name) { 'cx_foo' } before do - stub_cmd(%w{-m pip.__main__ list}, stdout: '') + stub_cmd(%w{-m pip.__main__ list}, environment: {'PIP_FORMAT' => 'json'}, stdout: '') stub_cmd(%w{- cx-foo}, input: kind_of(String), stdout: '{"cx-foo":"1.0.0"}') end @@ -117,7 +117,7 @@ def stub_cmd(cmd, **options) let(:package_name) { 'foo' } before do test_resource.options('--index-url=http://example') - stub_cmd("-m pip.__main__ list --index-url=http://example ", stdout: '', array_13: true) + stub_cmd("-m pip.__main__ list --index-url=http://example ", environment: {'PIP_FORMAT' => 'json'}, stdout: '', array_13: true) stub_cmd("- --index-url=http://example foo", input: kind_of(String), stdout: '{"foo":"1.0.0"}', array_13: true) end @@ -129,7 +129,7 @@ def stub_cmd(cmd, **options) let(:package_name) { 'foo' } before do test_resource.list_options('--index-url=http://example') - stub_cmd("-m pip.__main__ list --index-url=http://example ", stdout: '') + stub_cmd("-m pip.__main__ list --index-url=http://example ", environment: {'PIP_FORMAT' => 'json'}, stdout: '') stub_cmd("- --index-url=http://example foo", input: kind_of(String), stdout: '{"foo":"1.0.0"}') end @@ -141,7 +141,7 @@ def stub_cmd(cmd, **options) let(:package_name) { 'foo' } before do test_resource.list_options(%w{--index-url=http://example}) - stub_cmd(%w{-m pip.__main__ list --index-url=http://example}, stdout: '') + stub_cmd(%w{-m pip.__main__ list --index-url=http://example}, environment: {'PIP_FORMAT' => 'json'}, stdout: '') stub_cmd(%w{- --index-url=http://example foo}, input: kind_of(String), stdout: '{"foo":"1.0.0"}') end @@ -302,6 +302,13 @@ def stub_cmd(cmd, **options) it { is_expected.to eq({'eventlet' => '0.12.1', 'fabric' => '1.9.1', 'fabric-rundeck' => '1.2', 'flake8' => '2.1.0.dev0', 'cx-freeze' => '4.3.4'}) } end # /context with standard content + context 'with JSON content' do + let(:text) { <<-EOH.strip } +[{"name":"eventlet","version":"0.12.1"}, {"name":"Fabric","version":"1.9.1"}, {"name":"fabric-rundeck","version":"1.2"}, {"name":"flake8","version":"2.1.0.dev0"}, {"name":"cx-Freeze","version":"4.3.4"}] +EOH + it { is_expected.to eq({'eventlet' => '0.12.1', 'fabric' => '1.9.1', 'fabric-rundeck' => '1.2', 'flake8' => '2.1.0.dev0', 'cx-freeze' => '4.3.4'}) } + end # /context with JSON content + context 'with malformed content' do let(:text) { <<-EOH } eventlet (0.12.1) From 40df8ae6548470c982d40e45c29157284b3b3489 Mon Sep 17 00:00:00 2001 From: Noah Kantrowitz Date: Tue, 17 Apr 2018 21:51:41 -0700 Subject: [PATCH 14/31] Install argparse because it isn't included on 2.6 and sqlparse needs it. --- lib/poise_python/resources/python_runtime_test.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/poise_python/resources/python_runtime_test.rb b/lib/poise_python/resources/python_runtime_test.rb index 01943be..c41d7d5 100644 --- a/lib/poise_python/resources/python_runtime_test.rb +++ b/lib/poise_python/resources/python_runtime_test.rb @@ -70,6 +70,10 @@ def action_run test_version # Test python_package. + python_package 'argparse' do + # Needed for sqlparse but not in the stdlib until 2.7. + python new_resource.name + end python_package 'sqlparse remove before' do action :remove package_name 'sqlparse' @@ -176,6 +180,7 @@ def action_run end test_import('docopt', python: nil, virtualenv: test_venv, user: test_user) end + end end From 89e4d38cbe1f408b139fe9793b50afbc9b150666 Mon Sep 17 00:00:00 2001 From: Noah Kantrowitz Date: Tue, 17 Apr 2018 21:52:05 -0700 Subject: [PATCH 15/31] Deal with get-pip.py not supporting 2.6 anymore. --- lib/poise_python/resources/python_runtime.rb | 1 + .../resources/python_runtime_pip.rb | 25 +++++++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/lib/poise_python/resources/python_runtime.rb b/lib/poise_python/resources/python_runtime.rb index 4692dd1..9a974a9 100644 --- a/lib/poise_python/resources/python_runtime.rb +++ b/lib/poise_python/resources/python_runtime.rb @@ -51,6 +51,7 @@ class Resource < Chef::Resource # of https://bootstrap.pypa.io/get-pip.py is used. If you want to skip # the pip installer entirely, set {#pip_version} to `false`. # @return [String] + # If this default value changes, fix ths 2.6-compat logic in python_runtime_pip. attribute(:get_pip_url, kind_of: String, default: 'https://bootstrap.pypa.io/get-pip.py') # @!attribute pip_version # Version of pip to install. If set to `true`, the latest available diff --git a/lib/poise_python/resources/python_runtime_pip.rb b/lib/poise_python/resources/python_runtime_pip.rb index dac30aa..dac9cc7 100644 --- a/lib/poise_python/resources/python_runtime_pip.rb +++ b/lib/poise_python/resources/python_runtime_pip.rb @@ -30,6 +30,12 @@ module PythonRuntimePip # Earliest version of pip we will try upgrading in-place. PIP_INPLACE_VERSION = Gem::Version.create('7.0.0') + # Version to trigger the automatic get-pip.py URL fixup on for 2.6 compat. + PY26_FIXUP_VERSION = Gem::Version.create('2.7') + + # Replacement URL for 2.6 compat. + PY26_FIXUP_GETPIP_URL = 'https://bootstrap.pypa.io/2.6/get-pip.py' + # A `python_runtime_pip` resource to install/upgrade pip itself. This is # used internally by `python_runtime` and is not intended to be a public # API. @@ -103,15 +109,30 @@ def action_uninstall # # @return [void] def bootstrap_pip + # If we're on Python 2.6 and using the default get_pip_url, we need to + # switch to a 2.6-compatible version. This kind of sucks because it + # makes the default a magic value but it seems like the safest option. + get_pip_url = new_resource.get_pip_url + if get_pip_url == 'https://bootstrap.pypa.io/get-pip.py' + python_version_cmd = poise_shell_out!([new_resource.parent.python_binary, '--version'], environment: new_resource.parent.python_environment) + # Python 2 puts the output on stderr, 3 is on stdout. You can't make this shit up. + python_version = (python_version_cmd.stdout + python_version_cmd.stderr)[/Python (\S+)/, 1] + Chef::Log.debug("[#{new_resource}] Checking for Python 2.6 fixup of get-pip URL, found Python version #{python_version || '(unknown)'}") + if python_version && Gem::Version.create(python_version) < PY26_FIXUP_VERSION + Chef::Log.debug("[#{new_resource}] Detected old Python, enabling fixup") + get_pip_url = PY26_FIXUP_GETPIP_URL + end + end + # Always updated if we have hit this point. - converge_by("Bootstrapping pip #{new_resource.version || 'latest'} from #{new_resource.get_pip_url}") do + converge_by("Bootstrapping pip #{new_resource.version || 'latest'} from #{get_pip_url}") do # Use a temp file to hold the installer. # Put `Tempfile.create` back when Chef on Windows has a newer Ruby. # Tempfile.create(['get-pip', '.py']) do |temp| temp = Tempfile.new(['get-pip', '.py']) begin # Download the get-pip.py. - get_pip = Chef::HTTP.new(new_resource.get_pip_url).get('') + get_pip = Chef::HTTP.new(get_pip_url).get('') # Write it to the temp file. temp.write(get_pip) # Close the file to flush it. From 2e9abc883b4743b3955a08adfaf7cc4b00b9998a Mon Sep 17 00:00:00 2001 From: Noah Kantrowitz Date: Wed, 18 Apr 2018 01:43:58 -0700 Subject: [PATCH 16/31] Changelog for 1.7. --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5460358..2c7b6b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Poise-Python Changelog +## v1.7.0 + +* Support for Pip 10. +* Support for Chef 14. +* System package info for Ubuntu 18.04 and Debian 9, 10. + ## v1.6.0 * Improved handling for Python 3.3. From c8fba407b939b2e47388b9395bfabc719e1b6a0a Mon Sep 17 00:00:00 2001 From: Noah Kantrowitz Date: Wed, 18 Apr 2018 01:45:45 -0700 Subject: [PATCH 17/31] Bump version for release. --- lib/poise_python/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/poise_python/version.rb b/lib/poise_python/version.rb index d0520c6..7fcba84 100644 --- a/lib/poise_python/version.rb +++ b/lib/poise_python/version.rb @@ -16,5 +16,5 @@ module PoisePython - VERSION = '1.6.1.pre' + VERSION = '1.7.0' end From e7528df332cea433e8676194b33bc2f8c59cc5e1 Mon Sep 17 00:00:00 2001 From: Noah Kantrowitz Date: Wed, 18 Apr 2018 01:45:57 -0700 Subject: [PATCH 18/31] Bump version for dev. --- lib/poise_python/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/poise_python/version.rb b/lib/poise_python/version.rb index 7fcba84..1d9f3d2 100644 --- a/lib/poise_python/version.rb +++ b/lib/poise_python/version.rb @@ -16,5 +16,5 @@ module PoisePython - VERSION = '1.7.0' + VERSION = '1.7.1.pre' end From 861bf06e69131510c49fa5e35869bdba9fb7aabd Mon Sep 17 00:00:00 2001 From: Noah Kantrowitz Date: Wed, 2 May 2018 19:09:15 -0700 Subject: [PATCH 19/31] Put in a special case for Ubuntu 18.04 and Debian 10 with Python 3. Fixes #114. --- lib/poise_python/python_providers/system.rb | 15 ++++++++++++++- test/spec/python_providers/system_spec.rb | 11 +++++++++-- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/lib/poise_python/python_providers/system.rb b/lib/poise_python/python_providers/system.rb index e166173..ba492d9 100644 --- a/lib/poise_python/python_providers/system.rb +++ b/lib/poise_python/python_providers/system.rb @@ -57,9 +57,22 @@ def python_binary def install_python install_system_packages + if node.platform_family?('debian') && system_package_name == 'python3.6' + # Ubuntu 18.04 and Debian 10 have some weird dependency fuckery going on. + _options = options + package %w{python3.6-venv python3.6-distutils} do + action(:upgrade) if _options['package_upgrade'] + end + end end def uninstall_python + if node.platform_family?('debian') && system_package_name == 'python3.6' + # Other side of the depdency nonsense. + package %w{python3.6-venv python3.6-distutils} do + action(:purge) + end + end uninstall_system_packages end @@ -74,7 +87,7 @@ def system_package_candidates(version) end # Aliases for 2 and 3. if version == '3' || version == '' - names.concat(%w{python3.5 python35 python3.4 python34 python3.3 python33 python3.2 python32 python3.1 python31 python3.0 python30 python3}) + names.concat(%w{python3.7 python37 python3.6 python36 python3.5 python35 python3.4 python34 python3.3 python33 python3.2 python32 python3.1 python31 python3.0 python30 python3}) end if version == '2' || version == '' names.concat(%w{python2.7 python27 python2.6 python26 python2.5 python25}) diff --git a/test/spec/python_providers/system_spec.rb b/test/spec/python_providers/system_spec.rb index cd7080b..055fcf9 100644 --- a/test/spec/python_providers/system_spec.rb +++ b/test/spec/python_providers/system_spec.rb @@ -43,7 +43,7 @@ context 'with version ""' do let(:python_version) { '' } - it_behaves_like 'system provider', %w{python3.5 python35 python3.4 python34 python3.3 python33 python3.2 python32 python3.1 python31 python3.0 python30 python3 python2.7 python27 python2.6 python26 python2.5 python25 python}, 'python3.4' + it_behaves_like 'system provider', %w{python3.7 python37 python3.6 python36 python3.5 python35 python3.4 python34 python3.3 python33 python3.2 python32 python3.1 python31 python3.0 python30 python3 python2.7 python27 python2.6 python26 python2.5 python25 python}, 'python3.4' end # /context with version "" context 'with version 2' do @@ -53,7 +53,7 @@ context 'with version 3' do let(:python_version) { '3' } - it_behaves_like 'system provider', %w{python3.5 python35 python3.4 python34 python3.3 python33 python3.2 python32 python3.1 python31 python3.0 python30 python3 python}, 'python3.4' + it_behaves_like 'system provider', %w{python3.7 python37 python3.6 python36 python3.5 python35 python3.4 python34 python3.3 python33 python3.2 python32 python3.1 python31 python3.0 python30 python3 python}, 'python3.4' end # /context with version 3 context 'with version 2.3' do @@ -65,6 +65,13 @@ it_behaves_like 'system provider', %w{python2.3 python23 python}, 'python2.3' end # /context with version 2.3 + context 'on Ubuntu 18.04' do + let(:chefspec_options) { {platform: 'ubuntu', version: '18.04'} } + let(:python_version) { '3.6' } + + it { is_expected.to install_package(%w{python3.6-venv python3.6-distutils}) } + end # /context on Ubuntu 18.04 + context 'on Debian 8' do before { chefspec_options.update(platform: 'debian', version: '8.9') } it_behaves_like 'system provider', 'python3.4' From 7088fb9ed182826191d6d7b2614715740f66ff09 Mon Sep 17 00:00:00 2001 From: Noah Kantrowitz Date: Sat, 1 Sep 2018 21:37:01 -0700 Subject: [PATCH 20/31] Update test boilerplate. --- .travis.yml | 12 ++++++++++++ test/gemfiles/chef-13.10.gemfile | 19 +++++++++++++++++++ test/gemfiles/chef-13.9.gemfile | 19 +++++++++++++++++++ test/gemfiles/chef-13.gemfile | 2 +- test/gemfiles/chef-14.1.gemfile | 19 +++++++++++++++++++ test/gemfiles/chef-14.2.gemfile | 19 +++++++++++++++++++ test/gemfiles/chef-14.3.gemfile | 19 +++++++++++++++++++ test/gemfiles/chef-14.4.gemfile | 19 +++++++++++++++++++ test/gemfiles/chef-14.gemfile | 2 +- 9 files changed, 128 insertions(+), 2 deletions(-) create mode 100644 test/gemfiles/chef-13.10.gemfile create mode 100644 test/gemfiles/chef-13.9.gemfile create mode 100644 test/gemfiles/chef-14.1.gemfile create mode 100644 test/gemfiles/chef-14.2.gemfile create mode 100644 test/gemfiles/chef-14.3.gemfile create mode 100644 test/gemfiles/chef-14.4.gemfile diff --git a/.travis.yml b/.travis.yml index 174b92e..50939a7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -57,5 +57,17 @@ matrix: gemfile: test/gemfiles/chef-13.6.gemfile - rvm: 2.4.3 gemfile: test/gemfiles/chef-13.8.gemfile + - rvm: 2.4.3 + gemfile: test/gemfiles/chef-13.9.gemfile + - rvm: 2.4.3 + gemfile: test/gemfiles/chef-13.10.gemfile - rvm: 2.5.1 gemfile: test/gemfiles/chef-14.0.gemfile + - rvm: 2.5.1 + gemfile: test/gemfiles/chef-14.1.gemfile + - rvm: 2.5.1 + gemfile: test/gemfiles/chef-14.2.gemfile + - rvm: 2.5.1 + gemfile: test/gemfiles/chef-14.3.gemfile + - rvm: 2.5.1 + gemfile: test/gemfiles/chef-14.4.gemfile diff --git a/test/gemfiles/chef-13.10.gemfile b/test/gemfiles/chef-13.10.gemfile new file mode 100644 index 0000000..daf9679 --- /dev/null +++ b/test/gemfiles/chef-13.10.gemfile @@ -0,0 +1,19 @@ +# +# Copyright 2018, Noah Kantrowitz +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +eval_gemfile File.expand_path('../../../Gemfile', __FILE__) + +gem 'chef', '~> 13.10.4' diff --git a/test/gemfiles/chef-13.9.gemfile b/test/gemfiles/chef-13.9.gemfile new file mode 100644 index 0000000..c06de0f --- /dev/null +++ b/test/gemfiles/chef-13.9.gemfile @@ -0,0 +1,19 @@ +# +# Copyright 2018, Noah Kantrowitz +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +eval_gemfile File.expand_path('../../../Gemfile', __FILE__) + +gem 'chef', '~> 13.9.4' diff --git a/test/gemfiles/chef-13.gemfile b/test/gemfiles/chef-13.gemfile index e052337..039b51b 100644 --- a/test/gemfiles/chef-13.gemfile +++ b/test/gemfiles/chef-13.gemfile @@ -16,4 +16,4 @@ eval_gemfile File.expand_path('../../../Gemfile', __FILE__) -gem 'chef', '~> 13.8' +gem 'chef', '~> 13.10' diff --git a/test/gemfiles/chef-14.1.gemfile b/test/gemfiles/chef-14.1.gemfile new file mode 100644 index 0000000..a347dd6 --- /dev/null +++ b/test/gemfiles/chef-14.1.gemfile @@ -0,0 +1,19 @@ +# +# Copyright 2018, Noah Kantrowitz +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +eval_gemfile File.expand_path('../../../Gemfile', __FILE__) + +gem 'chef', '~> 14.1.12' diff --git a/test/gemfiles/chef-14.2.gemfile b/test/gemfiles/chef-14.2.gemfile new file mode 100644 index 0000000..e0db219 --- /dev/null +++ b/test/gemfiles/chef-14.2.gemfile @@ -0,0 +1,19 @@ +# +# Copyright 2018, Noah Kantrowitz +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +eval_gemfile File.expand_path('../../../Gemfile', __FILE__) + +gem 'chef', '~> 14.2.0' diff --git a/test/gemfiles/chef-14.3.gemfile b/test/gemfiles/chef-14.3.gemfile new file mode 100644 index 0000000..b80e938 --- /dev/null +++ b/test/gemfiles/chef-14.3.gemfile @@ -0,0 +1,19 @@ +# +# Copyright 2018, Noah Kantrowitz +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +eval_gemfile File.expand_path('../../../Gemfile', __FILE__) + +gem 'chef', '~> 14.3.37' diff --git a/test/gemfiles/chef-14.4.gemfile b/test/gemfiles/chef-14.4.gemfile new file mode 100644 index 0000000..47651c8 --- /dev/null +++ b/test/gemfiles/chef-14.4.gemfile @@ -0,0 +1,19 @@ +# +# Copyright 2018, Noah Kantrowitz +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +eval_gemfile File.expand_path('../../../Gemfile', __FILE__) + +gem 'chef', '~> 14.4.56' diff --git a/test/gemfiles/chef-14.gemfile b/test/gemfiles/chef-14.gemfile index e197a6f..63ff708 100644 --- a/test/gemfiles/chef-14.gemfile +++ b/test/gemfiles/chef-14.gemfile @@ -16,4 +16,4 @@ eval_gemfile File.expand_path('../../../Gemfile', __FILE__) -gem 'chef', '~> 14.0' +gem 'chef', '~> 14.4' From b56d5d27ec030c7b5475eb40878424b877c91c43 Mon Sep 17 00:00:00 2001 From: Noah Kantrowitz Date: Sat, 1 Sep 2018 21:37:28 -0700 Subject: [PATCH 21/31] Whoops, don't paper over a real API. --- test/spec/resources/pip_requirements_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/spec/resources/pip_requirements_spec.rb b/test/spec/resources/pip_requirements_spec.rb index 554a64d..e34e2d1 100644 --- a/test/spec/resources/pip_requirements_spec.rb +++ b/test/spec/resources/pip_requirements_spec.rb @@ -24,7 +24,7 @@ let(:pip_cwd) { '/test' } step_into(:pip_requirements) before do - allow(File).to receive(:directory?).and_return(false) + allow(File).to receive(:directory?).and_call_original allow(File).to receive(:directory?).with('/test').and_return(true) end before do From 5fc90eff60eb62e0133782ee9c9ad8b306ad1183 Mon Sep 17 00:00:00 2001 From: Jonathan Hartman Date: Mon, 8 Oct 2018 12:34:19 -0700 Subject: [PATCH 22/31] Make the pip hack script compatible with pip 18.1 It [moved](https://github.com/pypa/pip/commit/a5a07fe61c4861c58fded7420c929d56cde11a89) the from_line method in a backwards-incompatible way. This should resolve the remainder of #133. My Python is pretty atrophied, but I tested this against the following recipe and it converged successfully. ```ruby apt_update 'default' python_runtime '2' python_virtualenv '/tmp/piplatest' do python '2' end python_virtualenv '/tmp/pip18' do python '2' pip_version '18.0' end python_virtualenv '/tmp/pip10' do python '2' pip_version '10.0.1' end python_virtualenv '/tmp/pip9' do python '2' pip_version '9.0.3' end ``` --- lib/poise_python/resources/python_package.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/poise_python/resources/python_package.rb b/lib/poise_python/resources/python_package.rb index 059642f..8b8f70c 100644 --- a/lib/poise_python/resources/python_package.rb +++ b/lib/poise_python/resources/python_package.rb @@ -50,7 +50,11 @@ module PythonPackage # Pip 10 moved all internals to their own package. from pip._internal.commands import InstallCommand from pip._internal.index import PackageFinder - from pip._internal.req import InstallRequirement + try: + # Pip 18.1 moved from_line to the constructors + from pip._internal.req.constructors import install_req_from_line + except ImportError: + from pip._internal.req import InstallRequirement packages = {} cmd = InstallCommand() @@ -73,7 +77,10 @@ module PythonPackage finder = PackageFinder(**finder_options) find_all = getattr(finder, 'find_all_candidates', getattr(finder, '_find_all_versions', None)) for arg in args: - req = InstallRequirement.from_line(arg) + try: + req = install_req_from_line(arg) + except NameError: + req = InstallRequirement.from_line(arg) found = finder.find_requirement(req, True) all_candidates = find_all(req.name) candidate = [c for c in all_candidates if c.location == found] From 6e41957043420b168c93e518ac0de2e44d147ced Mon Sep 17 00:00:00 2001 From: Noah Kantrowitz Date: Thu, 18 Oct 2018 13:59:36 -0700 Subject: [PATCH 23/31] Slightly different implementation for the hack script. --- lib/poise_python/resources/python_package.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/poise_python/resources/python_package.rb b/lib/poise_python/resources/python_package.rb index 8b8f70c..64e32e6 100644 --- a/lib/poise_python/resources/python_package.rb +++ b/lib/poise_python/resources/python_package.rb @@ -46,6 +46,7 @@ module PythonPackage from pip.commands import InstallCommand from pip.index import PackageFinder from pip.req import InstallRequirement + install_req_from_line = InstallRequirement.from_line except ImportError: # Pip 10 moved all internals to their own package. from pip._internal.commands import InstallCommand @@ -55,6 +56,7 @@ module PythonPackage from pip._internal.req.constructors import install_req_from_line except ImportError: from pip._internal.req import InstallRequirement + install_req_from_line = InstallRequirement.from_line packages = {} cmd = InstallCommand() @@ -77,10 +79,7 @@ module PythonPackage finder = PackageFinder(**finder_options) find_all = getattr(finder, 'find_all_candidates', getattr(finder, '_find_all_versions', None)) for arg in args: - try: - req = install_req_from_line(arg) - except NameError: - req = InstallRequirement.from_line(arg) + req = install_req_from_line(arg) found = finder.find_requirement(req, True) all_candidates = find_all(req.name) candidate = [c for c in all_candidates if c.location == found] From a0c18011b65945bf84c2526e1e184554543517a8 Mon Sep 17 00:00:00 2001 From: Noah Kantrowitz Date: Thu, 18 Oct 2018 13:59:43 -0700 Subject: [PATCH 24/31] Update for pip 18. --- test/integration/default/serverspec/default_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/default/serverspec/default_spec.rb b/test/integration/default/serverspec/default_spec.rb index a286e3e..6720d74 100644 --- a/test/integration/default/serverspec/default_spec.rb +++ b/test/integration/default/serverspec/default_spec.rb @@ -131,7 +131,7 @@ def self.assert_file(rel_path, should_exist=true, &block) # Confirm pip verisons. describe command("/test_pip1#{path_suffix} -m pip --version") do its(:exit_status) { is_expected.to eq 0 } - its(:stdout) { is_expected.to include ' 10.' } + its(:stdout) { is_expected.to include ' 18.' } end describe command("/test_pip2#{path_suffix} -m pip --version") do From bdce0e1426808c996d7171c04d96ee86b2be145d Mon Sep 17 00:00:00 2001 From: Noah Kantrowitz Date: Thu, 18 Oct 2018 15:54:06 -0700 Subject: [PATCH 25/31] Update minimum Chef version to match ChefSpec. --- .travis.yml | 4 ---- poise-python.gemspec | 2 +- test/gemfiles/chef-12.14.gemfile | 19 ------------------- test/gemfiles/chef-12.15.gemfile | 19 ------------------- 4 files changed, 1 insertion(+), 43 deletions(-) delete mode 100644 test/gemfiles/chef-12.14.gemfile delete mode 100644 test/gemfiles/chef-12.15.gemfile diff --git a/.travis.yml b/.travis.yml index 50939a7..67d30a5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,10 +25,6 @@ matrix: gemfile: test/gemfiles/chef-14.gemfile - rvm: 2.5.1 gemfile: test/gemfiles/master.gemfile - - rvm: 2.3.1 - gemfile: test/gemfiles/chef-12.14.gemfile - - rvm: 2.3.1 - gemfile: test/gemfiles/chef-12.15.gemfile - rvm: 2.3.1 gemfile: test/gemfiles/chef-12.16.gemfile - rvm: 2.3.1 diff --git a/poise-python.gemspec b/poise-python.gemspec index 7263cd1..551dc68 100644 --- a/poise-python.gemspec +++ b/poise-python.gemspec @@ -34,7 +34,7 @@ Gem::Specification.new do |spec| spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = %w{lib} - spec.add_dependency 'chef', '>= 12.14', '< 15' + spec.add_dependency 'chef', '>= 12.16', '< 15' spec.add_dependency 'halite', '~> 1.0' spec.add_dependency 'poise', '~> 2.7' spec.add_dependency 'poise-languages', '~> 2.0' diff --git a/test/gemfiles/chef-12.14.gemfile b/test/gemfiles/chef-12.14.gemfile deleted file mode 100644 index e0cb5c1..0000000 --- a/test/gemfiles/chef-12.14.gemfile +++ /dev/null @@ -1,19 +0,0 @@ -# -# Copyright 2016-2017, Noah Kantrowitz -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -eval_gemfile File.expand_path('../../../Gemfile', __FILE__) - -gem 'chef', '~> 12.14.89' diff --git a/test/gemfiles/chef-12.15.gemfile b/test/gemfiles/chef-12.15.gemfile deleted file mode 100644 index 1095dd8..0000000 --- a/test/gemfiles/chef-12.15.gemfile +++ /dev/null @@ -1,19 +0,0 @@ -# -# Copyright 2016-2017, Noah Kantrowitz -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -eval_gemfile File.expand_path('../../../Gemfile', __FILE__) - -gem 'chef', '~> 12.15.19' From 2e087bf9b0a4ca87d2377494ca910ba1ba1b1aa9 Mon Sep 17 00:00:00 2001 From: Noah Kantrowitz Date: Thu, 18 Oct 2018 16:00:45 -0700 Subject: [PATCH 26/31] Update SCLs. --- lib/poise_python/python_providers/scl.rb | 3 ++- test/spec/python_providers/scl_spec.rb | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/poise_python/python_providers/scl.rb b/lib/poise_python/python_providers/scl.rb index e9f66b2..9f67d40 100644 --- a/lib/poise_python/python_providers/scl.rb +++ b/lib/poise_python/python_providers/scl.rb @@ -26,7 +26,8 @@ module PythonProviders class Scl < Base include PoiseLanguages::Scl::Mixin provides(:scl) - scl_package('3.5.1', 'rh-python35', 'rh-python35-python-devel', '>= 7.0') + scl_package('3.6.3', 'rh-python36', 'rh-python36-python-devel') + scl_package('3.5.1', 'rh-python35', 'rh-python35-python-devel') scl_package('3.4.2', 'rh-python34', 'rh-python34-python-devel') scl_package('3.3.2', 'python33', 'python33-python-devel') scl_package('2.7.8', 'python27', 'python27-python-devel') diff --git a/test/spec/python_providers/scl_spec.rb b/test/spec/python_providers/scl_spec.rb index 1b389cb..2edcec4 100644 --- a/test/spec/python_providers/scl_spec.rb +++ b/test/spec/python_providers/scl_spec.rb @@ -41,7 +41,7 @@ context 'with version ""' do let(:python_version) { '' } - it_behaves_like 'scl provider', 'rh-python35' + it_behaves_like 'scl provider', 'rh-python36' end # /context with version "" context 'with version "2"' do @@ -51,7 +51,7 @@ context 'with version "3"' do let(:python_version) { '3' } - it_behaves_like 'scl provider', 'rh-python35' + it_behaves_like 'scl provider', 'rh-python36' end # /context with version "3" context 'with version "3.3"' do @@ -62,7 +62,7 @@ context 'with version "" on CentOS 6' do let(:chefspec_options) { {platform: 'centos', version: '6.9'} } let(:python_version) { '' } - it_behaves_like 'scl provider', 'rh-python34' + it_behaves_like 'scl provider', 'rh-python36' end # /context with version "" on CentOS 6 context 'action :uninstall' do From c81f29dfb0afd7a714152a9d954b05b3719f728c Mon Sep 17 00:00:00 2001 From: Noah Kantrowitz Date: Thu, 18 Oct 2018 16:01:48 -0700 Subject: [PATCH 27/31] Starting changelog for 1.7.1. --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c7b6b5..485d49a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Poise-Python Changelog +## v1.7.1 + +* Support for Pip 18.1. +* Improved support for Python 3 on Ubuntu 18.04. +* Update SCL packages. + ## v1.7.0 * Support for Pip 10. From 39f911f78527e06cd6da93e7c4e07ae595cd6dda Mon Sep 17 00:00:00 2001 From: Noah Kantrowitz Date: Thu, 18 Oct 2018 17:15:22 -0700 Subject: [PATCH 28/31] Try switching to a VM builder to see if it is faster. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 67d30a5..e3abcaa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ dist: trusty -sudo: false +sudo: required cache: bundler language: ruby env: From d46e498333a82dba5aee070cad23dc5b34b19a24 Mon Sep 17 00:00:00 2001 From: Noah Kantrowitz Date: Fri, 19 Oct 2018 12:24:50 -0700 Subject: [PATCH 29/31] Switch to concurrent Kitchen to get the test times down so maybe they pass. --- .travis.yml | 2 +- Gemfile | 2 +- Rakefile | 1 + test/gemfiles/master.gemfile | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index e3abcaa..67d30a5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ dist: trusty -sudo: required +sudo: false cache: bundler language: ruby env: diff --git a/Gemfile b/Gemfile index 0640ad1..9e743bc 100644 --- a/Gemfile +++ b/Gemfile @@ -27,7 +27,7 @@ def dev_gem(name, path: File.join('..', name), github: nil) end end -dev_gem 'halite' +dev_gem 'halite', github: true dev_gem 'poise' dev_gem 'poise-archive' dev_gem 'poise-boiler' diff --git a/Rakefile b/Rakefile index d2b12d0..cb942ad 100644 --- a/Rakefile +++ b/Rakefile @@ -14,4 +14,5 @@ # limitations under the License. # +ENV['KITCHEN_CONCURRENCY'] = '10' require 'poise_boiler/rakefile' diff --git a/test/gemfiles/master.gemfile b/test/gemfiles/master.gemfile index 18d3604..15f3464 100644 --- a/test/gemfiles/master.gemfile +++ b/test/gemfiles/master.gemfile @@ -20,7 +20,7 @@ gem 'chef', git: 'https://github.com/chef/chef.git' gem 'chefspec', git: 'https://github.com/sethvargo/chefspec.git' gem 'fauxhai', git: 'https://github.com/customink/fauxhai.git' gem 'foodcritic', git: 'https://github.com/foodcritic/foodcritic.git' -gem 'halite', git: 'https://github.com/poise/halite.git' +# gem 'halite', git: 'https://github.com/poise/halite.git' gem 'ohai', git: 'https://github.com/chef/ohai.git' gem 'poise', git: 'https://github.com/poise/poise.git' gem 'poise-archive', git: 'https://github.com/poise/poise-archive.git' From 0a0d548bbbb42ec855d5ec8e963c4007801f1886 Mon Sep 17 00:00:00 2001 From: Noah Kantrowitz Date: Fri, 19 Oct 2018 16:03:19 -0700 Subject: [PATCH 30/31] Whoops. --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 9e743bc..a72fef5 100644 --- a/Gemfile +++ b/Gemfile @@ -27,7 +27,7 @@ def dev_gem(name, path: File.join('..', name), github: nil) end end -dev_gem 'halite', github: true +dev_gem 'halite', github: 'poise/halite' dev_gem 'poise' dev_gem 'poise-archive' dev_gem 'poise-boiler' From eeb0fc0ee50e8baef15ab4f91601994e5b40a272 Mon Sep 17 00:00:00 2001 From: Noah Kantrowitz Date: Sat, 20 Oct 2018 15:19:00 -0700 Subject: [PATCH 31/31] Trim the platforms to try and speed up the tests. --- .kitchen.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.kitchen.yml b/.kitchen.yml index 919aef4..4038f00 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -1,3 +1,3 @@ --- #<% require 'poise_boiler' %> -<%= PoiseBoiler.kitchen %> +<%= PoiseBoiler.kitchen(platforms: %w{ubuntu-16.04 centos-7}) %>