mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Add Black and Flake8
This commit is contained in:
parent
5b9d82f1ca
commit
7c51b1a7d7
124 changed files with 5841 additions and 3772 deletions
48
setup.py
48
setup.py
|
|
@ -15,7 +15,9 @@ WORK_DIR = pathlib.Path(__file__).parent
|
|||
# Check python version
|
||||
MINIMAL_PY_VERSION = (3, 7)
|
||||
if sys.version_info < MINIMAL_PY_VERSION:
|
||||
raise RuntimeError('aiogram works only with Python {}+'.format('.'.join(map(str, MINIMAL_PY_VERSION))))
|
||||
raise RuntimeError(
|
||||
"aiogram works only with Python {}+".format(".".join(map(str, MINIMAL_PY_VERSION)))
|
||||
)
|
||||
|
||||
|
||||
def get_version():
|
||||
|
|
@ -24,11 +26,11 @@ def get_version():
|
|||
|
||||
:return: str
|
||||
"""
|
||||
txt = (WORK_DIR / 'aiogram' / '__init__.py').read_text('utf-8')
|
||||
txt = (WORK_DIR / "aiogram" / "__init__.py").read_text("utf-8")
|
||||
try:
|
||||
return re.findall(r"^__version__ = '([^']+)'\r?$", txt, re.M)[0]
|
||||
except IndexError:
|
||||
raise RuntimeError('Unable to determine version.')
|
||||
raise RuntimeError("Unable to determine version.")
|
||||
|
||||
|
||||
def get_description():
|
||||
|
|
@ -38,7 +40,7 @@ def get_description():
|
|||
:return: description
|
||||
:rtype: str
|
||||
"""
|
||||
with open('README.rst', 'r', encoding='utf-8') as f:
|
||||
with open("README.rst", "r", encoding="utf-8") as f:
|
||||
return f.read()
|
||||
|
||||
|
||||
|
|
@ -50,36 +52,36 @@ def get_requirements(filename=None):
|
|||
:rtype: list
|
||||
"""
|
||||
if filename is None:
|
||||
filename = 'requirements.txt'
|
||||
filename = "requirements.txt"
|
||||
|
||||
file = WORK_DIR / filename
|
||||
|
||||
install_reqs = parse_requirements(str(file), session='hack')
|
||||
install_reqs = parse_requirements(str(file), session="hack")
|
||||
return [str(ir.req) for ir in install_reqs]
|
||||
|
||||
|
||||
setup(
|
||||
name='aiogram',
|
||||
name="aiogram",
|
||||
version=get_version(),
|
||||
packages=find_packages(exclude=('tests', 'tests.*', 'examples.*', 'docs',)),
|
||||
url='https://github.com/aiogram/aiogram',
|
||||
license='MIT',
|
||||
author='Alex Root Junior',
|
||||
requires_python='>=3.7',
|
||||
author_email='jroot.junior@gmail.com',
|
||||
description='Is a pretty simple and fully asynchronous library for Telegram Bot API',
|
||||
packages=find_packages(exclude=("tests", "tests.*", "examples.*", "docs")),
|
||||
url="https://github.com/aiogram/aiogram",
|
||||
license="MIT",
|
||||
author="Alex Root Junior",
|
||||
requires_python=">=3.7",
|
||||
author_email="jroot.junior@gmail.com",
|
||||
description="Is a pretty simple and fully asynchronous library for Telegram Bot API",
|
||||
long_description=get_description(),
|
||||
classifiers=[
|
||||
'Development Status :: 5 - Production/Stable',
|
||||
'Environment :: Console',
|
||||
'Framework :: AsyncIO',
|
||||
'Intended Audience :: Developers',
|
||||
'Intended Audience :: System Administrators',
|
||||
'License :: OSI Approved :: MIT License',
|
||||
'Programming Language :: Python :: 3.7',
|
||||
'Topic :: Software Development :: Libraries :: Application Frameworks',
|
||||
"Development Status :: 5 - Production/Stable",
|
||||
"Environment :: Console",
|
||||
"Framework :: AsyncIO",
|
||||
"Intended Audience :: Developers",
|
||||
"Intended Audience :: System Administrators",
|
||||
"License :: OSI Approved :: MIT License",
|
||||
"Programming Language :: Python :: 3.7",
|
||||
"Topic :: Software Development :: Libraries :: Application Frameworks",
|
||||
],
|
||||
install_requires=get_requirements(),
|
||||
package_data={'': ['requirements.txt']},
|
||||
package_data={"": ["requirements.txt"]},
|
||||
include_package_data=False,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue