From 3695766e2804f8bff7dc87f0d6f8964beafa319a Mon Sep 17 00:00:00 2001
From: Aurélien Bompard <aurelien@bompard.org>
Date: Jan 21 2019 11:07:15 +0000
Subject: [PATCH 1/3] Use tox


Signed-off-by: Aurélien Bompard <aurelien@bompard.org>

---

diff --git a/.gitignore b/.gitignore
index 0153019..2eedc47 100644
--- a/.gitignore
+++ b/.gitignore
@@ -16,3 +16,4 @@ _build/
 pylint.out
 nosetests.xml
 MANIFEST
+.tox
diff --git a/nosetests b/nosetests
deleted file mode 100755
index f6d948f..0000000
--- a/nosetests
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/usr/bin/env python3
-# EASY-INSTALL-ENTRY-SCRIPT: 'nose==0.10.4','console_scripts','nosetests'
-__requires__ = ['nose>=0.10.4', 'SQLAlchemy >= 0.7', 'jinja2 >= 2.4']
-import sys
-from pkg_resources import load_entry_point
-
-sys.exit(
-   load_entry_point('nose>=0.10.4', 'console_scripts', 'nosetests')()
-)
diff --git a/requirements.txt b/requirements.txt
index adb2640..915890e 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -18,3 +18,7 @@ docutils
 psutil
 blinker # Required by flask >= 0.10 for the unit-tests
 funcsigs  # Required by mock but somehow missed
+flask_multistatic
+python-openid
+python-openid_cla
+python-openid_teams
diff --git a/run_pylint.sh b/run_pylint.sh
deleted file mode 100755
index 2da5926..0000000
--- a/run_pylint.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-PYTHONPATH=fedocal pylint -f parseable fedocal | tee pylint.out
-
-#pep8 fedocal/*.py fedocal/*/*.py | tee pep8.out
diff --git a/run_tests.sh b/run_tests.sh
deleted file mode 100755
index b4d7097..0000000
--- a/run_tests.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/bash
-FEDOCAL_CONFIG=`pwd`/tests/fedocal_test.cfg PYTHONPATH=fedocal ./nosetests \
-    --with-coverage --cover-erase --cover-package=fedocal $*
diff --git a/setup.py b/setup.py
index c84c07e..d667f9e 100644
--- a/setup.py
+++ b/setup.py
@@ -4,13 +4,17 @@
 Setup script
 """
 
-# Required to build on EL6
-__requires__ = ['SQLAlchemy >= 0.7', 'jinja2 >= 2.4']
-import pkg_resources
+import os
+import re
 
 from setuptools import setup
 
-from fedocal import __version__
+
+here = os.path.abspath(os.path.dirname(__file__))
+
+with open(os.path.join(here, "fedocal", "__init__.py")) as fd:
+    match = re.search(r"^__version__ = '([^']+)'$", fd.read(), re.MULTILINE)
+    VERSION = match.group(1)
 
 
 def get_requirements(requirements_file='requirements.txt'):
@@ -35,7 +39,7 @@ def get_requirements(requirements_file='requirements.txt'):
 setup(
     name='fedocal',
     description='fedocal is a web based calendar application for Fedora.',
-    version=__version__,
+    version=VERSION,
     author='Pierre-Yves Chibon',
     author_email='pingou@pingoured.fr',
     maintainer='Pierre-Yves Chibon',
diff --git a/tox.ini b/tox.ini
new file mode 100644
index 0000000..99109fb
--- /dev/null
+++ b/tox.ini
@@ -0,0 +1,21 @@
+[tox]
+envlist = py27,py34,py35,py36
+# If the user is missing an interpreter, don't fail
+skip_missing_interpreters = True
+
+[testenv]
+deps =
+    -rrequirements.txt
+    nose
+    nose-cov
+setenv =
+    FEDOCAL_CONFIG={toxinidir}/tests/fedocal_test.cfg
+commands =
+    nosetests --with-coverage --cover-erase --cover-package=fedocal {posargs}
+
+
+[testenv:lint]
+deps =
+    pylint
+commands =
+    pylint -f parseable fedocal

From 54d63ef351efe5d172b68b051fdb185593fdd075 Mon Sep 17 00:00:00 2001
From: Aurélien Bompard <aurelien@bompard.org>
Date: Jan 21 2019 12:14:17 +0000
Subject: [PATCH 2/3] Get rid of __requires__ lines


Signed-off-by: Aurélien Bompard <aurelien@bompard.org>

---

diff --git a/alembic/update03_to_04.py b/alembic/update03_to_04.py
index f271660..f13c583 100644
--- a/alembic/update03_to_04.py
+++ b/alembic/update03_to_04.py
@@ -34,10 +34,6 @@ file.
 '''
 from __future__ import print_function
 
-## These two lines are needed to run on EL6
-__requires__ = ['SQLAlchemy >= 0.7', 'jinja2 >= 2.4']
-import pkg_resources
-
 
 import sys
 import os
diff --git a/createdb.py b/createdb.py
index 0dbaa7f..9422176 100644
--- a/createdb.py
+++ b/createdb.py
@@ -1,9 +1,5 @@
 #!/usr/bin/python
 
-## These two lines are needed to run on EL6
-__requires__ = ['SQLAlchemy >= 0.7', 'jinja2 >= 2.4']
-import pkg_resources
-
 from fedocal import APP
 from fedocal.fedocallib import model
 
diff --git a/fedocal.wsgi b/fedocal.wsgi
index 790393f..063e254 100644
--- a/fedocal.wsgi
+++ b/fedocal.wsgi
@@ -1,12 +1,5 @@
 #-*- coding: utf-8 -*-
 
-# The three lines below are required to run on EL6 as EL6 has
-# two possible version of python-sqlalchemy and python-jinja2
-# These lines make sure the application uses the correct version.
-#import __main__
-#__main__.__requires__ = ['SQLAlchemy >= 0.7', 'jinja2 >= 2.4']
-#import pkg_resources
-
 #import os
 ## Set the environment variable pointing to the configuration file
 #os.environ['FEDOCAL_CONFIG'] = '/etc/fedocal/fedocal.cfg'
diff --git a/fedocal_cron.py b/fedocal_cron.py
index 6560cf8..32f1421 100644
--- a/fedocal_cron.py
+++ b/fedocal_cron.py
@@ -28,11 +28,6 @@ each meeting that asked for it.
 """
 
 
