This repository has been archived by the owner on Jul 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
50 lines (43 loc) · 1.93 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
#!/usr/bin/env python3
# =============================================================================
# @file setup.py
# @brief Turf setup file
# @author Michael Hucka <[email protected]>
# @license Please see the file named LICENSE in the project directory
# @website https://github.com/caltechlibrary/turf
# =============================================================================
import os
from os import path
from setuptools import setup
import sys
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'requirements.txt')) as f:
reqs = f.read().rstrip().splitlines()
# The following reads the variables without doing an "import turf",
# because the latter will cause the python execution environment to fail if
# any dependencies are not already installed -- negating most of the reason
# we're using setup() in the first place. This code avoids eval, for security.
version = {}
with open(path.join(here, 'turf/__version__.py')) as f:
text = f.read().rstrip().splitlines()
vars = [line for line in text if line.startswith('__') and '=' in line]
for v in vars:
setting = v.split('=')
version[setting[0].strip()] = setting[1].strip().replace("'", '')
# Finally, define our namesake.
setup(
name = version['__title__'].lower(),
description = version['__description__'],
long_description = 'Turf is a program to download records from the Caltech TIND.io database and check the URLs that may be embedded within the records.',
version = version['__version__'],
url = version['__url__'],
author = version['__author__'],
author_email = version['__email__'],
license = version['__license__'],
keywords = "TIND MARC library-catalogues",
packages = ['turf'],
scripts = ['bin/turf'],
install_requires = reqs,
platforms = 'any',
python_requires = '>=3',
)