-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
86 lines (76 loc) · 2.41 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
79
80
81
82
83
84
85
86
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Flask-ESearch
-------------
Extension for Flask and ElasticSearch.
"""
import os
import re
import sys
from setuptools import find_packages, setup
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
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()
def find_version(fname):
"""Attempts to find the version number in the file names fname.
Raises RuntimeError if not found.
"""
version = ""
with open(fname, "r") as fp:
reg = re.compile(r'__version__ = [\'"]([^\'"]*)[\'"]')
for line in fp:
m = reg.match(line)
if m:
version = m.group(1)
break
if not version:
raise RuntimeError("Cannot find version information")
return version
def read(fname):
with open(fname) as fp:
content = fp.read()
return content
setup(
name="Flask-ESearch",
version="0.5.0",
url="https://github.com/dymmond/flask-esearch",
long_description=read("README.md"),
long_description_content_type="text/markdown",
license="MIT",
author="Tiago Silva",
author_email="[email protected]",
description="Extension of Elasticsearch for Flask with a simple integration",
py_modules=["flask_esearch"],
packages=find_packages("src"),
package_dir={"": "src"},
zip_safe=False,
include_package_data=True,
platforms="any",
install_requires=["Flask>=2.3.0", "Elasticsearch>=6.4.6", "Elasticsearch-dsl>=6.4.6"],
classifiers=[
"Framework :: Flask",
"Environment :: Web Environment",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
"Topic :: Software Development :: Libraries :: Python Modules",
],
)