Skip to content

Commit eddf2f2

Browse files
committed
Add aiohttp speedups.
1 parent c8792d8 commit eddf2f2

File tree

2 files changed

+66
-60
lines changed

2 files changed

+66
-60
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ docs/crowdin.py
1717
.idea/
1818
.vs/slnx.sqlite
1919
env/
20+
build/

setup.py

Lines changed: 65 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
from setuptools import setup
21
import re
2+
from setuptools import setup
33

44
requirements = []
5-
with open('requirements.txt') as f:
6-
requirements = f.read().splitlines()
5+
with open("requirements.txt") as f:
6+
requirements = f.read().splitlines()
77

8-
version = ''
9-
with open('discord/__init__.py') as f:
8+
version = ""
9+
with open("discord/__init__.py") as f:
1010

1111
search = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', f.read(), re.MULTILINE)
1212

@@ -16,80 +16,85 @@
1616
else:
1717
raise RuntimeError("Could not grab version string")
1818

19-
if version.endswith(('a', 'b', 'rc')):
19+
if version.endswith(("a", "b", "rc")):
2020
# append version identifier based on commit count
2121
try:
2222
import subprocess
23-
p = subprocess.Popen(['git', 'rev-list', '--count', 'HEAD'],
24-
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
23+
24+
p = subprocess.Popen(["git", "rev-list", "--count", "HEAD"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
2525
out, err = p.communicate()
2626
if out:
27-
version += out.decode('utf-8').strip()
28-
p = subprocess.Popen(['git', 'rev-parse', '--short', 'HEAD'],
29-
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
27+
version += out.decode("utf-8").strip()
28+
p = subprocess.Popen(["git", "rev-parse", "--short", "HEAD"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
3029
out, err = p.communicate()
3130
if out:
32-
version += '+g' + out.decode('utf-8').strip()
31+
version += "+g" + out.decode("utf-8").strip()
3332
except Exception:
3433
pass
3534

36-
readme = ''
37-
with open('README.rst') as f:
35+
readme = ""
36+
with open("README.rst") as f:
3837
readme = f.read()
3938

4039
extras_require = {
41-
'voice': ['PyNaCl>=1.3.0,<1.5'],
42-
'docs': [
43-
'sphinx==4.3.0',
44-
'sphinxcontrib_trio==1.1.2',
45-
'sphinxcontrib-websupport',
40+
"voice": ["PyNaCl>=1.3.0,<1.5"],
41+
"docs": [
42+
"sphinx==4.3.0",
43+
"sphinxcontrib_trio==1.1.2",
44+
"sphinxcontrib-websupport",
45+
],
46+
"json_speed": [
47+
"orjson>=3.5.4",
48+
],
49+
"speed": [
50+
"aiodns>=1.1",
51+
"Brotlipy",
52+
"cchardet",
4653
],
47-
'speed': [
48-
'orjson>=3.5.4',
49-
]
5054
}
5155

5256
packages = [
53-
'discord',
54-
'discord.types',
55-
'discord.ui',
56-
'discord.webhook',
57-
'discord.commands',
58-
'discord.ext.commands',
59-
'discord.ext.tasks',
57+
"discord",
58+
"discord.types",
59+
"discord.ui",
60+
"discord.webhook",
61+
"discord.commands",
62+
"discord.ext.commands",
63+
"discord.ext.tasks",
6064
]
6165

62-
setup(name='py-cord',
63-
author='Pycord Development',
64-
url='https://github.com/Pycord-Development/pycord',
65-
project_urls={
66+
67+
setup(
68+
name="py-cord",
69+
author="Pycord Development",
70+
url="https://github.com/Pycord-Development/pycord",
71+
project_urls={
6672
"Documentation": "https://pycord.readthedocs.io/en/latest/",
6773
"Issue tracker": "https://github.com/Pycord-Development/pycord/issues",
68-
},
69-
version=version,
70-
packages=packages,
71-
license='MIT',
72-
description='A Python wrapper for the Discord API',
73-
long_description=readme,
74-
long_description_content_type="text/x-rst",
75-
include_package_data=True,
76-
install_requires=requirements,
77-
extras_require=extras_require,
78-
python_requires='>=3.8.0',
79-
classifiers=[
80-
'Development Status :: 3 - Alpha',
81-
'License :: OSI Approved :: MIT License',
82-
'Intended Audience :: Developers',
83-
'Natural Language :: English',
84-
'Operating System :: OS Independent',
85-
'Programming Language :: Python :: 3.8',
86-
'Programming Language :: Python :: 3.9',
87-
'Programming Language :: Python :: 3.10'
88-
'Topic :: Internet',
89-
'Topic :: Software Development :: Libraries',
90-
'Topic :: Software Development :: Libraries :: Python Modules',
91-
'Topic :: Utilities',
92-
'Typing :: Typed',
93-
],
94-
test_suite='tests',
74+
},
75+
version=version,
76+
packages=packages,
77+
license="MIT",
78+
description="A Python wrapper for the Discord API",
79+
long_description=readme,
80+
long_description_content_type="text/x-rst",
81+
include_package_data=True,
82+
install_requires=requirements,
83+
extras_require=extras_require,
84+
python_requires=">=3.8.0",
85+
classifiers=[
86+
"Development Status :: 3 - Alpha",
87+
"License :: OSI Approved :: MIT License",
88+
"Intended Audience :: Developers",
89+
"Natural Language :: English",
90+
"Operating System :: OS Independent",
91+
"Programming Language :: Python :: 3.8",
92+
"Programming Language :: Python :: 3.9",
93+
"Programming Language :: Python :: 3.10" "Topic :: Internet",
94+
"Topic :: Software Development :: Libraries",
95+
"Topic :: Software Development :: Libraries :: Python Modules",
96+
"Topic :: Utilities",
97+
"Typing :: Typed",
98+
],
99+
test_suite="tests",
95100
)

0 commit comments

Comments
 (0)