-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
78 lines (68 loc) · 2.88 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
#!/usr/bin/env python
# SPDX-FileCopyrightText: 2021 Jean-Sébastien Dieu <[email protected]>
#
# SPDX-License-Identifier: MIT
import os
import pathlib
import re
from setuptools import setup, find_packages
def read_version():
p = pathlib.Path(__file__)
p = p.parent / "monitor_server" / '__init__.py'
with p.open('r') as f:
for line in f:
if line.startswith('__version__'):
line = line.split('=')[1].strip()
match = re.match(r"^['\"](\d+\.\d+\.\d+\w*)['\"]", line)
if match:
return match.group(1)
raise ValueError('Unable to compute version')
def read(fname):
file_path = pathlib.Path(__file__).parent / fname
with file_path.open('r', encoding='utf-8') as f:
return f.read()
def get_requirements():
requirements = pathlib.Path(__file__).parent / 'requirements.txt'
if not requirements.exists() and os.environ.get('RTD_CONTEXT', 'no') == 'yes':
requirements = pathlib.Path(__file__).parent / 'requirements-prod.txt'
with requirements.open('r', encoding='utf-8') as f:
packages = f.readlines()
packages.append('wheel')
return list(set([i for i in packages]))
setup(
name='monitor-server-api',
version=read_version(),
author='Jean-Sébastien Dieu',
author_email='[email protected]',
maintainer='Jean-Sébastien Dieu',
maintainer_email='[email protected]',
license='MIT',
project_urls=dict(Source='https://github.com/CFMTech/monitor-server-api',
Tracker='https://github.com/CFMTech/monitor-server-api/issues'),
url='https://monitor-server-api.readthedocs.io/',
description='A REST API that can be used a central point for collecting metrics from pytest-monitor.',
entry_points={'console_scripts': ['monitor-server=monitor_server.app:main']},
long_description=read('README.md'),
long_description_content_type='text/markdown',
packages=find_packages('.', exclude=('tests', 'example', 'docs')),
package_data={'monitor_server': ['templates/*']},
include_package_data=True,
python_requires='>=3.6',
scripts=['scripts/launch-monitor-server.sh'],
install_requires=get_requirements(),
options={"bdist_wheel": {"universal": False}},
classifiers=[
'Development Status :: 5 - Production/Stable',
'Framework :: Pytest',
'Intended Audience :: Developers',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Operating System :: OS Independent',
'License :: OSI Approved :: MIT License',
],
)