poise-python 1.4.0 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a12da22a9f150574726a0269d44cb5eacbdcb924
4
- data.tar.gz: 4ece1e0b399f553cf09a115ef1ccdf733454d86d
3
+ metadata.gz: 7500de072f7a8087c804a127c870a8c6b16b5aca
4
+ data.tar.gz: d600e7a8144e251e8d2faa81bb8da5d1a58dcdad
5
5
  SHA512:
6
- metadata.gz: d45e0538ac533f844e9e8e9d0f8ce88edbb9b88594ecb8a5577fc8e44166aeb2a885e544e8a46aeb1593075a50e386d63c04e349e1ab9bc8b8b660ca903aad7a
7
- data.tar.gz: db9ebcab6fb2dc3ebcb28eafc533d9e88223d53003703238d1398079546c2f3946c609292ba26922eb49da6df3f936f02c788f80887c9c22e90c46646f53fc8d
6
+ metadata.gz: d0673eb2b7dfe1d1b3e946edb8de5d8ff4c8a7253ce7499f608e8f6321698bba79c21b9d66b8df3706f2855d71225ef8c3278bda434dbad5e5d2b9d17869bf73
7
+ data.tar.gz: b995f972baacd4f6482cae93ec8405194a7e1ad9584b7df66bab06066aa2df5a54e9ba270b2778c62c0a7df3d88336efbf2924d51400af8cb7af9e4bd5559136
data/.travis.yml CHANGED
@@ -1,22 +1,42 @@
1
- ---
2
1
  sudo: false
3
2
  cache: bundler
4
3
  language: ruby
5
- rvm:
6
- - '2.2'
7
4
  env:
8
5
  global:
9
- - secure: j4GV/0NXC6p/+XxgK2isMCzccR7ry8cxLJZZbJN5P+958lLGmYtPPsfAN+aRzcR3Uc/alLcsjXvceCjJWU7qYpkN1x9cn564J1X3OIOygi6xdYQIMLL5Guxp01QYabFlrmZeUnTVMTkdR1H4aRrpzW4kTuc5hbIZaJl0enEe1Dd+vbCw2GOTXFnPTeLDCaCSNXXhXmqqWD64leFR2PTwx8fwrXyCB/bDRXhFdsFA5Q/tCGW7PDaYujbqSCegpuz+uvHoM5S2k2XY3pShWZm9WcmEzCLEfhOGCc1s+ia7TZ0iV7kzEq11mNTdSl6nJtBUiKsgqw1TRPFhhUj2Bp/K+cNsd06rtFE3In2zbqbgyJ0qnyQHs2FZO//ve8bug+B0lA3i6SantruS1Fc9NjwjqzOmqmaqNhnVl1jEQTOB3JUC465QShySF0aJtjE5khD7PzGwCw6cqhPBLH5ZTmqCYvl/egYLMlvVr1Nboa+0YFdzUqoTFJpRTsu89l8+1+Eu9pvHn0CwsjWmEVHahIw/GEBjhLPDinquJNxWz1q49ozlohntbRmWhbgzz6D4wPrbBdyW7rYm8p6d2sOy6Op2zsVv4c7Dj3pcLLd9J5o6RaNxf4wLd5VFLNJR6/wldsZXGxV/iP16oyasabYIQYZNbP0U1hZiUpLQ5cvKYc6xRTM=
10
- before_install: "gem install bundler"
11
- bundler_args: "--binstubs=$PWD/bin --jobs 3 --retry 3"
6
+ - secure: j4GV/0NXC6p/+XxgK2isMCzccR7ry8cxLJZZbJN5P+958lLGmYtPPsfAN+aRzcR3Uc/alLcsjXvceCjJWU7qYpkN1x9cn564J1X3OIOygi6xdYQIMLL5Guxp01QYabFlrmZeUnTVMTkdR1H4aRrpzW4kTuc5hbIZaJl0enEe1Dd+vbCw2GOTXFnPTeLDCaCSNXXhXmqqWD64leFR2PTwx8fwrXyCB/bDRXhFdsFA5Q/tCGW7PDaYujbqSCegpuz+uvHoM5S2k2XY3pShWZm9WcmEzCLEfhOGCc1s+ia7TZ0iV7kzEq11mNTdSl6nJtBUiKsgqw1TRPFhhUj2Bp/K+cNsd06rtFE3In2zbqbgyJ0qnyQHs2FZO//ve8bug+B0lA3i6SantruS1Fc9NjwjqzOmqmaqNhnVl1jEQTOB3JUC465QShySF0aJtjE5khD7PzGwCw6cqhPBLH5ZTmqCYvl/egYLMlvVr1Nboa+0YFdzUqoTFJpRTsu89l8+1+Eu9pvHn0CwsjWmEVHahIw/GEBjhLPDinquJNxWz1q49ozlohntbRmWhbgzz6D4wPrbBdyW7rYm8p6d2sOy6Op2zsVv4c7Dj3pcLLd9J5o6RaNxf4wLd5VFLNJR6/wldsZXGxV/iP16oyasabYIQYZNbP0U1hZiUpLQ5cvKYc6xRTM=
7
+ before_install: gem install bundler
8
+ bundler_args: '--binstubs=$PWD/bin --jobs 3 --retry 3'
12
9
  script:
