Skip to content

Commit 4899645

Browse files
author
Yamashita Yuu
committed
setup tox.
1 parent 44254e3 commit 4899645

File tree

5 files changed

+33
-8
lines changed

5 files changed

+33
-8
lines changed

.gitignore

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
.Python
2-
bin/
3-
include/
4-
lib/
5-
share/
6-
src/
2+
*.swp
3+
*.swo
74
*.pyc
5+
*.pyo
6+
/*.egg-info
7+
/.tox
8+
/build
9+
/dist

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ This library is distributed as 'fluent-logger' python package. Please execute th
1313

1414
$ pip install fluent-logger
1515

16+
On Python 2.5, you have to install 'simplejson' in addition.
17+
1618
## Configuration
1719

1820
Fluent daemon must be lauched with the following configuration:

fluent/handler.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
import msgpack
55
import socket
66
import threading
7-
import json
7+
8+
try:
9+
import json
10+
except ImportError:
11+
import simplejson as json
812

913
from fluent import sender
1014

setup.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
#!/usr/bin/python
22

3-
from distutils.core import setup
43
from os import path
54

5+
try:
6+
from setuptools import setup
7+
except ImportError:
8+
from distutils.core import setup
9+
610
README = path.abspath(path.join(path.dirname(__file__), 'README.md'))
711
desc = 'A Python logging handler for Fluentd event collector'
812

@@ -24,5 +28,6 @@
2428
'Programming Language :: Python :: 3',
2529
'Development Status :: 4 - Beta',
2630
'Intended Audience :: Developers',
27-
]
31+
],
32+
test_suite='tests'
2833
)

tox.ini

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[tox]
2+
envlist = py25, py26, py27
3+
4+
[testenv]
5+
commands=python setup.py test
6+
7+
[testenv:py25]
8+
deps = simplejson
9+
10+
[testenv:py26]
11+
12+
[testenv:py27]

0 commit comments

Comments
 (0)