Skip to content

Commit

Permalink
Change the vagrant development environment to python3
Browse files Browse the repository at this point in the history
This will prevent issue with UnicodeEncodeError when running
files/anitya_cron.py
  • Loading branch information
Zlopez authored and mergify[bot] committed Sep 20, 2018
1 parent d6e8bb6 commit d1ed9fa
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion anitya/lib/backends/github.py
Expand Up @@ -88,7 +88,7 @@ def get_versions(cls, project):
(owner, repo) = url.split('/')
except ValueError:
raise AnityaPluginException(
'Project %s was incorrectly set-up. ' % project.name +
'Project %s was incorrectly set-up. ' % project.name +
'Can\'t parse owner and repo.')

query = prepare_query(owner, repo)
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/anitya-dev/files/bashrc
Expand Up @@ -17,4 +17,4 @@ export WORKON_HOME=$HOME/.virtualenvs
export PIP_VIRTUALENV_BASE=$WORKON_HOME
export VIRTUALENV_USE_DISTRIBUTE=true
export PIP_RESPECT_VIRTUALENV=true
source /usr/bin/virtualenvwrapper.sh
source /usr/bin/virtualenvwrapper-3.sh
10 changes: 2 additions & 8 deletions ansible/roles/anitya-dev/tasks/main.yml
Expand Up @@ -4,7 +4,7 @@
dnf: name={{ item }} state=present
with_items:
- git
- python-virtualenvwrapper
- python3-virtualenvwrapper
- vim-enhanced

- name: Install anitya system dependencies
Expand All @@ -15,11 +15,9 @@
- libffi-devel
- openssl-devel
- postgresql-devel
- python2-devel
- python3-devel
- redhat-rpm-config
- rpm-python
- python2-sqlalchemy_schemadisplay

# Add various helpful configuration files
- name: Install a custom bashrc
Expand All @@ -38,7 +36,7 @@
become_user: "{{ ansible_env.SUDO_USER }}"
shell: >
source ~/.bashrc && mkvirtualenv anitya -a ~/devel/ &&
virtualenv --system-site-packages ~/.virtualenvs/anitya/
virtualenv-3 --system-site-packages ~/.virtualenvs/anitya/
args:
creates: /home/{{ ansible_env.SUDO_USER }}/.virtualenvs/anitya

Expand All @@ -47,7 +45,6 @@
pip:
requirements: "requirements.txt"
virtualenv: /home/{{ ansible_env.SUDO_USER }}/.virtualenvs/anitya/
virtualenv_python: python2
args:
chdir: /home/{{ ansible_env.SUDO_USER }}/devel

Expand All @@ -56,7 +53,6 @@
pip:
name: "psycopg2"
virtualenv: /home/{{ ansible_env.SUDO_USER }}/.virtualenvs/anitya/
virtualenv_python: python2
args:
chdir: /home/{{ ansible_env.SUDO_USER }}/devel

Expand All @@ -65,7 +61,6 @@
pip:
requirements: "test_requirements.txt"
virtualenv: /home/{{ ansible_env.SUDO_USER }}/.virtualenvs/anitya/
virtualenv_python: python2
args:
chdir: /home/{{ ansible_env.SUDO_USER }}/devel

Expand All @@ -79,7 +74,6 @@
name: "file:///home/{{ ansible_env.SUDO_USER }}/devel"
extra_args: "-e"
virtualenv: /home/{{ ansible_env.SUDO_USER }}/.virtualenvs/anitya/
virtualenv_python: python2

- name: Create user systemd directory
become_user: "{{ ansible_env.SUDO_USER }}"
Expand Down
2 changes: 1 addition & 1 deletion files/anitya_cron.py
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import sys
Expand Down

0 comments on commit d1ed9fa

Please sign in to comment.