forked from obsei/obsei
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
98 lines (81 loc) · 3.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
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
87
88
89
90
91
92
93
94
95
96
97
98
import os
import pathlib
import re
from io import open
from sys import platform
from setuptools import find_packages, setup
if "win" in platform:
warning_message = """
------------------------------------------------------------------------------------------------
NOTE: For windows platform install torch manually. Refer https://pytorch.org/get-started/locally/
------------------------------------------------------------------------------------------------
"""
print(warning_message)
def parse_requirements(filename):
with open(filename) as file:
lines = file.read().splitlines()
return [
line.strip()
for line in lines
if not (
(not line)
or (line.strip()[0] == "#")
or (line.strip().startswith("--find-links"))
or ("git+https" in line)
)
]
def get_dependency_links(filename):
with open(filename) as file:
lines = file.read().splitlines()
return [
line.strip().split(" ")[1]
for line in lines
if line.strip().startswith("--find-links")
]
def version_from_file(*filepath):
infile = os.path.join(*filepath)
with open(infile) as fp:
version_match = re.search(
r"^__version__\s*=\s*['\"]([^'\"]*)['\"]", fp.read(), re.M
)
if version_match:
return version_match.group(1)
raise RuntimeError("Unable to find version string in {}.".format(infile))
here = os.path.abspath(os.path.dirname(__file__))
dependency_links = get_dependency_links("requirements.txt")
parsed_requirements = parse_requirements("requirements.txt")
# The directory containing this file
HERE = pathlib.Path(__file__).parent
# The text of the README file
README = (HERE / "README.md").read_text(encoding="utf8")
setup(
name="obsei",
version=version_from_file(here, "obsei", "_version.py"),
author="Lalit Pagaria",
author_email="[email protected]",
description="Obsei is an automation tool for text analysis need",
long_description=README,
long_description_content_type="text/markdown",
license="Apache Version 2.0",
url="https://github.com/obsei/obsei",
packages=find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"]),
dependency_links=dependency_links,
install_requires=parsed_requirements,
include_package_data=True,
python_requires=">=3.7.0",
tests_require=["pytest", "black"],
classifiers=[
"Development Status :: 2 - Pre-Alpha",
"Intended Audience :: Developers",
"Intended Audience :: Customer Service",
"Intended Audience :: Science/Research",
"Intended Audience :: Information Technology",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Software Development :: Libraries :: Python Modules",
],
)