From 93b5841be8f6bc4de5fb193d88d47dc09418a42a Mon Sep 17 00:00:00 2001 From: Jonathan Barnoud Date: Mon, 21 Mar 2016 19:01:31 +0100 Subject: [PATCH] Wrap dynamic author list generation in setup.py If the user cannot write in the MDAnalysis source directory, writing the list of authors will fail. This commit wrap the generation so the install proceed with a warning instead of crashing. --- package/setup.py | 6 +++++- testsuite/setup.py | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/package/setup.py b/package/setup.py index 405b4d642c1..6b7e7eede0e 100755 --- a/package/setup.py +++ b/package/setup.py @@ -44,6 +44,7 @@ import sys import shutil import tempfile +import warnings # Make sure I have the right Python version. if sys.version_info[:2] < (2, 7): @@ -423,7 +424,10 @@ def dynamic_author_list(): if __name__ == '__main__': - dynamic_author_list() + try: + dynamic_author_list() + except (OSError, IOError): + warnings.warn('Cannot write the list of authors.') with open("SUMMARY.txt") as summary: LONG_DESCRIPTION = summary.read() diff --git a/testsuite/setup.py b/testsuite/setup.py index 5e2b9cf8adc..6c400706a79 100755 --- a/testsuite/setup.py +++ b/testsuite/setup.py @@ -42,6 +42,7 @@ import sys import os import glob +import warnings def dynamic_author_list(): @@ -122,7 +123,10 @@ def dynamic_author_list(): if __name__ == '__main__': - dynamic_author_list() + try: + dynamic_author_list() + except (OSError, IOError): + warnings.warn('Cannot write the list of authors.') RELEASE = "0.14.1-dev0" # this must be in-sync with MDAnalysis LONG_DESCRIPTION = \