Class: PoisePython::Resources::PythonPackage::Provider

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

Overview

The default provider for the python_package resource.

See Also:

Since:

  • 1.0.0

Instance Method Summary collapse

Instance Method Details

#install_package(name, version)

This method returns an undefined value.

Install package(s) using pip.

Parameters:

  • Name(s) of package(s).

  • Version(s) of package(s).

Since:

  • 1.0.0



237
238
239
# File 'lib/poise_python/resources/python_package.rb', line 237

def install_package(name, version)
  pip_install(name, version, upgrade: false)
end

#remove_package(name, version)

This method returns an undefined value.

Uninstall package(s) using pip.

Parameters:

  • Name(s) of package(s).

  • Version(s) of package(s).

Since:

  • 1.0.0



255
256
257
# File 'lib/poise_python/resources/python_package.rb', line 255

def remove_package(name, version)
  pip_command('uninstall', :install, %w{--yes} + [name].flatten)
end

#upgrade_package(name, version)

This method returns an undefined value.

Upgrade package(s) using pip.

Parameters:

  • Name(s) of package(s).

  • Version(s) of package(s).

Since:

  • 1.0.0



246
247
248
# File 'lib/poise_python/resources/python_package.rb', line 246

def upgrade_package(name, version)
  pip_install(name, version, upgrade: true)
end