-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsetup.py
34 lines (27 loc) · 850 Bytes
/
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
import os.path
import pathlib
import re
from setuptools import setup
PROJECT_NAME = "partialjson"
# The directory containing this file
HERE = pathlib.Path(__file__).parent
# The text of the README file
README = (HERE / "README.md").read_text()
def get_property(prop):
result = re.search(
r'{}\s*=\s*[\'"]([^\'"]*)[\'"]'.format(prop),
open(os.path.join(PROJECT_NAME, "__init__.py")).read(),
)
return result.group(1)
setup(
name="partialjson",
version=get_property("__version__"),
description="Parse incomplete or partial json",
long_description=README,
long_description_content_type="text/markdown",
url=get_property("__url__"),
author=get_property("__author__"),
author_email=get_property("__author_email__"),
license=get_property("__license__"),
packages=["partialjson"],
)