13
- - "./bin/rake travis"
14
- gemfile:
15
- - test/gemfiles/chef-12.gemfile
16
- - test/gemfiles/chef-12.1.gemfile
17
- - test/gemfiles/chef-12.2.gemfile
18
- - test/gemfiles/chef-12.3.gemfile
19
- - test/gemfiles/chef-12.4.gemfile
20
- - test/gemfiles/chef-12.5.gemfile
21
- - test/gemfiles/chef-12.6.gemfile
22
- - test/gemfiles/master.gemfile
10
+ - ./bin/rake travis
11
+ matrix:
12
+ include:
13
+ - rvm: 2.1.9
14
+ gemfile: test/gemfiles/chef-12.gemfile
15
+ - rvm: 2.1.4
16
+ gemfile: test/gemfiles/chef-12.1.gemfile
17
+ - rvm: 2.1.4
18
+ gemfile: test/gemfiles/chef-12.2.gemfile
19
+ - rvm: 2.1.4
20
+ gemfile: test/gemfiles/chef-12.3.gemfile
21
+ - rvm: 2.1.6
22
+ gemfile: test/gemfiles/chef-12.4.gemfile
23
+ - rvm: 2.1.6
24
+ gemfile: test/gemfiles/chef-12.5.gemfile
25
+ - rvm: 2.1.6
26
+ gemfile: test/gemfiles/chef-12.6.gemfile
27
+ - rvm: 2.1.6
28
+ gemfile: test/gemfiles/chef-12.7.gemfile
29
+ - rvm: 2.1.6
30
+ gemfile: test/gemfiles/chef-12.8.gemfile
31
+ - rvm: 2.1.8
32
+ gemfile: test/gemfiles/chef-12.9.gemfile
33
+ - rvm: 2.1.8
34
+ gemfile: test/gemfiles/chef-12.10.gemfile
35
+ - rvm: 2.1.8
36
+ gemfile: test/gemfiles/chef-12.11.gemfile
37
+ - rvm: 2.1.8
38
+ gemfile: test/gemfiles/chef-12.12.gemfile
39
+ - rvm: 2.1.9
40
+ gemfile: test/gemfiles/chef-12.13.gemfile
41
+ - rvm: 2.3.1
42
+ gemfile: test/gemfiles/master.gemfile
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Poise-Python Changelog
2
2
 
3
+ ## v1.5.0
4
+
5
+ * Support new SCL structure and packages.
6
+
3
7
  ## v1.4.0
4
8
 
5
9
  * Add system package names for Ubuntu 16.04.
data/Gemfile CHANGED
@@ -31,5 +31,5 @@ dev_gem 'halite'
31
31
  dev_gem 'poise'
32
32
  dev_gem 'poise-archive'
33
33
  dev_gem 'poise-boiler'
