Skip to content

Commit

Permalink
Merge branch '83_tox_testing' into feature/task-2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
ralphbean committed Jan 19, 2015
2 parents 05e4e83 + 7f0b836 commit bbd7484
Show file tree
Hide file tree
Showing 9 changed files with 92 additions and 20 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ dist
test.html
*.egg*
*.pdf
.tox/*
10 changes: 10 additions & 0 deletions .tox_build_taskwarrior.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash
if [ ! -d "$1/task" ]; then
git clone https://git.tasktools.org/scm/tm/task.git $1/task
cd $1/task
git checkout $TASKWARRIOR
cmake -DCMAKE_INSTALL_PREFIX:PATH=$1 .
make
make install
cd $2
fi
15 changes: 12 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,20 @@ python:
- "2.7"
- "3.2"
- "3.3"
env:
- TASKWARRIOR=v2.2.0
- TASKWARRIOR=v2.3.0
- TASKWARRIOR=v2.4.0
before_install:
- sudo add-apt-repository ppa:ultrafredde/ppa -y
- sudo apt-get update -qq
- sudo apt-get install -qq task
- sudo apt-get install -y python-dev cmake build-essential libgnutls28-dev uuid-dev gnutls-bin chrpath libssl-dev libfontconfig1-dev
- git clone https://git.tasktools.org/scm/tm/task.git
- cd task
- git checkout $TASKWARRIOR
- cmake .
- make
- sudo make install
- task --version
- cd ../
install: python setup.py install
script: python setup.py test
notifications:
Expand Down
5 changes: 5 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
include README.rst
include LICENSE.txt
include requirements.txt
include test_requirements.txt
include .tox_tests.sh
include tox.ini
include setup.cfg
recursive-include taskw/test/data *
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
six>=1.8.0
python-dateutil>=2.2,<3
pytz
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[pytest]
norecursedirs=lib
50 changes: 33 additions & 17 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import os
import multiprocessing
import logging
import sys
from setuptools import setup, find_packages
import uuid

version = '0.8.6'

Expand All @@ -10,22 +11,37 @@
long_description = long_description.split('split here', 1)[1]
f.close()

install_requires = [
"six",
"python-dateutil",
"pytz",
]
tests_require = [
'nose',
]
REQUIREMENTS_FILES = {
'test': 'test_requirements.txt',
'install': 'requirements.txt',
}
REQUIREMENTS = {}
for category, filename in REQUIREMENTS_FILES.items():
requirements_path = os.path.join(
os.path.dirname(__file__),
filename
)
try:
from pip.req import parse_requirements
requirements = [
str(req.req) for req in parse_requirements(
requirements_path,
session=uuid.uuid1()
)
]
except ImportError:
requirements = []
with open(requirements_path, 'r') as in_:
requirements = [
req for req in in_.readlines()
if not req.startswith('-')
and not req.startswith('#')
]
REQUIREMENTS[category] = requirements

if sys.version_info < (2, 7):
tests_require.append('unittest2')

if sys.version_info[0] == 2 and sys.version_info[1] < 7:
install_requires.extend([
'ordereddict',
])
REQUIREMENTS['test'].append('unittest2')
REQUIREMENTS['install'].append('ordereddict')

setup(name='taskw',
version=version,
Expand All @@ -50,9 +66,9 @@
packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
include_package_data=True,
zip_safe=False,
install_requires=install_requires,
install_requires=REQUIREMENTS['install'],
test_suite='nose.collector',
tests_require=tests_require,
tests_require=REQUIREMENTS['test'],
entry_points="""
# -*- Entry points: -*-
""",
Expand Down
2 changes: 2 additions & 0 deletions test_requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
nose>=1.3.4,<2
tox>=1.8.1,<2
24 changes: 24 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[tox]
envlist = {py26,py27,py32,py33,py34}-tw{22,23,24}
downloadcache = {toxworkdir}/_download/

[testenv]
basepython =
py26: python2.6
py27: python2.7
py32: python3.2
py33: python3.3
py34: python3.4
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/test_requirements.txt
py26: unittest2
py26: ordereddict
setenv =
tw22: TASKWARRIOR=v2.2.0
tw23: TASKWARRIOR=v2.3.0
tw24: TASKWARRIOR=v2.4.0
sitepackages = False
commands =
{toxinidir}/.tox_build_taskwarrior.sh "{envdir}" "{toxinidir}"
nosetests {posargs}

0 comments on commit bbd7484

Please sign in to comment.