Forge Home

pythonbuild

Installs Python from source.

701 downloads

681 latest version

3.1 quality score

Version information

  • 0.1.1 (latest)
  • 0.1.0
released Aug 24th 2021
This version is compatible with:
  • Puppet Enterprise 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x, 2019.8.x
  • Puppet >= 6.21.0 < 8.0.0
  • , , ,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'visus-pythonbuild', '0.1.1'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add visus-pythonbuild
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install visus-pythonbuild --version 0.1.1

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

visus/pythonbuild — version 0.1.1 Aug 24th 2021

pythonbuild

This module installs Python from source by downloading it from Python.org and performing an altinstall.

Table of Contents

  1. Description
  2. Setup – The basics of getting started with pythonbuild
  3. Usage – Configuration options and additional functionality
  4. Limitations – OS compatibility, etc.
  5. Development – Guide for contributing to the module

Description

This module downloads Python sources from the configured URL, by default from the FTP directory on Python.org, into a configured directory, be default /usr/local/src'. Afterwards, it configures the build and performs a altinstall` make.

This process will install a binary that can be invoked, for instance, as python3.9.

Setup

Setup Requirements

The module required autoconf, gcc, make and several libraries to be installed. These packages are automatically installed when specified in as $build_dependencies.

Beginning with pythonbuild

The pythonbuild class enables installation of multiple versions. The following installs Python 3.9.6 without any build customisation:

class { 'pythonbuild':
    versions => {
        '3.9.6' => { }
    }
}

Usage

The hash per version can be used to configure phythonbuild::build, most notably you can override the full source path for the download. Furthermore, you can change the target for make, e.g. if you want to perform a system-wide install instead of adding an alternative version. The following specifies what would be the default for Python 3.9.6:

class { 'pythonbuild':
    versions => {
        '3.9.6' => {
            override_url => 'https://www.python.org/ftp/python/3.9.6/Python-3.9.6.tgz',
            configure_flags => '--enable-optimizations',
            make_target => 'altinstall'
        }
    }
}

Should you have the need to add additional build depdencies, this is best done via Hiera. The following is the default configuration which is applied to all platforms:

pythonbuild::build_dependencies:
  - gcc
  - make
  - autoconf

If you need to force a rebuild, this can be achieved by deleting the source directory. This is located in /usr/local/src or at the location specified as $source_dir parameter.

Limitations

Only distributions listed in metadata.json are supported.

Development

Open a pull request on GitHub.