-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
setup.py
78 lines (69 loc) · 1.97 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
#!/usr/bin/env python3
"""
pg_seldump -- setup script
"""
# Copyright (C) 2020 Daniele Varrazzo
# This file is part of pg_seldump
import re
import os
from setuptools import setup
# Grab the version without importing the module
# or we will get import errors on install if prerequisites are still missing
fn = os.path.join(os.path.dirname(__file__), "seldump/consts.py")
with open(fn) as f:
m = re.search(r"""(?mi)^VERSION\s*=\s*["']+([^'"]+)["']+""", f.read())
if m:
version = m.group(1)
else:
raise ValueError("cannot find VERSION in the consts module")
# Read the description from the README
with open("README.rst") as f:
readme = f.read()
classifiers = """
Development Status :: 4 - Beta
Environment :: Console
Intended Audience :: Developers
Intended Audience :: Information Technology
Intended Audience :: Science/Research
Intended Audience :: System Administrators
License :: OSI Approved :: BSD License
Operating System :: POSIX
Programming Language :: Python :: 3
Topic :: Database
Topic :: Software Development
Topic :: Software Development :: Testing
Topic :: System :: Archiving :: Backup
Topic :: System :: Systems Administration
Topic :: Utilities
"""
requirements = """
psycopg >= 3.1
jsonschema >= 4.17
PyYAML >= 6
"""
setup(
name="pg_seldump",
description=readme.splitlines()[0],
long_description="\n".join(readme.splitlines()[2:]).lstrip(),
author="Daniele Varrazzo",
author_email="[email protected]",
url="https://github.com/dvarrazzo/pg_seldump",
license="BSD",
python_requires=">= 3.7",
install_requires=requirements,
extras_require={
"test": [
"pytest >= 7.2",
],
"dev": [
"black",
"flake8",
],
},
packages=["seldump"],
package_data={"seldump": ["schema/*.yaml"]},
entry_points={"console_scripts": ["pg_seldump = seldump.cli:script"]},
classifiers=[x for x in classifiers.split("\n") if x],
zip_safe=False,
version=version,
)