-
Notifications
You must be signed in to change notification settings - Fork 7
/
setup.py
executable file
·59 lines (50 loc) · 1.82 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
#!/usr/bin/env python
import os.path
import re
from setuptools import find_packages, setup
HERE = os.path.dirname(__file__)
# Extract version
SOURCE_FILE = os.path.join(HERE, 'barely_json', '__init__.py')
version = None
with open(SOURCE_FILE, 'r', encoding='utf-8') as f:
for line in f:
s = line.strip()
m = re.match(r"""__version__\s*=\s*['"](.*)['"]""", line)
if m:
version = m.groups()[0]
if not version:
raise RuntimeError('Could not extract version from "%s".' % SOURCE_FILE)
# Extract requirements
REQUIREMENTS_FILE = os.path.join(HERE, 'requirements.txt')
with open(REQUIREMENTS_FILE, 'r') as f:
requirements = f.readlines()
README_FILE = os.path.join(HERE, 'README.md')
with open(README_FILE, 'r') as f:
long_description =f.read()
setup(
name='barely_json',
description='Parse invalid, malformed and barely JSON-esque data',
long_description=long_description,
long_description_content_type='text/markdown',
url='https://github.com/torfsen/barely_json',
version=version,
license='MIT',
keywords=['json'],
classifiers=[
# Reference: http://pypi.python.org/pypi?%3Aaction=list_classifiers
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Software Development :: Libraries :: Python Modules",
],
author='Florian Brucker',
author_email='mail@florianbrucker.de',
packages=find_packages(),
install_requires=requirements,
)