forked from ARPA-SIMC/arkimaps
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
47 lines (43 loc) · 1.28 KB
/
Copy pathsetup.py
File metadata and controls
47 lines (43 loc) · 1.28 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
#!/usr/bin/env python3
# coding: utf-8
from setuptools import setup
import ast
# Read VERSION from arkimaps
version = None
with open("arkimaps") as fd:
tree = ast.parse(fd.read(), "arkimaps")
for stm in tree.body:
if version is not None:
break
if not isinstance(stm, ast.Assign):
continue
for target in stm.targets:
if not isinstance(target, ast.Name):
continue
if target.id != "VERSION":
continue
if isinstance(stm.value, ast.Constant):
version = stm.value.value
break
elif isinstance(stm.value, ast.Str):
version = stm.value.s
break
if version is None:
raise RuntimeError("VERSION not found in arkimaps")
setup(
name='arkimaps',
version=version,
python_requires=">= 3.6",
description="Render maps from model output",
author='Enrico Zini',
author_email='enrico@enricozini.org',
url='https://github.com/ARPA-SIMC/arkimaps/',
license="http://www.gnu.org/licenses/gpl-3.0.html",
requires=["Magics", "yaml", "PIL"],
extras_require={
"arkimet": ["arkimet"],
},
packages=['arkimapslib'],
scripts=['arkimaps'],
include_package_data=True,
)