Debian Codegraph @

setup.py

raw ◀ ▶
1 Debian patch touch this file
1 import re
2 from pathlib import Path
3
4 from setuptools import setup, find_packages
5
•6 install_requires = ["psycopg2-binary>=2.9.5", "async_timeout>=3.0,<5.0; python_version < '3.11'"]
7 extras_require = {"sa": ["sqlalchemy[postgresql_psycopg2binary]>=1.4,<2.1"]}
8
9
10 def read(*parts):
11 return Path(__file__).resolve().parent.joinpath(*parts).read_text().strip()
12
13
14 def get_maintainers(path="MAINTAINERS.txt"):
15 return ", ".join(x.strip().strip("*").strip() for x in read(path).splitlines())
16
17
18 def read_version():
19 regexp = re.compile(r"^__version__\W*=\W*\"([\d.abrc]+)\"")
20 for line in read("aiopg", "__init__.py").splitlines():
21 match = regexp.match(line)
22 if match is not None:
23 return match.group(1)
24
25 raise RuntimeError("Cannot find version in aiopg/__init__.py")
26
27
28 def read_changelog(path="CHANGES.txt"):
29 return f"Changelog\n---------\n\n{read(path)}"
30
31
32 classifiers = [
33 "License :: OSI Approved :: BSD License",
34 "Intended Audience :: Developers",
35 "Programming Language :: Python :: 3",
36 "Programming Language :: Python :: 3 :: Only",
37 "Programming Language :: Python :: 3.7",
38 "Programming Language :: Python :: 3.8",
39 "Programming Language :: Python :: 3.9",
40 "Programming Language :: Python :: 3.10",
41 "Programming Language :: Python :: 3.11",
42 "Operating System :: POSIX",
43 "Operating System :: MacOS :: MacOS X",
44 "Operating System :: Microsoft :: Windows",
45 "Environment :: Web Environment",
46 "Development Status :: 5 - Production/Stable",
47 "Topic :: Database",
48 "Topic :: Database :: Front-Ends",
49 "Framework :: AsyncIO",
50 ]
51
52 setup(
53 name="aiopg",
54 version=read_version(),
55 description="Postgres integration with asyncio.",
56 long_description="\n\n".join((read("README.rst"), read_changelog())),
57 long_description_content_type="text/x-rst",
58 classifiers=classifiers,
59 platforms=["macOS", "POSIX", "Windows"],
60 author="Andrew Svetlov",
61 python_requires=">=3.7",
62 project_urls={
63 "Chat: Gitter": "https://gitter.im/aio-libs/Lobby",
64 "CI: GA": "https://github.com/aio-libs/aiopg/actions?query=workflow%3ACI",
65 "Coverage: codecov": "https://codecov.io/gh/aio-libs/aiopg",
66 "Docs: RTD": "https://aiopg.readthedocs.io",
67 "GitHub: issues": "https://github.com/aio-libs/aiopg/issues",
68 "GitHub: repo": "https://github.com/aio-libs/aiopg",
69 },
70 author_email="[email protected]",
71 maintainer=get_maintainers(),
72 maintainer_email="[email protected]",
73 url="https://aiopg.readthedocs.io",
74 download_url="https://pypi.python.org/pypi/aiopg",
75 license="BSD",
76 packages=find_packages(),
77 install_requires=install_requires,
78 extras_require=extras_require,
79 include_package_data=True,
80 )