From 9ca902100bf94f2b8ba49089a38975a1a8028fba Mon Sep 17 00:00:00 2001 From: Lenka Segura Date: Oct 02 2018 12:00:47 +0000 Subject: Add python3 venv to Vagrant This allows to run the 'runtests' script. --- diff --git a/dev/ansible/roles/pagure-dev/files/motd b/dev/ansible/roles/pagure-dev/files/motd index ec96796..3f4de87 100644 --- a/dev/ansible/roles/pagure-dev/files/motd +++ b/dev/ansible/roles/pagure-dev/files/motd @@ -15,6 +15,9 @@ Here are some tips: * Logs for the server are available with `journalctl`; the services are run as systemd user units in ~/.config/systemd/user/ +* To run the tests you need python3 virtualenv: `workon python3-pagure`. + Then you can run them with `./runtests.py run`. + Once you start the server you can navigate to http://localhost:5000/ in your browser on the host to access your Pagure development environment. diff --git a/dev/ansible/roles/pagure-dev/tasks/main.yml b/dev/ansible/roles/pagure-dev/tasks/main.yml index 686138c..1eca219 100644 --- a/dev/ansible/roles/pagure-dev/tasks/main.yml +++ b/dev/ansible/roles/pagure-dev/tasks/main.yml @@ -82,6 +82,16 @@ with_items: - "pygit2=={{ libgit2_version.stdout_lines[0] }}.*" +# Install Pagure inside a virtualenv and configure it for python3 +- name: Install pygit2 in the python3 virtualenv + become_user: "{{ ansible_env.SUDO_USER }}" + pip: + name: "{{ item }}" + virtualenv: /home/{{ ansible_env.SUDO_USER }}/.virtualenvs/python3-pagure/ + virtualenv_python: python3 + with_items: + - "pygit2=={{ libgit2_version.stdout_lines[0] }}.*" + - name: Install Pagure Python dependencies into a virtualenv become_user: "{{ ansible_env.SUDO_USER }}" pip: @@ -93,6 +103,17 @@ - "requirements-ev.txt" - "tests_requirements.txt" +- name: Install Pagure Python dependencies into a python3 virtualenv + become_user: "{{ ansible_env.SUDO_USER }}" + pip: + requirements: /home/{{ ansible_env.SUDO_USER }}/devel/{{ item }} + virtualenv: /home/{{ ansible_env.SUDO_USER }}/.virtualenvs/python3-pagure/ + virtualenv_python: python3 + with_items: + - "requirements.txt" + - "requirements-ev.txt" + - "tests_requirements.txt" + - name: Install Pagure package into a virtualenv become_user: "{{ ansible_env.SUDO_USER }}" pip: