Skip to content

Instantly share code, notes, and snippets.

@dolang
Created June 24, 2018 01:37
Show Gist options
  • Save dolang/d441f096a05565cd0f5e4fcf37b9e944 to your computer and use it in GitHub Desktop.
Save dolang/d441f096a05565cd0f5e4fcf37b9e944 to your computer and use it in GitHub Desktop.
Manjaro 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.
# Manjaro, Python 3, Cython 0.28.3, 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 }}"
pacman:
name:
- git
- sdl2
- sdl2_image
- sdl2_mixer
- sdl2_ttf
state: present
update_cache: true
become: true
- name: "Python 3 virtualenv system package on {{ inventory_hostname }}"
pacman:
name: python-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.3 in virtualenv at {{ venv }}"
pip:
name: Cython
version: 0.28.3
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