Browse Source

base: pip2/pip3 and respective upgrade states

master
Sean Johnson 3 years ago
parent
commit
2f1710751c
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG Key ID: 9FA15B87469EA850
  1. 4
      base/package_map.yaml
  2. 51
      base/python.sls

4
base/package_map.yaml

@ -12,7 +12,9 @@ Debian:
parted:
name: parted
pip:
name: python-pip
require: ">=19.0.0"
py2_name: python-pip
py3_name: python3-pip
python_requests:
name: python-requests
python3_requests:

51
base/python.sls

@ -10,20 +10,57 @@ fetch pip bootstrap:
- makedirs: true
- skip_verify: true
remove distro pip:
remove distro pip/py2:
pkg.removed:
- name: "{{ packages.pip.name }}"
- name: "{{ packages.pip.py2_name }}"
- onlyif:
- which python2
bootstrap pip:
remove distro pip/py3:
pkg.removed:
- name: "{{ packages.pip.py3_name }}"
- onlyif:
- which python3
bootstrap pip/py2:
cmd.run:
- name: python2 /opt/get-pip.py "pip>=19.0.0"
- unless:
- which pip2
- onlyif:
- which python2
- require:
- file: fetch pip bootstrap
- pkg: remove distro pip/py2
- reload_modules: true
bootstrap pip/py3:
cmd.run:
- name: python2 /opt/get-pip.py "pip<18.1"
- unless: which pip
- name: python3 /opt/get-pip.py "pip{{ packages.pip.require }}"
- unless:
- which pip3
- onlyif:
- which python3
- require:
- file: fetch pip bootstrap
- pkg: remove distro pip
- pkg: remove distro pip/py3
- reload_modules: true
upgrade pip/py2:
cmd.run:
- name: pip2 install -U "pip{{ packages.pip.require }}"
- onlyif:
- which pip2
- reload_modules: true
upgrade pip/py3:
cmd.run:
- name: pip3 install -U "pip{{ packages.pip.require }}"
- onlyif:
- which pip3
- reload_modules: true
python requests package:
python2 requests package:
pkg.installed:
- name: {{ packages.python_requests.name }}

Loading…
Cancel
Save