-
Notifications
You must be signed in to change notification settings - Fork 4
/
setup.py
68 lines (62 loc) · 2.54 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
from codecs import open
from os import path
import re
from setuptools import setup, find_packages
# Constants
NAME = "uspto-patent-citation-graph"
ROOT = NAME.replace("-", "_")
# Get the long description from the README file
with open(path.join(path.abspath(path.dirname(__file__)), "README.md"), encoding="utf-8") as f:
readme = f.read()
# Get the version from the root __init__.py file.
with open(path.join(path.abspath(path.dirname(__file__)), ROOT, "__init__.py"), encoding="utf-8") as f:
content = f.read()
_author = re.search("__author__ = \"(.*?)\"", content).group(1)
_email = re.search("__email__ = \"(.*?)\"", content).group(1)
_license = re.search("__license__ = \"(.*?)\"", content).group(1)
_url = re.search("__url__ = \"(.*?)\"", content).group(1)
_version = re.search("__version__ = \"(.*?)\"", content).group(1)
# Get the requirements from requirements.txt.
req_filename = "requirements.txt"
exp = re.compile("(?P<req>\\w+)\\s*(?P<op>[<>=!~]+)\\s*(?P<ver>[\\w.]+)")
requirements = []
with open(path.join(path.dirname(path.abspath(__file__)), req_filename)) as req_file:
for line in req_file:
line = line.split("#", maxsplit=1)[0].strip()
match = exp.match(line) if line else None
if match is not None:
requirements.append(("".join((match["req"], match["op"], match["ver"]))))
requirements.sort(key=lambda s: s.casefold())
setup(
name=NAME,
version=_version,
description="graph patent citation USPTO database graphscraper webscraper",
long_description=readme,
long_description_content_type="text/markdown",
url=_url,
author=_author,
author_email=_email,
license=_license,
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Topic :: Database",
"Topic :: Education",
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
"Topic :: Scientific/Engineering",
"Typing :: Typed"
],
keywords="bootstrap html markup generator utility",
packages=find_packages(exclude=["test"]),
python_requires=">=3.6",
install_requires=requirements
)