From 6c7360093952b99d348618ef4801bf4008f2be3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 20 Jul 2019 21:41:31 +0200 Subject: [PATCH] Slice the README content to remove toctree toctree directive is not supported by Warehouse (PyPI) issue8465 review287731002 --- setup.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index fc0e8c88cd..ff03ecb0af 100755 --- a/setup.py +++ b/setup.py @@ -9,10 +9,13 @@ from configparser import ConfigParser from setuptools import setup, find_packages -def read(fname): - return io.open( +def read(fname, slice=None): + content = io.open( os.path.join(os.path.dirname(__file__), fname), 'r', encoding='utf-8').read() + if slice: + content = '\n'.join(content.splitlines()[slice]) + return content def get_require_version(name): @@ -58,7 +61,7 @@ if minor_version % 2: setup(name=name, version=version, description='Tryton module with timesheets', - long_description=read('README.rst'), + long_description=read('README.rst', slice=slice(0, -5)), author='Tryton', author_email='bugs@tryton.org', url='http://www.tryton.org/',