-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
executable file
·98 lines (77 loc) · 2.94 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
#!/usr/bin/env python
# coding: utf-8
from __future__ import absolute_import
from __future__ import unicode_literals
from io import open
from setuptools import find_packages
from setuptools import setup
import codecs
import os
import re
PROJECT_DIR = os.path.abspath(os.path.dirname(__file__))
RELEASE_FILENAME = os.path.join(PROJECT_DIR, 'dnsq/release.py')
class Release(object):
"""Avoid the import just read the file
"""
__version__ = None
__author__ = None
__author_email__ = None
__url__ = None
def __init__(self):
with open(RELEASE_FILENAME, encoding='utf-8', mode='r') as fd:
self.content = fd.read()
for line in self.content.splitlines():
if line.startswith('__') is False:
continue
key, val = re.split(r'\s*=\s*', line)
val = val.replace('"', '').replace("'", '')
setattr(self, key, val)
release = Release()
assert release.__version__ is not None, 'Please set __version__ in {}'.format(RELEASE_FILENAME)
assert release.__author__ is not None, 'Please set __author__ in {}'.format(RELEASE_FILENAME)
assert release.__author_email__ is not None, 'Please set __author_email__ in {}'.format(RELEASE_FILENAME)
assert release.__url__ is not None, 'Please set __url__ in {}'.format(RELEASE_FILENAME)
def read(fname):
file_path = os.path.join(PROJECT_DIR, fname)
return codecs.open(file_path, encoding='utf-8').read()
def read_requirements(fname):
fname = os.path.join(PROJECT_DIR, fname)
with open(fname, mode='r', encoding='utf-8') as fd:
result = fd.read().splitlines()
return result
EXCLUDE_FROM_PACKAGES = []
REQUIRED_LIBRARIES = read_requirements('requirements.txt')
setup(
name='dnsq',
version=release.__version__,
author=release.__author__,
author_email=release.__author_email__,
maintainer=release.__author__,
maintainer_email=release.__author_email__,
license='Apache Software License 2.0',
packages=find_packages(exclude=EXCLUDE_FROM_PACKAGES),
url=release.__url__,
description='A python utility for querying information in DNS',
long_description=read('README.md'),
install_requires=REQUIRED_LIBRARIES,
classifiers=[
'Development Status :: 4 - Beta',
'Framework :: Pytest',
'Intended Audience :: System Administrators',
'Intended Audience :: DevOps',
'Intended Audience :: Developers',
'Topic :: Software Development :: DNS',
'Programming Language :: Python',
'Programming Language :: Python :: 2.7.14',
'Programming Language :: Python :: 2.7.15',
'Programming Language :: Python :: 3.6.6',
'Programming Language :: Python :: Implementation :: CPython',
'Operating System :: OS Independent',
'License :: OSI Approved :: Apache Software License',
],
zip_safe=False,
include_package_data=True,
scripts=[
'bin/dnsq',
],
)