-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathsetup.py
90 lines (74 loc) · 2.25 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
79
80
81
82
83
84
85
86
87
88
89
90
from distutils.core import setup
from setuptools import find_packages
from setuptools.command.develop import develop
from setuptools.command.install import install
import sys
import re
if sys.version_info[0] == 2:
sys.exit("Sorry, Python 2 is not supported.")
def obtain_version():
"""
Obtains the version as specified in prophesy.
:return: Version of prophesy.
"""
verstr = "unknown"
try:
verstrline = open('paynt/_version.py', "rt").read()
except EnvironmentError:
pass # Okay, there is no version file.
else:
VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]"
mo = re.search(VSRE, verstrline, re.M)
if mo:
verstr = mo.group(1)
else:
raise RuntimeError("unable to find version in paynt/_version.py")
return verstr
class ConfigDevelop(develop):
"""
Custom command to write the config files after installation
"""
user_options = develop.user_options
def initialize_options(self):
develop.initialize_options(self)
def finalize_options(self):
develop.finalize_options(self)
def run(self):
develop.run(self)
class ConfigInstall(install):
"""
Custom command to write the config files after installation
"""
user_options = install.user_options
def initialize_options(self):
install.initialize_options(self)
def finalize_options(self):
install.finalize_options(self)
def run(self):
install.run(self)
setup(
name="paynt",
version=obtain_version(),
author="Sebastian Junges",
author_email="[email protected]",
maintainer="Sebastian Junges",
maintainer_email="[email protected]",
license="GPLv3",
url="https://github.com/randriu/synthesis",
description="PAYNT (Probabilistic progrAm sYNThesizer)",
long_description=
"PAYNT (Probabilistic progrAm sYNThesizer) is a tool for automated synthesis of probabilistic programs.",
packages=find_packages(),
install_requires=['click', 'stormpy', 'z3-solver'],
extras_require={},
package_data={
'paynt': [],
},
scripts=[
'paynt.py'
],
cmdclass={
'develop': ConfigDevelop,
'install': ConfigInstall,
}
)