From d9fd91364888b01fcc9ca1a47c13a0d76bc3f553 Mon Sep 17 00:00:00 2001 From: Daniel Huppmann Date: Thu, 9 Apr 2020 07:06:58 +0200 Subject: [PATCH] add try-except for importing readme when building the docs --- setup.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 724eb0a99..3f239e420 100755 --- a/setup.py +++ b/setup.py @@ -38,8 +38,13 @@ 'deploy': ['twine', 'setuptools', 'wheel'], } -with open('README.md', 'r') as f: - LONG_DESCRIPTION = f.read() +# building the docs on readthedocs fails with a FileNotFoundError +# https://github.com/IAMconsortium/pyam/issues/363 +try: + with open('README.md', 'r') as f: + LONG_DESCRIPTION = f.read() +except FileNotFoundError: + LONG_DESCRIPTION = '' # thank you https://stormpath.com/blog/building-simple-cli-interfaces-in-python class RunTests(Command):