-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.py
65 lines (53 loc) · 1.77 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
# setup.py
from setuptools import setup
import setuptools
import shutil
import os
LOG_DIR = "/var/log/ep2"
CONFIG_DIR = "/etc/ep2"
SAMPLE_CONFIG_DIR = "etc"
CONFIG_FILE = "ep2.conf"
TEMPLATE_FILE = "haproxy.cfg.template"
def pre_setup():
if not os.path.exists(LOG_DIR):
os.mkdir(LOG_DIR)
if not os.path.exists(CONFIG_DIR):
os.mkdir(CONFIG_DIR)
base_path = os.path.dirname(os.path.realpath(__file__))
source_config = os.path.join(base_path, SAMPLE_CONFIG_DIR, CONFIG_FILE)
source_template = os.path.join(base_path, SAMPLE_CONFIG_DIR, TEMPLATE_FILE)
shutil.copy(source_config, os.path.join(CONFIG_DIR, CONFIG_FILE))
shutil.copy(source_template, os.path.join(CONFIG_DIR, TEMPLATE_FILE))
def readme():
return "EP2"
#with open('README.rst') as f:
#return f.read()
def get_dependencies():
with open("requirements.txt") as req:
lines = req.readlines()
lines = [line.strip() for line in lines]
return lines
setup(name='elasticpyproxy-1.0-djmgit',
version='0.1',
description='A controller for haproxy for autoscaling backends.',
long_description=readme(),
classifiers=[
'Development Status :: 1.0',
'License :: GPL',
'Programming Language :: Python :: 3.6',
'Topic :: Automation :: Systems :: Devops',
],
keywords='haproxy automation cloud devops systems',
url='https://github.com/djmgit/ElasticPyProxy',
author='Deepjyoti Mondal',
author_email='djmdeveloper060796@gmail.com',
license='GPL',
packages=setuptools.find_packages(),
install_requires=get_dependencies(),
entry_points={
'console_scripts': ['ep2=src.driver.driver:drive'],
},
include_package_data=True,
zip_safe=False)
if __name__ == "__main__":
pre_setup()