class PoisePython::PythonProviders::Msi

Constants

MSI_VERSIONS

Public Class Methods

provides_auto?(node, resource) click to toggle source
# File lib/poise_python/python_providers/msi.rb, line 30
def self.provides_auto?(node, resource)
  # Only enable by default on Windows and not for Python 3.5 because that
  # uses the win_binaries provider.
  node.platform_family?('windows') #&& resource.version != '3' && ::Gem::Requirement.create('< 3.5').satisfied_by(::Gem::Version.create(new_resource.version))
end

Public Instance Methods

python_binary() click to toggle source
# File lib/poise_python/python_providers/msi.rb, line 36
def python_binary
  return options['python_binary'] if options['python_binary']
  if package_version =~ /^(\d+)\.(\d+)\./
    ::File.join(ENV['SystemDrive'], "Python#{$1}#{$2}", 'python.exe')
  else
    raise "Can't find Python binary for #{package_version}"
  end
end

Private Instance Methods

install_python() click to toggle source
# File lib/poise_python/python_providers/msi.rb, line 47
def install_python
  version = package_version
  windows_package 'python' do
    source "https://www.python.org/ftp/python/#{version}/python-#{version}#{node['machine'] == 'x86_64' ? '.amd64' : ''}.msi"
  end
end
package_version() click to toggle source
# File lib/poise_python/python_providers/msi.rb, line 58
def package_version
  MSI_VERSIONS.find {|ver| ver.start_with?(new_resource.version) } || new_resource.version
end
uninstall_python() click to toggle source
# File lib/poise_python/python_providers/msi.rb, line 54
def uninstall_python
  raise NotImplementedError
end