-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
78 lines (68 loc) · 2.08 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
from setuptools import setup
import os
hasrepo = os.path.exists(".git")
print("Running setup.py hasrepo=%s" % hasrepo)
# check if we are operating on the repo.
# if true, than we take the files and the version from the repo status
version="0.0"
datafiles=[]
if hasrepo:
from git import Git
repo = Git(".")
# write VERSION.txt
from k8ssetup import version
version = version.getVersionFromRepo(repo)
with open("k8ssetup/VERSION.txt", 'w') as fs:
fs.write(version)
# write MANIFEST.in
# we generate this, because we only need the files which are not gitignored
files = repo.ls_files("k8ssetup/lib").splitlines() + repo.ls_files("k8ssetup/conf").splitlines() + ["k8ssetup/VERSION.txt"]
datadict=dict()
with open("MANIFEST.in", 'w') as fs:
for file in files:
fs.write("include %s\n" % file)
dir = os.path.dirname(file)
if not datadict.get(dir):
datadict[dir] = [file]
else:
datadict[dir].append(file)
for dir in datadict:
datafiles.append((dir, datadict[dir]))
#print(datafiles)
else:
with open("k8ssetup/VERSION.txt", 'w') as fs:
version = fs.readline()
with open('README.md') as f:
long_description = f.read()
setup(
name='k8s-setup',
version=version,
description="Setup local and production hybrid clusters, using Ansible and Vagrant",
long_description=long_description,
long_description_content_type='text/markdown',
packages=['k8ssetup'],
url="https://github.com/world-direct/k8s-setup",
author="gprossliner",
author_email="[email protected]",
include_package_data=True,
install_requires=[
'click >= 7.0',
'ansible >= 2.8.6',
'kubernetes >= 10.0',
'colorlog >= 4.1.0',
'pyyaml >= 5.2',
'jmespath >= 0.10.0'
],
# data_files={
# "/":datafiles
# },
setup_requires=[
'GitPython >= 2.1.14'
],
entry_points={
"console_scripts" : [
"k8s-setup=k8ssetup.cli:main"
]
}
)