forked from tophat/ormar-postgres-extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
86 lines (77 loc) · 2.28 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
79
80
81
82
83
84
85
86
import sys
from datetime import datetime
from setuptools import (
find_packages,
setup,
)
python_requires = ">=3.8"
setup_requires = ["setuptools_scm"]
install_requires = [
"databases[postgresql]>=0.5.4,<1.0.0",
"ormar>=0.10.24,<1.0.0",
"pydantic>=1.9.0,<2.0.0",
"sqlalchemy>=1.4.29,<2.0.0",
]
test_requires = [
"codecov",
"coverage[toml]",
"invoke",
"psycopg2-binary",
"pytest",
"pytest-asyncio",
]
dev_requires = [
"black",
"flake8",
"isort",
"pip-tools",
"py-githooks",
"pygithub",
"semver",
"twine",
"wheel",
*test_requires,
]
if sys.version_info < (3, 8):
raise RuntimeError("Only Python 3.8+ supported.")
def readme() -> str:
with open("README.md", encoding="utf-8") as f:
return f.read()
def version_scheme(v):
if v.exact:
return v.format_with("{tag}")
return datetime.now().strftime("%Y.%m.%d.%H%M%S%f")
if __name__ in ["__main__", "builtins"]:
setup(
name="ormar-postgres-extensions",
description="PostgreSQL specific extensions to the Ormar ORM",
author="Top Hat Open Source",
author_email="[email protected]",
license="Apache License 2.0",
url="https://github.com/tophat/ormar-postgres-extensions",
long_description=readme(),
long_description_content_type="text/markdown",
use_scm_version={
"local_scheme": lambda _: "",
"version_scheme": version_scheme,
"write_to": "version.txt",
},
package_dir={"": "src"},
package_data={"": ["VERSION"]},
packages=find_packages("./src"),
zip_safe=False,
extras_require={"dev": dev_requires, "test": test_requires},
install_requires=install_requires,
setup_requires=setup_requires,
python_requires=python_requires,
classifiers=[
"Development Status :: 1 - Planning",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Topic :: Software Development :: Libraries",
],
)