Browse Source

Use deadsnakes PPA for Python instead of pyenv

Previously I was using pyenv to build Python, but that's mostly
unnecessary and has some other side effects (like needing to install a
lot of packages as dependencies).

This switches to using the deadsnakes PPA instead, which also has the
effect of upgrading to the most recent version of Python 3.6 (currently,
3.6.7 instead of 3.6.5).
merge-requests/53/head
Deimos 6 years ago
parent
commit
198fe299c7
  1. 7
      salt/salt/boussole.sls
  2. 2
      salt/salt/common.jinja2
  3. 36
      salt/salt/python.sls
  4. 7
      salt/salt/site-icons-spriter.sls

7
salt/salt/boussole.sls

@ -5,16 +5,15 @@
# Salt seems to use the deprecated pyvenv script, manual for now
boussole-venv-setup:
cmd.run:
- name: /usr/local/pyenv/versions/{{ python_version }}/bin/python -m venv {{ boussole_venv_dir }}
- name: python{{ python_version }} -m venv {{ boussole_venv_dir }}
- creates: {{ boussole_venv_dir }}
- require:
- pkg: python3-venv
- pyenv: {{ python_version }}
- pkg: python{{ python_version }}-venv
boussole-pip-installs:
cmd.run:
- name: {{ boussole_venv_dir }}/bin/pip install boussole
- unless: ls {{ boussole_venv_dir }}/lib/python3.6/site-packages/boussole
- unless: ls {{ boussole_venv_dir }}/lib/python{{ python_version }}/site-packages/boussole
/etc/systemd/system/boussole.service:
file.managed:

2
salt/salt/common.jinja2

@ -1,4 +1,4 @@
{% set python_version = '3.6.5' %}
{% set python_version = '3.6' %}
{% set app_dir = '/opt/tildes' %}
{% set static_sites_dir = '/opt/tildes-static-sites' %}

36
salt/salt/python.sls

@ -1,28 +1,11 @@
{% from 'common.jinja2' import app_dir, bin_dir, python_version, venv_dir %}
pyenv-deps:
deadsnakes:
pkgrepo.managed:
- ppa: deadsnakes/ppa
pkg.installed:
- pkgs:
- build-essential
- curl
- libbz2-dev
- libncurses5-dev
- libncursesw5-dev
- libreadline-dev
- libsqlite3-dev
- libssl-dev
- llvm
- make
- wget
- xz-utils
- zlib1g-dev
python-3.6:
pyenv.installed:
- name: {{ python_version }}
- default: True
- require:
- pkg: pyenv-deps
- name: python{{ python_version }}
- refresh: True
delete-obsolete-venv:
file.absent:
@ -32,13 +15,12 @@ delete-obsolete-venv:
# Salt seems to use the deprecated pyvenv script, manual for now
venv-setup:
pkg.installed:
- name: python3-venv
- name: python{{ python_version }}-venv
cmd.run:
- name: /usr/local/pyenv/versions/{{ python_version }}/bin/python -m venv {{ venv_dir }}
- name: python{{ python_version }} -m venv {{ venv_dir }}
- creates: {{ venv_dir }}
- require:
- pkg: python3-venv
- pyenv: {{ python_version }}
- pkg: python{{ python_version }}-venv
pip-installs:
pip.installed:
@ -55,4 +37,4 @@ self-install:
- {{ app_dir }}
- require:
- cmd: venv-setup
- unless: ls {{ venv_dir }}/lib/python3.6/site-packages/tildes.egg-link
- unless: ls {{ venv_dir }}/lib/python{{ python_version }}/site-packages/tildes.egg-link

7
salt/salt/site-icons-spriter.sls

@ -6,16 +6,15 @@
# Salt seems to use the deprecated pyvenv script, manual for now
site-icons-venv-setup:
cmd.run:
- name: /usr/local/pyenv/versions/{{ python_version }}/bin/python -m venv {{ site_icons_venv_dir }}
- name: python{{ python_version }} -m venv {{ site_icons_venv_dir }}
- creates: {{ site_icons_venv_dir }}
- require:
- pkg: python3-venv
- pyenv: {{ python_version }}
- pkg: python{{ python_version }}-venv
site-icons-pip-installs:
cmd.run:
- name: {{ site_icons_venv_dir }}/bin/pip install glue
- unless: ls {{ site_icons_venv_dir }}/lib/python3.6/site-packages/glue
- unless: ls {{ site_icons_venv_dir }}/lib/python{{ python_version }}/site-packages/glue
site-icons-output-placeholder:
file.managed:

Loading…
Cancel
Save