-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
100 lines (88 loc) · 3.45 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
"""
This script will work from within the main package directory.
python setup.py sdist bdist_wheel
twine upload dist/pysimplelog-...
"""
try:
from setuptools import setup
except:
from distutils.core import setup
from distutils.util import convert_path
import os, sys
# set package path and name
PACKAGE_PATH = '.'
PACKAGE_NAME = 'pysimplelog'
# check python version
if sys.version_info[:2] < (2, 6):
raise RuntimeError("Python version 2.6.x and above is required.")
# automatically create MANIFEST.in
commands = [# include MANIFEST.in
'# include this file, to ensure we can recreate source distributions',
'include MANIFEST.in'
# exclude all .log files
'\n# exclude all logs',
'global-exclude *.log',
# exclude all other non necessary files
'\n# exclude all other non necessary files ',
'global-exclude .project',
'global-exclude .pydevproject',
# exclude all of the subversion metadata
'\n# exclude all of the subversion metadata',
'global-exclude *.svn*',
'global-exclude .svn/*',
'global-exclude *.git*',
'global-exclude .git/*',
# include all LICENCE files
'\n# include all license files found',
'global-include ./*LICENSE.*',
# include all README files
'\n# include all readme files found',
'global-include ./*README.*',
'global-include ./*readme.*']
with open('MANIFEST.in','w') as fd:
for l in commands:
fd.write(l)
fd.write('\n')
# declare classifiers
CLASSIFIERS = """\
Development Status :: 5 - Production/Stable
Intended Audience :: Science/Research
Intended Audience :: Developers
License :: OSI Approved :: GNU Affero General Public License v3
Programming Language :: Python
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3
Topic :: Software Development
Topic :: Software Development :: Build Tools
Topic :: Scientific/Engineering
Operating System :: Microsoft :: Windows
Operating System :: POSIX
Operating System :: Unix
Operating System :: MacOS
"""
# create descriptions
LONG_DESCRIPTION = ["This is a pythonic simple yet complete system logger.",
"It allows logging simultaneously to two streams, the first one is the system standard output by default and the second one is designated to be set to a file.",
"In addition, pysimplelog is text colouring and attributes enabled when the stream allows it.",]
DESCRIPTION = [ LONG_DESCRIPTION[0] ]
## get package info
PACKAGE_INFO={}
infoPath = convert_path('__pkginfo__.py')
with open(infoPath) as fd:
exec(fd.read(), PACKAGE_INFO)
# create meta data
metadata = dict(name = PACKAGE_NAME,
packages=[PACKAGE_NAME],
package_dir={PACKAGE_NAME: '.'},
version= PACKAGE_INFO['__version__'] ,
author="Bachir AOUN",
author_email="bachir.aoun@e-aoun.com",
description = "\n".join(DESCRIPTION),
long_description = "\n".join(LONG_DESCRIPTION),
url = "http://bachiraoun.github.io/pysimplelog/",
download_url = "https://github.com/bachiraoun/simplelog",
license = 'GNU',
classifiers=[_f for _f in CLASSIFIERS.split('\n') if _f],
platforms = ["Windows", "Linux", "Mac OS-X", "Unix"], )
# setup
setup(**metadata)