-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
40 lines (30 loc) · 1.07 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.path
from setuptools import find_packages, setup
def in_this_dir(basename):
return os.path.join(os.path.dirname(__file__), basename)
def get_version(name):
init_file = os.path.join(in_this_dir(name), '__init__.py')
version_indicator = '__version__ = '
with open(init_file) as f:
for line in f:
if line.startswith(version_indicator):
version_part = line[len(version_indicator):]
version = version_part.strip().strip("'").strip('"')
return version
else:
raise RuntimeError('No version found in {}'.format(init_file))
with open(in_this_dir('README.md')) as f:
LONG_DESCRIPTION = f.read()
with open(in_this_dir('requirements.txt')) as f:
REQUIREMENTS = [line.strip() for line in f
if not line.strip().startswith('#')]
NAME = 'joeynmt_server'
VERSION = get_version(NAME)
setup(
name=NAME,
version=VERSION,
packages=find_packages(),
long_description=LONG_DESCRIPTION,
include_package_data=True,
install_requires=REQUIREMENTS,
)