Skip to content

Commit

Permalink
Wrap dynamic author list generation in setup.py
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jbarnoud committed Mar 21, 2016
1 parent 0de57c8 commit 93b5841
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion package/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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()
Expand Down
6 changes: 5 additions & 1 deletion testsuite/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import sys
import os
import glob
import warnings


def dynamic_author_list():
Expand Down Expand Up @@ -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 = \
Expand Down

0 comments on commit 93b5841

Please sign in to comment.