-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathsetup.py
executable file
·70 lines (58 loc) · 2.44 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/usr/bin/env python
# Verbose, notice, and spam log levels for Python's logging module.
#
# Author: Peter Odding <peter@peterodding.com>
# Last Change: March 7, 2017
# URL: https://verboselogs.readthedocs.io
"""Setup script for the `verboselogs` package."""
# Standard library modules.
import codecs
import os
import re
# De-facto standard solution for Python packaging.
from setuptools import find_packages, setup
def get_contents(*args):
"""Get the contents of a file relative to the source distribution directory."""
with codecs.open(get_absolute_path(*args), 'r', 'UTF-8') as handle:
return handle.read()
def get_version(*args):
"""Extract the version number from a Python module."""
contents = get_contents(*args)
metadata = dict(re.findall('__([a-z]+)__ = [\'"]([^\'"]+)', contents))
return metadata['version']
def get_absolute_path(*args):
"""Transform relative pathnames into absolute pathnames."""
return os.path.join(os.path.dirname(os.path.abspath(__file__)), *args)
setup(
name='verboselogs',
version=get_version('verboselogs', '__init__.py'),
description="Verbose logging level for Python's logging module",
long_description=get_contents('README.rst'),
url='https://verboselogs.readthedocs.io',
author='Peter Odding',
author_email='peter@peterodding.com',
packages=find_packages(),
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Intended Audience :: Information Technology',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Software Development',
'Topic :: Software Development :: Libraries',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: System',
'Topic :: System :: Logging',
'Topic :: System :: Systems Administration',
'Topic :: Terminals',
])