|
1 |
| -from setuptools import setup |
2 | 1 | import re
|
| 2 | +from setuptools import setup |
3 | 3 |
|
4 | 4 | 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() |
7 | 7 |
|
8 |
| -version = '' |
9 |
| -with open('discord/__init__.py') as f: |
| 8 | +version = "" |
| 9 | +with open("discord/__init__.py") as f: |
10 | 10 |
|
11 | 11 | search = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', f.read(), re.MULTILINE)
|
12 | 12 |
|
|
16 | 16 | else:
|
17 | 17 | raise RuntimeError("Could not grab version string")
|
18 | 18 |
|
19 |
| -if version.endswith(('a', 'b', 'rc')): |
| 19 | +if version.endswith(("a", "b", "rc")): |
20 | 20 | # append version identifier based on commit count
|
21 | 21 | try:
|
22 | 22 | 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) |
25 | 25 | out, err = p.communicate()
|
26 | 26 | 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) |
30 | 29 | out, err = p.communicate()
|
31 | 30 | if out:
|
32 |
| - version += '+g' + out.decode('utf-8').strip() |
| 31 | + version += "+g" + out.decode("utf-8").strip() |
33 | 32 | except Exception:
|
34 | 33 | pass
|
35 | 34 |
|
36 |
| -readme = '' |
37 |
| -with open('README.rst') as f: |
| 35 | +readme = "" |
| 36 | +with open("README.rst") as f: |
38 | 37 | readme = f.read()
|
39 | 38 |
|
40 | 39 | 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", |
46 | 53 | ],
|
47 |
| - 'speed': [ |
48 |
| - 'orjson>=3.5.4', |
49 |
| - ] |
50 | 54 | }
|
51 | 55 |
|
52 | 56 | 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", |
60 | 64 | ]
|
61 | 65 |
|
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={ |
66 | 72 | "Documentation": "https://pycord.readthedocs.io/en/latest/",
|
67 | 73 | "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", |
95 | 100 | )
|
0 commit comments