<commit_before>{% set python_dependencies = salt.grains.filter_by({
    'default': {
      'python_libs': ['testinfra', 'pyinotify'],
      'pkgs': ['gcc', 'make']
    },
    'Debian': {
      'pkgs': ['python-dev', 'python', 'curl', 'dnsutils'],
    },
    'RedHat': {
      'pkgs': ['python', 'python-devel', 'curl', 'bind-utils'],
    },
}, grain='os_family', merge=salt.pillar.get('python_dependencies'), default='Debian', base='default') %}

prepare_installation_of_pip_executable:
  pkg.installed:
    - pkgs: {{ python_dependencies.pkgs|tojson }}
    - reload_modules: True

install_global_pip_executable:
  cmd.run:
    - name: |
        curl -L "https://bootstrap.pypa.io/get-pip.py" > get_pip.py
        sudo python get_pip.py 'pip<18.1'
        rm get_pip.py
    - reload_modules: True
    - unless: which pip
    - reload_modules: True

install_python_libraries:
  pip.installed:
    - names: {{ python_dependencies.python_libs|tojson }}
    - reload_modules: True<commit_msg>Updated pip installer to use salt python binary<commit_after>{% set python_dependencies = salt.grains.filter_by({
    'default': {
      'python_libs': ['testinfra', 'pyinotify'],
      'pkgs': ['gcc', 'make']
    },
    'Debian': {
      'pkgs': ['python3-dev', 'python3', 'curl', 'dnsutils'],
    },
    'RedHat': {
      'pkgs': ['python3', 'python3-devel', 'curl', 'bind-utils'],
    },
}, grain='os_family', merge=salt.pillar.get('python_dependencies'), default='Debian', base='default') %}

prepare_installation_of_pip_executable:
  pkg.installed:
    - pkgs: {{ python_dependencies.pkgs|tojson }}
    - reload_modules: True

install_global_pip_executable:
  cmd.run:
    - name: |
        curl -L "https://bootstrap.pypa.io/get-pip.py" > get_pip.py
        {{ salt.grains.get('pythonexecutable') }} get_pip.py
        rm get_pip.py
    - reload_modules: True
    - unless: {{ salt.grains.get('pythonexecutable') }} -m pip --version
    - reload_modules: True

install_python_libraries:
  pip.installed:
    - names: {{ python_dependencies.python_libs|tojson }}
    - reload_modules: True
{'fraction_non_alphanumeric': 0.16954851104707014, 'fraction_numerical': 0.0033621517771373678, 'mean_word_length': 3.431914893617021, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1434151', 'n_tokens_mistral': 782, 'n_tokens_neox': 719, 'n_words': 124}