#
# Cookbook:: irrigate-python
# Recipe:: python311
#
# All rights reserved - Do Not Redistribute
#
# Only supported on Debian 12

if platform_family?('debian')
  if node['platform_version'].start_with?('12')

    # Prefer bookworm stable python3.11 packages
    apt_preference 'python3.11' do
      glob         'python3.11* libpython3.11*'
      pin          'release n=bookworm'
      pin_priority '1000'
    end

    packages = %w(
      python3.11
      python3.11-venv
      python3-pip
      python3-yaml
    )

    if node['python']['install_dev_libraries']
      packages += %w(
        python3.11-dev
      )
    end

    packages.each do |name|
      package name
    end
  end
end
