-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
73 lines (63 loc) · 2.2 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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# cookiecutter-python version: 0.4.1
"""The setup script."""
import os
from setuptools import setup, find_packages
def parse_requirements(filename):
with open(os.path.join(setup_dir, filename)) as requirements_file:
requirements = requirements_file.readlines()
# Remove all lines that are comments
requirements = [
line for line in requirements if not line.strip().startswith("#")
]
# Remove pip flags
requirements = [
line for line in requirements if not line.strip().startswith("--")
]
# Remove inline comments
requirements = [
line.split("#", 1)[0] if "#" in line else line for line in requirements
]
# Remove empty lines
requirements = list(filter(None, requirements))
# Remove whitespaces
requirements = [line.strip().replace(" ", "") for line in requirements]
return requirements
cmd_class = {}
setup_dir = os.path.dirname(os.path.abspath(__file__))
with open(os.path.join(setup_dir, "README.rst"), encoding="utf-8") as readme_file:
readme = readme_file.read()
with open(os.path.join(setup_dir, "CHANGELOG.rst"), encoding="utf-8") as history_file:
history = history_file.read()
with open(
os.path.join(setup_dir, "reporting_api_client", "VERSION"),
"r",
encoding="utf-8",
) as vf:
version = vf.read().strip()
setup(
name="jampp_reporting_api_client",
description="Client for Reporting API.",
version=version,
author="Jampp",
author_email="[email protected]",
install_requires=[parse_requirements("requirements.in")],
extras_require={
"dev": parse_requirements("requirements-dev.txt"),
"pandas": ["pandas"],
},
long_description=readme + "\n\n" + history,
long_description_content_type="text/x-rst",
package_data={
"": ["*.pxd", "*.pyx"],
"reporting_api_client": ["VERSION"],
},
packages=find_packages(include=["reporting_api_client", "reporting_api_client.*"]),
test_suite="tests",
tests_require=[
"pytest==4.6.3",
],
url="https://github.com/jampp/reporting-api-client",
zip_safe=False,
)