-
Notifications
You must be signed in to change notification settings - Fork 4
/
setup.py
132 lines (106 loc) · 3.67 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# pylint: disable=no-member, no-name-in-module, import-error
from __future__ import absolute_import
import glob
import os
import distutils.command.sdist
import distutils.log
import subprocess
from setuptools import Command, setup
import setuptools.command.sdist
# Patch setuptools' sdist behaviour with distutils' sdist behaviour
setuptools.command.sdist.sdist.run = distutils.command.sdist.sdist.run
VERSION_INFO = {}
CWD = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(CWD, "dxlmaxmindservice", "_version.py")) as f:
exec(f.read(), VERSION_INFO) # pylint: disable=exec-used
class LintCommand(Command):
"""
Custom setuptools command for running lint
"""
description = 'run lint against project source files'
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
self.announce("Running pylint for library source files and tests",
level=distutils.log.INFO)
subprocess.check_call(["pylint", "dxlmaxmindservice", "tests"] +
glob.glob("*.py"))
self.announce("Running pylint for samples", level=distutils.log.INFO)
subprocess.check_call(["pylint"] + glob.glob("sample/*.py") +
glob.glob("sample/**/*.py") +
["--rcfile", ".pylintrc.samples"])
class CiCommand(Command):
"""
Custom setuptools command for running steps that are performed during
Continuous Integration testing.
"""
description = 'run CI steps (lint, test, etc.)'
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
self.run_command("lint")
self.run_command("test")
TEST_REQUIREMENTS = ["mock", "nose", "astroid<2.3.0", "pylint<=2.3.1"]
DEV_REQUIREMENTS = TEST_REQUIREMENTS + ["sphinx"]
setup(
# Package name:
name="dxlmaxmindservice",
# Version number:
version=VERSION_INFO["__version__"],
# Requirements
install_requires=[
"requests",
"maxminddb",
"dxlbootstrap>=0.2.0",
"dxlclient>=4.1.0.184"
],
tests_require=TEST_REQUIREMENTS,
extras_require={
"dev": DEV_REQUIREMENTS,
"test": TEST_REQUIREMENTS
},
test_suite="nose.collector",
# Package author details:
author="McAfee LLC",
# License
license="Apache License 2.0",
# Keywords
keywords=['opendxl', 'dxl', 'mcafee', 'service', 'maxmind', 'geolocation'],
# Packages
packages=[
"dxlmaxmindservice",
"dxlmaxmindservice._config",
"dxlmaxmindservice._config.sample",
"dxlmaxmindservice._config.app"],
package_data={
"dxlmaxmindservice._config.sample": ['*'],
"dxlmaxmindservice._config.app": ['*']},
# Details
url="http://www.mcafee.com/",
description="MaxMind Geolocation DXL service library",
long_description=open('README').read(),
python_requires='>=2.7.9,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*',
classifiers=[
"Development Status :: 4 - Beta",
"Topic :: Software Development :: Libraries :: Python Modules",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"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 :: 3.7"
],
cmdclass={
"ci": CiCommand,
"lint": LintCommand
}
)