#177 Use Tox
Merged 5 years ago by pingou. Opened 5 years ago by abompard.
abompard/fedocal tox  into  master

file added
+1
@@ -0,0 +1,1 @@ 

+ fedoraInfraTox { }

file modified
+1
@@ -16,3 +16,4 @@ 

  pylint.out

  nosetests.xml

  MANIFEST

+ .tox

@@ -34,10 +34,6 @@ 

  '''

  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

file modified
-4
@@ -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

  

file modified
-7
@@ -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'

file modified
-5
@@ -28,11 +28,6 @@ 

  """

  

  

- ## These two lines are needed to run on EL6

- __requires__ = ['SQLAlchemy >= 0.7', 'jinja2 >= 2.4']

- import pkg_resources

- 

- 

  import smtplib

  import warnings

  

file removed
-9
@@ -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')()

- )

file modified
+4
@@ -18,3 +18,7 @@ 

  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

file removed
-5
@@ -1,5 +0,0 @@ 

- #!/bin/sh

- 

- PYTHONPATH=fedocal pylint -f parseable fedocal | tee pylint.out

- 

- #pep8 fedocal/*.py fedocal/*/*.py | tee pep8.out

file removed
-3
@@ -1,3 +0,0 @@ 

- #!/bin/bash

- FEDOCAL_CONFIG=`pwd`/tests/fedocal_test.cfg PYTHONPATH=fedocal ./nosetests \

-     --with-coverage --cover-erase --cover-package=fedocal $*

file modified
-4
@@ -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

file modified
+9 -5
@@ -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 @@ 

  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',

file modified
-3
@@ -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

file added
+22
@@ -0,0 +1,22 @@ 

+ [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

+ passenv = HOME

+ commands =

+     nosetests --with-coverage --cover-erase --cover-package=fedocal {posargs}

+ 

+ 

+ [testenv:lint]

+ deps =

+     pylint

+ commands =

+     pylint -f parseable fedocal