Skip to content

Instantly share code, notes, and snippets.

@dolang
Created May 20, 2018 08:02
Show Gist options
  • Save dolang/7fe105dfede1f184c1f277d884ca3ef0 to your computer and use it in GitHub Desktop.
Save dolang/7fe105dfede1f184c1f277d884ca3ef0 to your computer and use it in GitHub Desktop.
openSUSE Kivy dev Ansible playbook (draft)
---
# Kivy development installation into a virtualenv from the GitHub master
# repository. Meant to be run locally for the currently logged in user.
# openSUSE, Python 3, Cython 0.28.2, HEAD of master branch.
#
# ~/
# ├── kivy (kivy_local_repo)
# │ └── ...
# ├── venv (venv)
# : └── ...
- hosts: localhost
vars:
kivy_local_repo: "{{ ansible_user_dir }}/kivy"
venv: "{{ ansible_user_dir }}/venv"
venv_pip: "{{ venv }}/bin/pip"
venv_python: "{{ venv }}/bin/python"
tasks:
- name: "System dependencies for Kivy dev installation on {{ inventory_hostname }}"
zypper:
name:
- git
- gcc
- python3-devel
- SDL2-devel
- SDL2_image-devel
- SDL2_mixer-devel
- SDL2_ttf-devel
- gstreamer-devel
state: present
update_cache: true
become: true
- name: "Python 3 virtualenv system package on {{ inventory_hostname }}"
zypper:
name: python3-virtualenv
state: present
update_cache: true
become: true
- name: "Create virtualenv at {{ venv }} for {{ ansible_user_id }}"
command: "python3 -m virtualenv -p python3 {{ venv }}"
args:
creates: "{{ venv }}"
- name: "Cython 0.28.2 in virtualenv at {{ venv }}"
pip:
name: Cython
version: 0.28.2
executable: "{{ venv_pip }}"
virtualenv_python: "{{ venv_python }}"
- name: "Local clone of Kivy GitHub master branch"
git:
repo: https://github.com/kivy/kivy
dest: "{{ kivy_local_repo }}"
- name: "Install Kivy into virtualenv at {{ venv }}"
command: "{{ venv_pip }} install -e ."
args:
chdir: "{{ kivy_local_repo }}"
- name: "Kivy test dependencies"
pip:
name: nose
executable: "{{ venv_pip }}"
virtualenv_python: "{{ venv_python }}"
- name: "Run tests"
shell: |
. {{ venv }}/bin/activate
make test
args:
chdir: "{{ kivy_local_repo }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment