Repository navigation
Expand file tree
/
Copy pathsetup.py
More file actions
83 lines (73 loc) · 2.8 KB
/
Copy pathsetup.py
File metadata and controls
83 lines (73 loc) · 2.8 KB
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
import re
from setuptools import setup
with open('jsonpatch.py', encoding='utf-8') as f:
src = f.read()
metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", src))
docstrings = re.findall('"""([^"]*)"""', src, re.MULTILINE | re.DOTALL)
PACKAGE = 'jsonpatch'
MODULES = (
'jsonpatch',
'jsonpatch_cli',
)
with open('requirements.txt') as f:
REQUIREMENTS = [line.strip() for line in f if line.strip()]
with open('README.md', encoding='utf-8') as f:
LONG_DESCRIPTION = f.read()
AUTHOR_EMAIL = metadata['author']
VERSION = metadata['version']
WEBSITE = metadata['website']
LICENSE = metadata['license']
DESCRIPTION = docstrings[0]
# Extract name and e-mail ("Firstname Lastname <mail@example.org>")
AUTHOR, EMAIL = re.match(r'(.*) <(.*)>', AUTHOR_EMAIL).groups()
CLASSIFIERS = [
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
'Programming Language :: Python :: 3.14',
'Programming Language :: Python :: 3.15',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Software Development :: Libraries',
'Topic :: Utilities',
'Typing :: Typed',
]
setup(name=PACKAGE,
version=VERSION,
description=DESCRIPTION,
long_description=LONG_DESCRIPTION,
long_description_content_type='text/markdown',
author=AUTHOR,
author_email=EMAIL,
license_expression=LICENSE,
url=WEBSITE,
py_modules=MODULES,
# jsonpatch is a single-file module, which can't be marked as typed
# with py.typed (PEP 561), so its type stubs are a stub-only package
packages=['jsonpatch-stubs'],
package_data={'jsonpatch-stubs': ['*.pyi']},
entry_points={
'console_scripts': [
'jsondiff = jsonpatch_cli:jsondiff_main',
'jsonpatch = jsonpatch_cli:jsonpatch_main',
]
},
classifiers=CLASSIFIERS,
python_requires='>=3.11',
project_urls={
'Website': 'https://github.com/stefankoegl/python-json-patch',
'Repository': 'https://github.com/stefankoegl/python-json-patch.git',
'Documentation': 'https://python-json-patch.readthedocs.io/',
'PyPI': 'https://pypi.org/pypi/jsonpatch',
'Tests': 'https://github.com/stefankoegl/python-json-patch/actions',
'Test Coverage': 'https://coveralls.io/github/stefankoegl/python-json-patch',
},
install_requires=REQUIREMENTS,
)