forked from DataDog/integrations-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
73 lines (62 loc) · 2.46 KB
/
Copy pathsetup.py
File metadata and controls
73 lines (62 loc) · 2.46 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
# (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from io import open
from os import path
from setuptools import setup
HERE = path.dirname(path.abspath(__file__))
with open(path.join(HERE, 'datadog_checks', 'dev', '__about__.py'), 'r', encoding='utf-8') as f:
for line in f:
line = line.strip()
if line.startswith('__version__'):
VERSION = line.split('=')[1].strip(' \'"')
break
else:
VERSION = '0.0.1'
with open(path.join(HERE, 'README.md'), 'r', encoding='utf-8') as f:
README = f.read()
def parse_pyproject_array(name):
import os
import re
from ast import literal_eval
pattern = r'^{} = (\[.+?\])$'.format(name)
with open(os.path.join(HERE, 'pyproject.toml'), 'r', encoding='utf-8') as f:
# Windows \r\n prevents match
contents = '\n'.join(line.rstrip() for line in f.readlines())
array = re.search(pattern, contents, flags=re.MULTILINE | re.DOTALL).group(1)
return literal_eval(array)
setup(
name='datadog_checks_dev',
version=VERSION,
description='The Datadog Checks Developer Tools',
long_description=README,
long_description_content_type='text/markdown',
keywords='datadog agent checks dev tools tests',
url='https://github.com/DataDog/integrations-core',
author='Datadog',
author_email='packages@datadoghq.com',
license='BSD',
# See https://pypi.org/classifiers
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
],
packages=['datadog_checks', 'datadog_checks.dev'],
install_requires=parse_pyproject_array('dependencies'),
# TODO: Uncomment when we fully drop Python 2
# python_requires='>=3.7',
include_package_data=True,
extras_require={'cli': parse_pyproject_array('cli')},
entry_points={
'pytest11': ['datadog_checks = datadog_checks.dev.plugin.pytest'],
'tox': ['datadog_checks = datadog_checks.dev.plugin.tox'],
'console_scripts': ['ddev = datadog_checks.dev.tooling.cli:ddev'],
},
)