34
- dev_gem 'poise-languages'
34
+ dev_gem 'poise-languages', github: 'poise/poise-languages'
35
35
  dev_gem 'poise-profiler'
data/README.md CHANGED
@@ -27,6 +27,30 @@ end
27
27
  pip_requirements '/opt/myapp/requirements.txt'
28
28
  ```
29
29
 
30
+ ## Installing a Package From a URI
31
+
32
+ While using `python_package 'git+https://github.com/example/mypackage.git'` will
33
+ sometimes work, this approach is not recommended. Unfortunately pip's support
34
+ for installing directly from URI sources is limited and cannot support the API
35
+ used for the `python_package` resource. You can run the install either directly
36
+ from the URI or through an intermediary `git` resource:
37
+
38
+ ```ruby
39
+ # Will re-install on every converge unless you add a not_if/only_if.
40
+ python_execute '-m pip install git+https://github.com/example/mypackage.git'
41
+
42
+ # Will only re-install when the git repository updates.
43
+ python_execute 'install mypackage' do
44
+ action :nothing
45
+ command '-m pip install .'
46
+ cwd '/opt/mypackage'
47
+ end
48
+ git '/opt/mypackage' do
49
+ repository 'https://github.com/example/mypackage.git'
50
+ notifies :run, 'python_execute[install mypackage]', :immediately
51
+ end
52
+ ```
53
+
30
54
  ## Supported Python Versions
31
55
 
32
56
  This cookbook can install at least Python 2.7, Python 3, and PyPy on all
@@ -77,9 +101,11 @@ python_runtime '2'
77
101
 
78
102
  * `version` – Version of Python to install. If a partial version is given, use the
79
103
  latest available version matching that prefix. *(name property)*
104
+ * `get_pip_url` – URL to download the `get-pip.py` bootstrap script from.
105
+ *(default: https://bootstrap.pypa.io/get-pip.py)*
80
106
  * `pip_version` – Version of pip to install. If set to `true`, use the latest.
81
- If set to `false`, do not install pip. Can also be set to a URL to a copy of
82
- the `get-pip.py` script. *(default: true)*
107
+ If set to `false`, do not install pip. For backward compatibility, can also be
108
+ set to a URL instead of `get_pip_url`. *(default: true)*
83
109
  * `setuptools_version` – Version of Setuptools to install. If set to `true`, use
84
110
  the latest. If set to `false`, do not install Setuptools. *(default: true)*
85
111
  * `virtualenv_version` – Version of virtualenv to install. If set to `true`,
@@ -28,6 +28,7 @@ module PoisePython
28
28
  # @api private
29
29
  def self.default_inversion_options(node, new_resource)
30
30
  super.merge({
31
+ get_pip_url: new_resource.get_pip_url,
31
32
  pip_version: new_resource.pip_version,
32
33
  setuptools_version: new_resource.setuptools_version,
33
34
  version: new_resource.version,
@@ -103,13 +104,14 @@ module PoisePython
103
104
  def install_pip
104
105
  pip_version_or_url = options[:pip_version]
105
106
  return unless pip_version_or_url
106
- # If there is a : in the version, use it as a URL.
107
+ # If there is a : in the version, use it as a URL and ignore the actual
108
+ # URL option.
107
109
  if pip_version_or_url.is_a?(String) && pip_version_or_url.include?(':')
108
110
  pip_version = nil
109
111
  pip_url = pip_version_or_url
110
112
  else
111
113
  pip_version = pip_version_or_url
112
- pip_url = nil
114
+ pip_url = options[:get_pip_url]
113
115
  end
114
116
  Chef::Log.debug("[#{new_resource}] Installing pip #{pip_version || 'latest'}")
115
117
  # Install or bootstrap pip.
@@ -117,7 +119,7 @@ module PoisePython
117
119
  parent new_resource
118
120
  # If the version is `true`, don't pass it at all.
119
121
  version pip_version if pip_version.is_a?(String)
120
- get_pip_url pip_url if pip_url
122
+ get_pip_url pip_url
121
123
  end
122
124
  end
123
125
 
@@ -26,32 +26,10 @@ module PoisePython
26
26
  class Scl < Base
27
27
  include PoiseLanguages::Scl::Mixin
28
28
  provides(:scl)
29
- scl_package('3.4.2', 'rh-python34', 'rh-python34-python-devel', {
30
- ['redhat', 'centos'] => {
31
- '~> 7.0' => 'https://www.softwarecollections.org/en/scls/rhscl/rh-python34/epel-7-x86_64/download/rhscl-rh-python34-epel-7-x86_64.noarch.rpm',
32
- '~> 6.0' => 'https://www.softwarecollections.org/en/scls/rhscl/rh-python34/epel-6-x86_64/download/rhscl-rh-python34-epel-6-x86_64.noarch.rpm',
33
- },
34
- })
35
- scl_package('3.3.2', 'python33', 'python33-python-devel', {
36
- ['redhat', 'centos'] => {
37
- '~> 7.0' => 'https://www.softwarecollections.org/en/scls/rhscl/python33/epel-7-x86_64/download/rhscl-python33-epel-7-x86_64.noarch.rpm',
38
- '~> 6.0' => 'https://www.softwarecollections.org/en/scls/rhscl/python33/epel-6-x86_64/download/rhscl-python33-epel-6-x86_64.noarch.rpm',
39
- },
40
- 'fedora' => {
41
- '~> 21.0' => 'https://www.softwarecollections.org/en/scls/rhscl/python33/fedora-21-x86_64/download/rhscl-python33-fedora-21-x86_64.noarch.rpm',
42
- '~> 20.0' => 'https://www.softwarecollections.org/en/scls/rhscl/python33/fedora-20-x86_64/download/rhscl-python33-fedora-20-x86_64.noarch.rpm',
43
- },
44
- })
45
- scl_package('2.7.8', 'python27', 'python27-python-devel', {
46
- ['redhat', 'centos'] => {
47
- '~> 7.0' => 'https://www.softwarecollections.org/en/scls/rhscl/python27/epel-7-x86_64/download/rhscl-python27-epel-7-x86_64.noarch.rpm',
48
- '~> 6.0' => 'https://www.softwarecollections.org/en/scls/rhscl/python27/epel-6-x86_64/download/rhscl-python27-epel-6-x86_64.noarch.rpm',
49
- },
50
- 'fedora' => {
51
- '~> 21.0' => 'https://www.softwarecollections.org/en/scls/rhscl/python27/fedora-21-x86_64/download/rhscl-python27-fedora-21-x86_64.noarch.rpm',
52
- '~> 20.0' => 'https://www.softwarecollections.org/en/scls/rhscl/python27/fedora-20-x86_64/download/rhscl-python27-fedora-20-x86_64.noarch.rpm',
53
- },
54
- })
29
+ scl_package('3.5.1', 'rh-python35', 'rh-python35-python-devel', '>= 7.0')
30
+ scl_package('3.4.2', 'rh-python34', 'rh-python34-python-devel')
31
+ scl_package('3.3.2', 'python33', 'python33-python-devel')
32
+ scl_package('2.7.8', 'python27', 'python27-python-devel')
55
33
 
56
34
  def python_binary
57
35
  ::File.join(scl_folder, 'root', 'usr', 'bin', 'python')
@@ -46,22 +46,20 @@ module PoisePython
46
46
  # @example Install Python 2.7
47
47
  # python_runtime '2.7'
48
48
  attribute(:version, kind_of: String, name_attribute: true)
49
+ # @!attribute get_pip_url
50
+ # URL to download the get-pip.py script from. If not sure, the default
51
+ # of https://bootstrap.pypa.io/get-pip.py is used. If you want to skip
52
+ # the pip installer entirely, set {#pip_version} to `false`.
53
+ # @return [String]
54
+ attribute(:get_pip_url, kind_of: String, default: 'https://bootstrap.pypa.io/get-pip.py')
49
55
  # @!attribute pip_version
50
56
  # Version of pip to install. If set to `true`, the latest available
51
57
  # pip will be used. If set to `false`, pip will not be installed. If
52
- # set to a URL, that will be used as the URL to get-pip.py. If a
53
- # non-URL version is given, the get-pip.py installer will be
54
- # downloaded from the internet.
55
- # @note Due to https://github.com/pypa/pip/issues/1087, the latest
56
- # version of pip will always be installed initially. It will then
57
- # downgrade to the requested version if needed.
58
+ # set to a URL, that will be used as the URL to get-pip.py instead of
59
+ # {#get_pip_url}.
58
60
  # @note Disabling the pip install may result in other resources being
59
61
  # non-functional.
60
62
  # @return [String, Boolean]
61
- # @example Install from a locally-hosted copy of get-pip.py
62
- # python_runtime '2' do
63
- # pip_version 'http://myserver/get-pip.py'
64
- # end
65
63
  attribute(:pip_version, kind_of: [String, TrueClass, FalseClass], default: true)
66
64
  # @!attribute setuptools_version
67
65
  # Version of Setuptools to install. It set to `true`, the latest
@@ -26,8 +26,6 @@ module PoisePython
26
26
  # @since 1.0.0
27
27
  # @api private
28
28
  module PythonRuntimePip
29
- # URL for the default get-pip.py script.
30
- DEFAULT_GET_PIP_URL = 'https://bootstrap.pypa.io/get-pip.py'
31
29
  # Earliest version of pip we will try upgrading in-place.
32
30
  PIP_INPLACE_VERSION = Gem::Version.create('7.0.0')
33
31
 
@@ -49,9 +47,9 @@ module PoisePython
49
47
  # @return [String]
50
48
  attribute(:version, kind_of: String)
51
49
  # @!attribute get_pip_url
52
- # URL to the get-pip.py script. Defaults to pulling it from pypa.io.
50
+ # URL to the get-pip.py script.
53
51
  # @return [String]
54
- attribute(:get_pip_url, kind_of: String, default: DEFAULT_GET_PIP_URL)
52
+ attribute(:get_pip_url, kind_of: String, required: true)
55
53
  end
56
54
 
57
55
  # The default provider for `python_runtime_pip`.
@@ -16,5 +16,5 @@
16
16
 
17
17
 
18
18
  module PoisePython
19
- VERSION = '1.4.0'
19
+ VERSION = '1.5.0'
20
20
  end
data/poise-python.gemspec CHANGED
@@ -33,9 +33,10 @@ Gem::Specification.new do |spec|
33
33
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
34
34
  spec.require_paths = %w{lib}
35
35
 
36
+ spec.add_dependency 'chef', '~> 12.1'
36
37
  spec.add_dependency 'halite', '~> 1.0'
37
38
  spec.add_dependency 'poise', '~> 2.7'
38
- spec.add_dependency 'poise-languages', '~> 1.3'
39
+ spec.add_dependency 'poise-languages', '~> 2.0'
39
40
 
40
41
  spec.add_development_dependency 'poise-boiler', '~> 1.8'
41
42
  end
@@ -17,3 +17,4 @@
17
17
  eval_gemfile File.expand_path('../../../Gemfile', __FILE__)
18
18
 
19
19
  gem 'chef', '~> 12.1.2'
20
+ gem 'rack', '< 2'
@@ -0,0 +1,20 @@
1
+ #
2
+ # Copyright 2016, Noah Kantrowitz
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ eval_gemfile File.expand_path('../../../Gemfile', __FILE__)
18
+
19
+ gem 'chef', '~> 12.10.24'
20
+ gem 'rack', '< 2'
@@ -0,0 +1,20 @@
1
+ #
2
+ # Copyright 2016, Noah Kantrowitz
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ eval_gemfile File.expand_path('../../../Gemfile', __FILE__)
18
+
19
+ gem 'chef', '~> 12.11.18'
20
+ gem 'rack', '< 2'
@@ -0,0 +1,19 @@
1
+ #
2
+ # Copyright 2016, Noah Kantrowitz
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ eval_gemfile File.expand_path('../../../Gemfile', __FILE__)
18
+
19
+ gem 'chef', '~> 12.12.15'
@@ -0,0 +1,19 @@
1
+ #
2
+ # Copyright 2016, Noah Kantrowitz
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ eval_gemfile File.expand_path('../../../Gemfile', __FILE__)
18
+
19
+ gem 'chef', '~> 12.13.37'
@@ -17,3 +17,4 @@
17
17
  eval_gemfile File.expand_path('../../../Gemfile', __FILE__)
18
18
 
19
19
  gem 'chef', '~> 12.2.1'
20
+ gem 'rack', '< 2'
@@ -17,3 +17,4 @@
17
17
  eval_gemfile File.expand_path('../../../Gemfile', __FILE__)
18
18
 
19
19
  gem 'chef', '~> 12.3.0'
20
+ gem 'rack', '< 2'
@@ -17,5 +17,5 @@
17
17
  eval_gemfile File.expand_path('../../../Gemfile', __FILE__)
18
18
 
19
19
  gem 'chef', '~> 12.4.3'
20
- # Pending https://github.com/berkshelf/ridley/pull/335
20
+ gem 'rack', '< 2'
21
21
  gem 'ridley', '4.4.1'
@@ -17,3 +17,4 @@
17
17
  eval_gemfile File.expand_path('../../../Gemfile', __FILE__)
18
18
 
19
19
  gem 'chef', '~> 12.5.1'
20
+ gem 'rack', '< 2'
@@ -17,3 +17,4 @@
17
17
  eval_gemfile File.expand_path('../../../Gemfile', __FILE__)
18
18
 
19
19
  gem 'chef', '~> 12.6.0'
20
+ gem 'rack', '< 2'
@@ -0,0 +1,20 @@
1
+ #
2
+ # Copyright 2015-2016, Noah Kantrowitz
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ eval_gemfile File.expand_path('../../../Gemfile', __FILE__)
18
+
19
+ gem 'chef', '~> 12.7.2'
20
+ gem 'rack', '< 2'
@@ -0,0 +1,20 @@
1
+ #
2
+ # Copyright 2015-2016, Noah Kantrowitz
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ eval_gemfile File.expand_path('../../../Gemfile', __FILE__)
18
+
19
+ gem 'chef', '~> 12.8.1'
20
+ gem 'rack', '< 2'
@@ -0,0 +1,20 @@
1
+ #
2
+ # Copyright 2016, Noah Kantrowitz
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ eval_gemfile File.expand_path('../../../Gemfile', __FILE__)
18
+
19
+ gem 'chef', '~> 12.9.41'
20
+ gem 'rack', '< 2'
@@ -16,4 +16,4 @@
16
16
 
17
17
  eval_gemfile File.expand_path('../../../Gemfile', __FILE__)
18
18
 
19
- gem 'chef', '~> 12.6'
19
+ gem 'chef', '~> 12.13'
@@ -21,5 +21,5 @@ gem 'halite', github: 'poise/halite'
21
21
  gem 'poise', github: 'poise/poise'
22
22
  gem 'poise-archive', github: 'poise/poise-archive'
23
23
  gem 'poise-boiler', github: 'poise/poise-boiler'
24
- gem 'poise-languages', github: 'poise/poise-languages'
24
+ # gem 'poise-languages', github: 'poise/poise-languages'
25
25
  gem 'poise-profiler', github: 'poise/poise-profiler'
@@ -41,7 +41,7 @@ describe PoisePython::PythonProviders::Scl do
41
41
 
42
42
  context 'with version ""' do
43
43
  let(:python_version) { '' }
44
- it_behaves_like 'scl provider', 'rh-python34'
44
+ it_behaves_like 'scl provider', 'rh-python35'
45
45
  end # /context with version ""
46
46
 
47
47
  context 'with version "2"' do
@@ -51,7 +51,7 @@ describe PoisePython::PythonProviders::Scl do
51
51
 
52
52
  context 'with version "3"' do
53
53
  let(:python_version) { '3' }
54
- it_behaves_like 'scl provider', 'rh-python34'
54
+ it_behaves_like 'scl provider', 'rh-python35'
55
55
  end # /context with version "3"
56
56
 
57
57
  context 'with version "3.3"' do
@@ -59,6 +59,12 @@ describe PoisePython::PythonProviders::Scl do
59
59
  it_behaves_like 'scl provider', 'python33'
60
60
  end # /context with version "3.3"
61
61
 
62
+ context 'with version "" on CentOS 6' do
63
+ let(:chefspec_options) { {platform: 'centos', version: '6.0'} }
64
+ let(:python_version) { '' }
65
+ it_behaves_like 'scl provider', 'rh-python34'
66
+ end # /context with version "" on CentOS 6
67
+
62
68
  context 'action :uninstall' do
63
69
  recipe do
64
70
  python_runtime 'test' do
@@ -20,7 +20,9 @@ describe PoisePython::Resources::PythonRuntimePip do
20
20
  step_into(:python_runtime_pip)
21
21
  recipe do
22
22
  python_runtime 'test'
23
- python_runtime_pip 'test'
23
+ python_runtime_pip 'test' do
24
+ get_pip_url 'http://example.com/'
25
+ end
24
26
  end
25
27
  before do
26
28
  provider = PoisePython::Resources::PythonRuntimePip::Provider
@@ -0,0 +1,83 @@
1
+ #
2
+ # Copyright 2015-2016, Noah Kantrowitz
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ require 'spec_helper'
18
+
19
+ class PythonRuntimeTestProvider < PoisePython::PythonProviders::Base
20
+ provides(:test)
21
+ def self.provides_auto?(*args)
22
+ true
23
+ end
24
+ def python_binary
25
+ '/python'
26
+ end
27
+ def install_python
28
+ end
29
+ def uninstall_python
30
+ end
31
+ end
32
+
33
+ describe PoisePython::Resources::PythonRuntime do
34
+ step_into(:python_runtime)
35
+ let(:venv_installed) { false }
36
+ before do
37
+ allow_any_instance_of(PythonRuntimeTestProvider).to receive(:poise_shell_out).with(%w{/python -m venv -h}, environment: {}).and_return(double(error?: !venv_installed))
38
+ end
39
+
40
+ context 'with defaults' do
41
+ recipe do
42
+ python_runtime 'test' do
43
+ provider :test
44
+ end
45
+ end
46
+
47
+ it { is_expected.to install_python_runtime_pip('test').with(version: nil, get_pip_url: 'https://bootstrap.pypa.io/get-pip.py') }
48
+ end # /context with defaults
49
+
50
+ context 'with a pip_version' do
51
+ recipe do
52
+ python_runtime 'test' do
53
+ provider :test
54
+ pip_version '1.2.3'
55
+ end
56
+ end
57
+
58
+ it { is_expected.to install_python_runtime_pip('test').with(version: '1.2.3', get_pip_url: 'https://bootstrap.pypa.io/get-pip.py') }
59
+ end # /context with a pip_version
60
+
61
+ context 'with a pip_version URL' do
62
+ recipe do
63
+ python_runtime 'test' do
64
+ provider :test
65
+ pip_version 'http://example.com/get-pip.py'
66
+ end
67
+ end
68
+
69
+ it { is_expected.to install_python_runtime_pip('test').with(version: nil, get_pip_url: 'http://example.com/get-pip.py') }
70
+ end # /context with a pip_version URL
71
+
72
+ context 'with a pip_version and a get_pip_url' do
73
+ recipe do
74
+ python_runtime 'test' do
75
+ provider :test
76
+ pip_version '1.2.3'
77
+ get_pip_url 'http://example.com/get-pip.py'
78
+ end
79
+ end
80
+
81
+ it { is_expected.to install_python_runtime_pip('test').with(version: '1.2.3', get_pip_url: 'http://example.com/get-pip.py') }
82
+ end # /context with a pip_version and a get_pip_url
83
+ end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: poise-python
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Noah Kantrowitz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-06 00:00:00.000000000 Z
11
+ date: 2016-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: chef
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '12.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '12.1'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: halite
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -44,14 +58,14 @@ dependencies:
44
58
  requirements:
45
59
  - - "~>"
46
60
  - !ruby/object:Gem::Version
47
- version: '1.3'
61
+ version: '2.0'
48
62
  type: :runtime
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
51
65
  requirements:
52
66
  - - "~>"
53
67
  - !ruby/object:Gem::Version
54
- version: '1.3'
68
+ version: '2.0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: poise-boiler
57
71
  requirement: !ruby/object:Gem::Requirement
@@ -113,11 +127,18 @@ files:
113
127
  - test/docker/docker.ca
114
128
  - test/docker/docker.pem
115
129
  - test/gemfiles/chef-12.1.gemfile
130
+ - test/gemfiles/chef-12.10.gemfile
131
+ - test/gemfiles/chef-12.11.gemfile
132
+ - test/gemfiles/chef-12.12.gemfile
133
+ - test/gemfiles/chef-12.13.gemfile
116
134
  - test/gemfiles/chef-12.2.gemfile
117
135
  - test/gemfiles/chef-12.3.gemfile
118
136
  - test/gemfiles/chef-12.4.gemfile
119
137
  - test/gemfiles/chef-12.5.gemfile
120
138
  - test/gemfiles/chef-12.6.gemfile
139
+ - test/gemfiles/chef-12.7.gemfile
140
+ - test/gemfiles/chef-12.8.gemfile
141
+ - test/gemfiles/chef-12.9.gemfile
121
142
  - test/gemfiles/chef-12.gemfile
122
143
  - test/gemfiles/master.gemfile
123
144
  - test/integration/default/serverspec/default_spec.rb
@@ -130,6 +151,7 @@ files:
130
151
  - test/spec/resources/pip_requirements_spec.rb
131
152
  - test/spec/resources/python_package_spec.rb
132
153
  - test/spec/resources/python_runtime_pip_spec.rb
154
+ - test/spec/resources/python_runtime_spec.rb
133
155
  - test/spec/resources/python_virtualenv_spec.rb
134
156
  - test/spec/spec_helper.rb
135
157
  - test/spec/utils/python_encoder_spec.rb
@@ -154,7 +176,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
154
176
  version: '0'
155
177
  requirements: []
156
178
  rubyforge_project:
157
- rubygems_version: 2.6.2
179
+ rubygems_version: 2.6.4
158
180
  signing_key:
159
181
  specification_version: 4
160
182
  summary: A Chef cookbook for managing Python installations.
@@ -164,11 +186,18 @@ test_files:
164
186
  - test/docker/docker.ca
165
187
  - test/docker/docker.pem
166
188
  - test/gemfiles/chef-12.1.gemfile
189
+ - test/gemfiles/chef-12.10.gemfile
190
+ - test/gemfiles/chef-12.11.gemfile
191
+ - test/gemfiles/chef-12.12.gemfile
192
+ - test/gemfiles/chef-12.13.gemfile
167
193
  - test/gemfiles/chef-12.2.gemfile
168
194
  - test/gemfiles/chef-12.3.gemfile
169
195
  - test/gemfiles/chef-12.4.gemfile
170
196
  - test/gemfiles/chef-12.5.gemfile
171
197
  - test/gemfiles/chef-12.6.gemfile
198
+ - test/gemfiles/chef-12.7.gemfile
199
+ - test/gemfiles/chef-12.8.gemfile
200
+ - test/gemfiles/chef-12.9.gemfile
172
201
  - test/gemfiles/chef-12.gemfile
173
202
  - test/gemfiles/master.gemfile
174
203
  - test/integration/default/serverspec/default_spec.rb
@@ -181,8 +210,8 @@ test_files:
181
210
  - test/spec/resources/pip_requirements_spec.rb
182
211
  - test/spec/resources/python_package_spec.rb
183
212
  - test/spec/resources/python_runtime_pip_spec.rb
213
+ - test/spec/resources/python_runtime_spec.rb
184
214
  - test/spec/resources/python_virtualenv_spec.rb
185
215
  - test/spec/spec_helper.rb
186
216
  - test/spec/utils/python_encoder_spec.rb
187
217
  - test/spec/utils_spec.rb
188
- has_rdoc: