[SEBA-314] Refactoring multistructlog
- Redid the way loggers are created to use vanilla structlog
- This fixes the incorrect line numbering and similar in SEBA-314
- Fix/rewrite unit tests
- Apply pep8 formatting
- Make compatible with Python 3.x, enable multi-version testing with tox
- Removed XOS specific code
Change-Id: I615bc6f32ba2592475e3a8cf22850c563001a3d4
diff --git a/setup.py b/setup.py
index 4e69f55..9337274 100644
--- a/setup.py
+++ b/setup.py
@@ -16,23 +16,44 @@
from setuptools import setup
-setup(name='multistructlog',
- version='1.5',
- description='structlog with multiple simultaneous logging backends',
- author='Varun Belur, Sapan Bhatia',
- author_email='varun@opennetworking.org,sapan@opennetworking.org',
- py_modules=['multistructlog'],
- license='Apache 2',
- classifiers=[
- 'Development Status :: 5 - Production/Stable',
- 'Intended Audience :: Developers',
- 'Topic :: System :: Logging',
- 'License :: OSI Approved :: Apache Software License',
- 'Programming Language :: Python :: 2.7'
- ],
- copyright='Open Networking Foundation',
- include_package_data=True,
- install_requires=['structlog', 'python-logstash', 'colorama'],
- keywords=['multistructlog', 'structlog',
- 'multiple backends', 'xos logging']
- )
+
+def readme():
+ with open('README.rst') as f:
+ return f.read()
+
+
+def version():
+ with open('VERSION') as f:
+ return f.read()
+
+
+def parse_requirements(filename):
+ lineiter = (line.strip() for line in open(filename))
+ return [line for line in lineiter if line and not line.startswith("#")]
+
+
+setup(
+ name='multistructlog',
+ version=version(),
+ description='structlog with multiple simultaneous logging backends',
+ long_description=readme(),
+ author='Varun Belur, Sapan Bhatia, Zack Williams',
+ author_email='''
+ varun@opennetworking.org,sapan@opennetworking.org,zdw@opennetworking.org
+ ''',
+ py_modules=['multistructlog'],
+ license='Apache v2',
+ classifiers=[
+ 'Development Status :: 5 - Production/Stable',
+ 'Intended Audience :: Developers',
+ 'Topic :: System :: Logging',
+ 'License :: OSI Approved :: Apache Software License',
+ 'Programming Language :: Python :: 2.7',
+ 'Programming Language :: Python :: 3',
+ ],
+ copyright='Open Networking Foundation',
+ include_package_data=True,
+ install_requires=parse_requirements('requirements.txt'),
+ keywords=['multistructlog', 'structlog', 'multiple backends'],
+ data_files=[('', ['VERSION', 'requirements.txt', 'README.rst'])],
+)