Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
pycklets / resources / frecklet / pyenv-python-installed.frecklet
Size: Mime:
doc:
  short_help: Install a Python runtime for a user via 'pyenv'.
  help: |
    **Note**: this is mostly deprecated now by the 'python-lang-installed' frecklet.

    Install a Python environment for a user, using [pyenv](https://github.com/pyenv/pyenv).

    This will install all dependencies required to build Python, then it will download the specified version of Python,
    compile it, and use the 'pyenv global' command (which will write that information into the file $HOME/.pyenv/version)
    to make it the default version for the user.

    It will also add a piece of code to ``$HOME/.bashrc`` to load pyenv when the user logs in. If you use this to install
    Python for a user different to the executing one, make sure to specify the 'path' argument (absolute path required,
    relative or using '~'/'$HOME' won't work).
  references:
    pyenv homepage: https://github.com/pyenv/pyenv
    "'avanov.pyenv' Ansible role": https://github.com/avanov/ansible-galaxy-pyenv
  examples:
  - title: Install the latest version of Python.
  - title: Install Python version 3.6.8 for user 'freckles'.
    desc: The user 'freckles' will be created if it doesn't exist yet.
    vars:
      version: 3.6.8
      user: freckles

args:
  version:
    doc:
      short_help: The version of Python to install.
    default: 3.7.3
    required: true
  user:
    doc:
      short_help: The user to install pyenv for.
    type: string
    required: false
  path:
    doc:
      short_help: The path to install pyenv into.
      help: |
        Defaults to $HOME/.pyenv
    type: string
    required: false
  set_global:
    doc:
      short_help: Don't set 'global' version.
    type: boolean
    required: false
    default: true

frecklets:
- user-exists:
    frecklet::skip: '{{:: user | true_if_empty ::}}'
    name: '{{:: user ::}}'
- frecklet:
    name: avanov.pyenv
    type: ansible-role
    properties:
      idempotent: true
      internet: true
      elevated: true
    desc:
      references:
        "'avanov.pyenv' Ansible role": https://github.com/avanov/ansible-galaxy-pyenv
        pyenv homepage: https://github.com/pyenv/pyenv
  task:
    include-type: include
#      become: true
  vars:
    pyenv_env: user
    pyenv_path: '{{:: path ::}}'
    pyenv_owner: '{{:: user ::}}'
    pyenv_global: '{%:: if set_global ::%}{{:: version ::}}{%:: endif ::%}'
    pyenv_virtualenvs: []
    pyenv_python_versions:
    - '{{:: version::}}'

meta: {}