-
Notifications
You must be signed in to change notification settings - Fork 4
/
setup.py
40 lines (33 loc) · 1.13 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
import os
import re
from setuptools import setup
PROJECT_ROOT = os.path.dirname(os.path.realpath(__file__))
VERSION_FILE = os.path.join(PROJECT_ROOT, "src", "posteriordb", "__init__.py")
README_FILE = os.path.join(PROJECT_ROOT, "README.md")
def get_long_description():
with open(README_FILE, "rt") as buff:
return buff.read()
def get_version():
lines = open(VERSION_FILE, "rt").readlines()
version_regex = r"^__version__ = ['\"]([^'\"]*)['\"]"
for line in lines:
mo = re.search(version_regex, line, re.M)
if mo:
return mo.group(1)
raise RuntimeError("Unable to find version in %s." % (VERSION_FILE,))
setup(
name="posteriordb",
version=get_version(),
description="python interface to posterior database",
url="https://github.com/MansMeg/posteriordb",
author="Eero Linna",
author_email="[email protected]",
license="GPL",
long_description=get_long_description(),
long_description_content_type="text/markdown",
packages=["posteriordb"],
package_dir={"": "src"},
install_requires=["requests"],
zip_safe=False,
include_package_data=True,
)