-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
28 lines (24 loc) · 777 Bytes
/
setup.py
File metadata and controls
28 lines (24 loc) · 777 Bytes
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
#!/usr/bin/env python3
import configparser
from setuptools import setup
def parseCSV(input):
if input == "":
return []
return [a.strip() for a in input.split(",")]
config = configparser.ConfigParser()
config.read("config.ini")
with open("./environment", "w") as f:
f.write("\n".join([
"#!/usr/bin/env sh",
"export PYTHONPATH=$PYTHONPATH:./lib"
"export FLASK_APP={}".format(config["setup"].get("package", "app"))
])+"\n")
setup(
name = config["setup"].get("name"),
packages=[config["setup"].get("package", "app")] + parseCSV(config["setup"].get("packages", "")),
include_package_data=True,
install_requires=[
'flask',
'flask-sqlalchemy'
] + parseCSV(config["setup"].get("requires", "")),
)