-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
48 lines (34 loc) · 1.04 KB
/
setup.py
File metadata and controls
48 lines (34 loc) · 1.04 KB
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
import os
from setuptools import setup, find_packages
SETUP_ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
VERSION_FILEPATH = os.path.join(SETUP_ROOT_DIR, "version.txt")
PROMPT_TOOLKIT_AVAILABLE = True
def get_version():
version = None
with open(VERSION_FILEPATH) as version_file:
for line in version_file:
version = line.strip()
if version:
break
return version
def main():
invoke_entrypoint = "app.interface.definitions.invoke_cli:run_program"
cli_entrypoint = "app.main:entrypoint"
console_scripts = (
f"geoduck-invoke = {invoke_entrypoint}",
f"geoduck = {cli_entrypoint}",
)
setup_attrs = {
"name": "geoduck",
"packages": find_packages(),
"url": "https://github.com/scrdest/GeoDuck",
"entry_points": {
"console_scripts": console_scripts
}
}
version = get_version()
if version:
setup_attrs["version"] = version
setup(**setup_attrs)
if __name__ == '__main__':
main()