Ejemplo n.º 1
0
    def run(self):
        if self.api:
            error_compiler.start()
            api_compiler.start()

        if self.docs:
            docs_compiler.start()
Ejemplo n.º 2
0
from setuptools import setup, find_packages

from compiler.api import compiler as api_compiler
from compiler.docs import compiler as docs_compiler
from compiler.error import compiler as error_compiler


def read(file: str) -> list:
    with open(file, encoding="utf-8") as r:
        return [i.strip() for i in r]


if len(argv) > 1 and argv[1] != "sdist":
    api_compiler.start()
    docs_compiler.start()
    error_compiler.start()

with open("pyrogram/__init__.py", encoding="utf-8") as f:
    version = re.findall(r"__version__ = \"(.+)\"", f.read())[0]

# PyPI doesn't like raw html
with open("README.rst", encoding="utf-8") as f:
    readme = re.sub(r"\.\. \|.+\| raw:: html(?:\s{4}.+)+\n\n", "", f.read())
    readme = re.sub(r"\|header\|",
                    "|logo|\n\n|description|\n\n|scheme| |tgcrypto|", readme)

setup(
    name="Pyrogram",
    version=version,
    description="Telegram MTProto API Client Library for Python",
    long_description=readme,