From ec1d3094c2c09c1c7359313e6b5863bb2b872b98 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Sun, 10 Dec 2017 20:55:21 +0100 Subject: [PATCH] Remove raw html directive, PyPI doesn't like it --- setup.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index ed774f80..c3bc6d6a 100644 --- a/setup.py +++ b/setup.py @@ -16,6 +16,7 @@ # You should have received a copy of the GNU Lesser General Public License # along with Pyrogram. If not, see . +import re from sys import argv from setuptools import setup @@ -27,4 +28,9 @@ if len(argv) > 1 and argv[1] != "sdist": api_compiler.start() error_compiler.start() -setup() +# 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\n|description|\n\n|scheme| |mtproto|", readme) + +setup(long_description=readme)