Class: PoisePython::Resources::PythonPackage::Resource

Inherits:
Chef::Resource::Package
  • Object
show all
Includes:
PythonCommandMixin
Defined in:
lib/poise_python/resources/python_package.rb

Overview

A python_package resource to manage Python installations using pip.

Examples:

python_package 'django' do
  python '2'
  version '1.8.3'
end

Since:

  • 1.0.0

Provides:

  • python_package

Actions:

  • install

  • upgrade

  • uninstall

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Resource

Returns a new instance of Resource.

Since:

  • 1.0.0



127
128
129
130
131
132
133
134
# File 'lib/poise_python/resources/python_package.rb', line 127

def initialize(*args)
  super
  # For older Chef.
  @resource_name = :python_package
  # We don't have these actions.
  @allowed_actions.delete(:purge)
  @allowed_actions.delete(:reconfig)
end

Instance Attribute Details

#allow_downgradeBoolean

Allow downgrading the package.

Returns:

  • (Boolean)


125
# File 'lib/poise_python/resources/python_package.rb', line 125

attribute(:allow_downgrade, kind_of: [TrueClass, FalseClass], default: false)

#groupString, ...

System group to install the package.

Returns:

  • (String, Integer, nil)


107
# File 'lib/poise_python/resources/python_package.rb', line 107

attribute(:group, kind_of: [String, Integer, NilClass], default: lazy { default_group })

#install_optionsString, ...

Options string to be used with pip install.

Returns:

  • (String, Array<String>, nil, false)


111
# File 'lib/poise_python/resources/python_package.rb', line 111

attribute(:install_options, kind_of: [String, Array, NilClass, FalseClass], default: nil)

#list_optionsString, ...

Options string to be used with pip list.

Returns:

  • (String, Array<String>, nil, false)


115
# File 'lib/poise_python/resources/python_package.rb', line 115

attribute(:list_options, kind_of: [String, Array, NilClass, FalseClass], default: nil)

#userString, ...

System user to install the package.

Returns:

  • (String, Integer, nil)


119
# File 'lib/poise_python/resources/python_package.rb', line 119

attribute(:user, kind_of: [String, Integer, NilClass], default: lazy { default_user })