-
Notifications
You must be signed in to change notification settings - Fork 9
/
setup.py
78 lines (70 loc) · 2.36 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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
import sys
from os import path
from codecs import open
from setuptools import setup
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, 'README.md'), encoding='utf-8') as fp:
long_description = fp.read()
with open(path.join(here, 'es_synonyms', '__init__.py'), encoding='utf-8') as fp:
rex = r'^__version__ = \((\d+?), (\d+?), (\d+?)\)$'
vtp = re.search(rex, fp.read(), re.M).groups()
__version__ = '.'.join(vtp)
install_requires = ('hues', 'requests',)
setup_requires = ('pytest-runner',)
test_requirements = ['pytest', 'pytest-sugar']
if sys.argv[-1] == 'publish':
try:
import wheel
print("Wheel version: ", wheel.__version__)
except ImportError:
print('Wheel library missing. Please run "pip install wheel"')
sys.exit()
os.system('python setup.py sdist upload')
os.system('python setup.py bdist_wheel upload')
sys.exit()
if sys.argv[-1] == 'tag':
print("Tagging the version on git:")
os.system("git tag -a %s -m 'version %s'" % (__version__, __version__))
os.system("git push --tags")
sys.exit()
setup(
name='elasticsearch-synonym-toolkit',
version=__version__,
description="""Toolkit for Elasticsearch Synonym files.""",
long_description=long_description,
author='Prashant Sinha',
author_email='[email protected]',
url='https://github.com/prashnts/elasticsearch-synonyms',
download_url='https://github.com/prashnts/elasticsearch-synonym/tarball/' + __version__,
packages=[
'es_synonyms',
],
include_package_data=True,
install_requires=install_requires,
setup_requires=setup_requires,
tests_require=test_requirements,
entry_points={
'console_scripts': ['es-synlint=es_synonyms.synlint:cli'],
},
license="MIT",
zip_safe=False,
keywords='elasticsearch-synonym-toolkit',
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
],
)