2727from compiler .docs import compiler as docs_compiler
2828from compiler .error import compiler as error_compiler
2929
30+ with open ("requirements.txt" , encoding = "utf-8" ) as r :
31+ requires = [i .strip () for i in r ]
3032
31- def read (file : str ) -> list :
32- with open (file , encoding = "utf-8" ) as r :
33- return [i .strip () for i in r ]
33+ with open ("pyrogram/__init__.py" , encoding = "utf-8" ) as f :
34+ version = re .findall (r"__version__ = \"(.+)\"" , f .read ())[0 ]
3435
35-
36- def get_version ():
37- with open ("pyrogram/__init__.py" , encoding = "utf-8" ) as f :
38- return re .findall (r"__version__ = \"(.+)\"" , f .read ())[0 ]
39-
40-
41- def get_readme ():
42- # PyPI doesn't like raw html
43- with open ("README.rst" , encoding = "utf-8" ) as f :
44- readme = re .sub (r"\.\. \|.+\| raw:: html(?:\s{4}.+)+\n\n" , "" , f .read ())
45- return re .sub (r"\|header\|" , "|logo|\n \n |description|\n \n |schema| |tgcrypto|" , readme )
36+ with open ("README.md" , encoding = "utf-8" ) as f :
37+ readme = f .read ()
4638
4739
4840class Clean (Command ):
@@ -128,30 +120,33 @@ def run(self):
128120
129121
130122if len (argv ) > 1 and argv [1 ] in ["bdist_wheel" , "install" , "develop" ]:
131- error_compiler .start ()
132123 api_compiler .start ()
133- docs_compiler .start ()
124+ error_compiler .start ()
134125
135126setup (
136127 name = "Pyrogram" ,
137- version = get_version () ,
128+ version = version ,
138129 description = "Telegram MTProto API Client Library for Python" ,
139- long_description = get_readme (),
130+ long_description = readme ,
131+ long_description_content_type = "text/markdown" ,
140132 url = "https://github.com/pyrogram" ,
141133 download_url = "https://github.com/pyrogram/pyrogram/releases/latest" ,
142134 author = "Dan Tès" ,
143135 author_email = "admin@pyrogram.ml" ,
144136 license = "LGPLv3+" ,
145137 classifiers = [
146- "Development Status :: 3 - Alpha " ,
138+ "Development Status :: 4 - Beta " ,
147139 "Intended Audience :: Developers" ,
140+ "Natural Language :: English" ,
148141 "License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)" ,
149142 "Operating System :: OS Independent" ,
150143 "Programming Language :: Python" ,
151144 "Programming Language :: Python :: 3" ,
152145 "Programming Language :: Python :: 3.4" ,
153146 "Programming Language :: Python :: 3.5" ,
154147 "Programming Language :: Python :: 3.6" ,
148+ "Programming Language :: Python :: 3.7" ,
149+ "Programming Language :: Python :: 3.8" ,
155150 "Programming Language :: Python :: Implementation" ,
156151 "Programming Language :: Python :: Implementation :: CPython" ,
157152 "Programming Language :: Python :: Implementation :: PyPy" ,
@@ -175,10 +170,9 @@ def run(self):
175170 "pyrogram.client.ext" : ["mime.types" ]
176171 },
177172 zip_safe = False ,
178- install_requires = read ( "requirements.txt" ) ,
173+ install_requires = requires ,
179174 extras_require = {
180- "tgcrypto" : ["tgcrypto==1.1.1" ], # TODO: Remove soon
181- "fast" : ["tgcrypto==1.1.1" ],
175+ "fast" : ["tgcrypto==1.1.1" ]
182176 },
183177 cmdclass = {
184178 "clean" : Clean ,
0 commit comments