From 4be8ee52d3696d7a09d774d2d7148e75340410ea Mon Sep 17 00:00:00 2001 From: Aurélien Bompard Date: Jan 24 2018 10:10:30 +0000 Subject: Use Python3 by default Fixes #531 --- diff --git a/Vagrantfile.example b/Vagrantfile.example index 5310d5a..082d015 100644 --- a/Vagrantfile.example +++ b/Vagrantfile.example @@ -4,7 +4,7 @@ VAGRANTFILE_API_VERSION = "2" Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| - config.vm.box = "fedora/25-cloud-base" + config.vm.box = "fedora/27-cloud-base" # Forward traffic on the host to the development server on the guest config.vm.network "forwarded_port", guest: 5000, host: 5000 diff --git a/ansible/roles/hubs/tasks/main.yml b/ansible/roles/hubs/tasks/main.yml index bf1a190..8ea311f 100644 --- a/ansible/roles/hubs/tasks/main.yml +++ b/ansible/roles/hubs/tasks/main.yml @@ -13,35 +13,32 @@ - mongodb-server - fedmsg-hub - fedmsg-relay - - python-virtualenv + - python3-virtualenv - python3-flask-oidc - postfix - name: Install the distribution versions of requirements.txt dnf: name={{ item }} state=present with_items: - - python-alembic - - python-arrow - - python-bleach - - python-decorator - - python-dogpile-cache - - python-fedmsg-core - - python-fedmsg-meta-fedora-infrastructure - - python-flask - - python-flask-oidc - - python-fmn-lib - - python-fmn-rules - - python-futures - - python-html5lib - - python-munch - - pytz - - python-sqlalchemy - - python-markdown - - python2-pkgwat-api - - python-six - - python-pygments - - python-pygments-markdown-lexer - - python-retask + - python3-alembic + - python3-arrow + - python3-bleach + - python3-decorator + - python3-dogpile-cache + - python3-fedmsg-core + - python3-fedmsg-meta-fedora-infrastructure + - python3-flask + - python3-flask-oidc + - python3-html5lib + - python3-munch + - python3-pytz + - python3-sqlalchemy + - python3-markdown + - python3-pkgwat-api + - python3-six + - python3-pygments + - python3-pygments-markdown-lexer + - python3-retask # Create directory structure @@ -67,6 +64,7 @@ requirements: "{{ hubs_code_dir }}/requirements.txt" virtualenv: "{{ hubs_venv_dir}}" virtualenv_site_packages: yes + virtualenv_command: virtualenv-3 - name: Install Fedora Hubs test-requirements.txt into hubs virtualenv become_user: "{{ main_user }}" @@ -74,6 +72,7 @@ requirements: "{{ hubs_code_dir }}/test-requirements.txt" virtualenv: "{{ hubs_venv_dir}}" virtualenv_site_packages: yes + virtualenv_command: virtualenv-3 - name: Install other packages into hubs virtualenv become_user: "{{ main_user }}" @@ -81,6 +80,7 @@ name: "{{ item }}" virtualenv: "{{ hubs_venv_dir }}" virtualenv_site_packages: yes + virtualenv_command: virtualenv-3 with_items: - bleach @@ -88,7 +88,7 @@ become_user: "{{ main_user }}" command: "{{ hubs_venv_dir }}/bin/pip install -e {{ hubs_code_dir }}" args: - creates: "{{ hubs_venv_dir }}/lib/python2.7/site-packages/fedora-hubs.egg-link" + creates: "{{ hubs_venv_dir }}/lib/python3.5/site-packages/fedora-hubs.egg-link" - name: Set bin file context in the virtualenv become_user: "{{ main_user }}" diff --git a/ansible/roles/hubs/templates/honcho-procfile b/ansible/roles/hubs/templates/honcho-procfile index feba397..937ef33 100644 --- a/ansible/roles/hubs/templates/honcho-procfile +++ b/ansible/roles/hubs/templates/honcho-procfile @@ -1,4 +1,4 @@ -web: {{ hubs_venv_dir }}/bin/python /usr/bin/flask run --host 0.0.0.0 --port 5000 +web: {{ hubs_venv_dir }}/bin/python /usr/bin/flask-3 run --host 0.0.0.0 --port 5000 triage: {{ hubs_venv_dir }}/bin/fedora-hubs-triage worker: {{ hubs_venv_dir }}/bin/fedora-hubs-worker sse: {{ hubs_venv_dir }}/bin/python /usr/bin/twistd -l - --pidfile= -ny {{ hubs_code_dir }}/hubs/backend/sse_server.tac diff --git a/requirements.txt b/requirements.txt index 9aea1a4..711bd40 100644 --- a/requirements.txt +++ b/requirements.txt @@ -12,8 +12,6 @@ fedmsg_meta_fedora_infrastructure python-fedora flask flask-oidc>=1.0.3 -fmn.lib -fmn.rules gunicorn html5lib==0.9999999 humanize diff --git a/tox.ini b/tox.ini index 74cc729..aced490 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py{27,34,35}-flask01{0,1,2},js,jslint,docs,lint +envlist = py{27,34,35,36}-flask01{0,1,2},js,jslint,docs,lint skipsdist = True