-## These two lines are needed to run on EL6
-__requires__ = ['SQLAlchemy >= 0.7', 'jinja2 >= 2.4']
-import pkg_resources
-
-
 import smtplib
 import warnings
 
diff --git a/runserver.py b/runserver.py
index 9ae25ee..c95565f 100644
--- a/runserver.py
+++ b/runserver.py
@@ -1,9 +1,5 @@
 #!/usr/bin/env python2
 
-# These two lines are needed to run on EL6
-__requires__ = ['SQLAlchemy >= 0.8', 'jinja2 >= 2.4']
-import pkg_resources
-
 import argparse
 import sys
 import os
diff --git a/tests/test_flask.py b/tests/test_flask.py
index 264c9cb..9a70fb1 100644
--- a/tests/test_flask.py
+++ b/tests/test_flask.py
@@ -28,9 +28,6 @@
 """
 from __future__ import unicode_literals, absolute_import, print_function
 
-__requires__ = ['SQLAlchemy >= 0.7', 'jinja2 >= 2.4']
-import pkg_resources
-
 import logging
 import unittest
 import sys
diff --git a/tox.ini b/tox.ini
index 99109fb..e64f995 100644
--- a/tox.ini
+++ b/tox.ini
@@ -10,6 +10,7 @@ deps =
     nose-cov
 setenv =
     FEDOCAL_CONFIG={toxinidir}/tests/fedocal_test.cfg
+passenv = HOME
 commands =
     nosetests --with-coverage --cover-erase --cover-package=fedocal {posargs}
 

From 7d7e93b019b5534558ddfb4fabe5874472072372 Mon Sep 17 00:00:00 2001
From: Aurélien Bompard <aurelien@bompard.org>
Date: Jan 21 2019 12:30:24 +0000
Subject: [PATCH 3/3] Add cico.pipeline


Signed-off-by: Aurélien Bompard <aurelien@bompard.org>

---

diff --git a/.cico.pipeline b/.cico.pipeline
new file mode 100644
index 0000000..7631029
--- /dev/null
+++ b/.cico.pipeline
@@ -0,0 +1 @@
+fedoraInfraTox { }

