forked from opendxl/opendxl-client-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
143 lines (116 loc) · 3.71 KB
/
setup.py
File metadata and controls
143 lines (116 loc) · 3.71 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
""" Setup script for the dxlclient package """
# pylint: disable=no-member, no-name-in-module, import-error, wrong-import-order
# pylint: disable=missing-docstring, no-self-use
from __future__ import absolute_import
import glob
import os
from setuptools import Command, setup
import setuptools.command.sdist
import distutils.command.sdist
import distutils.log
import subprocess
# Patch setuptools' sdist behaviour with distutils' sdist behaviour
setuptools.command.sdist.sdist.run = distutils.command.sdist.sdist.run
PRODUCT_PROPS = {}
CWD = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(CWD, "dxlclient", "_product_props.py")) as f:
exec(f.read(), PRODUCT_PROPS) # 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", "dxlclient"] + glob.glob("*.py"))
self.announce("Running pylint for examples", level=distutils.log.INFO)
subprocess.check_call(["pylint"] + glob.glob("examples/*.py") +
glob.glob("examples/**/*.py") +
["--rcfile", ".pylintrc.examples"])
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 = [
'futures; python_version == "2.7"',
"mock",
"nose",
"parameterized",
"pylint",
"requests-mock"
]
DEV_REQUIREMENTS = TEST_REQUIREMENTS + ["sphinx"]
setup(
# Application name:
name="dxlclient",
# Version number:
version=PRODUCT_PROPS["__version__"],
# Application author details:
author="McAfee, Inc.",
# License
license="Apache License 2.0",
keywords=['opendxl', 'dxl', 'mcafee', 'client'],
# Packages
packages=[
"dxlclient",
"dxlclient._cli"
],
# Include additional files into the package
include_package_data=True,
install_requires=[
"asn1crypto",
"configobj",
"msgpack>=0.5",
"oscrypto",
"paho-mqtt>=1.3",
"requests"
],
tests_require=TEST_REQUIREMENTS,
extras_require={
"dev": DEV_REQUIREMENTS,
"test": TEST_REQUIREMENTS
},
test_suite="nose.collector",
# Details
url="http://www.mcafee.com/",
description="McAfee Data Exchange Layer Client",
long_description=open('README').read(),
python_requires='>=2.7.9,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*',
classifiers=[
"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
},
entry_points={
'console_scripts': [
'dxlclient = dxlclient._cli:cli_run'
],
}
)