forked from infothrill/python-dyndnsc
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsetup.py
More file actions
113 lines (98 loc) · 3.52 KB
/
setup.py
File metadata and controls
113 lines (98 loc) · 3.52 KB
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
101
102
103
104
105
106
107
108
109
110
111
112
113
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import re
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
BASEDIR = os.path.dirname(__file__)
with open(os.path.join(BASEDIR, 'dyndnsc', '__init__.py'), 'r') as f:
PACKAGE_INIT = f.read()
VERSION = re.compile(
r".*__version__ = '(.*?)'", re.S).match(PACKAGE_INIT).group(1)
with open(os.path.join(BASEDIR, 'README.rst'), 'r') as f:
README = f.read()
with open(os.path.join(BASEDIR, 'CHANGELOG.rst'), 'r') as f:
CHANGELOG = f.read()
CLASSIFIERS = (
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: DFSG approved',
'License :: OSI Approved',
'License :: OSI Approved :: MIT License',
'Topic :: Internet :: Name Service (DNS)',
'Topic :: Software Development :: Libraries :: Python Modules',
'Environment :: Console',
'Natural Language :: English',
'Operating System :: MacOS :: MacOS X',
'Operating System :: POSIX :: Linux',
'Operating System :: POSIX :: BSD :: FreeBSD',
'Programming Language :: Python',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4'
)
def patch_test_requires(requires):
"""python version compatibility"""
if sys.version_info < (3, 3):
return requires + ["mock"]
else:
return requires
def patch_install_requires(requires):
"""python version compatibility"""
to_add = []
if sys.version_info < (3, 3):
to_add.append("IPy>=0.56")
if sys.version_info < (3, 2):
to_add.append("argparse")
# This is equivalent to requests[security] which exists since
# requests 2.4.1 It is required in older Pythons that do not
# understand SNI certificates. When these libraries are available
# they are being used and incidentally also support SNI
to_add.append("pyOpenSSL")
to_add.append("ndg-httpsclient")
to_add.append("pyasn1")
if sys.version_info < (2, 7): # continue support for python 2.6
to_add.append("importlib")
return requires + to_add
if sys.version_info < (2, 7, 4):
# work around python issue http://bugs.python.org/issue15881
# affects only python2 when using multiprocessing and if nose is installed
# was fixed in Python 2.7.4
import multiprocessing
setup(
name='dyndnsc',
packages=[
'dyndnsc',
'dyndnsc.common',
'dyndnsc.detector',
'dyndnsc.plugins',
'dyndnsc.resources',
'dyndnsc.tests',
'dyndnsc.updater',
],
version=VERSION,
author='Paul Kremer',
author_email='@'.join(("paul", "spurious.biz")), # avoid spam,
license='MIT License',
description='dynamic dns (dyndns) update client that tries to be '
'extensible, re-usable and efficient on network resources',
long_description=README + '\n\n' + CHANGELOG,
url='https://github.com/infothrill/python-dyndnsc',
install_requires=patch_install_requires(
['requests>=2.0.1', 'netifaces>=0.10.4', 'setuptools']),
entry_points=("""
[console_scripts]
dyndnsc=dyndnsc.cli:main
"""),
classifiers=CLASSIFIERS,
test_suite='dyndnsc.tests',
tests_require=patch_test_requires(['bottle==0.12.7', 'pep8>=1.3']),
package_data={'dyndnsc/resources': ['dyndnsc/resources/*.ini']},
include_package_data=True,
zip_safe = False
)