This repository has been archived by the owner on Jul 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 35
/
setup.py
51 lines (44 loc) · 2.05 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
#!/usr/bin/env python3
# =============================================================================
# @file setup.py
# @brief Nostril setup file
# @author Michael Hucka <[email protected]>
# @license Please see the file named LICENSE in the project directory
# @website https://github.com/casics/nostril
# =============================================================================
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 nostril",
# 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, 'nostril/__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 = 'Nostril (Nonsense String Evaluator) implements a heuristic mechanism to infer whether a given word or text string is likely to be meaningful or nonsense.',
version = version['__version__'],
url = version['__url__'],
author = version['__author__'],
author_email = version['__email__'],
license = version['__license__'],
keywords = "program-analysis text-processing gibberish-detection identifiers",
packages = ['nostril'],
scripts = ['bin/nostril'],
package_data = {'nostril': ['ngram_data.pklz']},
install_requires = reqs,
platforms = 'any',
python_requires = '>=3',
)