From: Thierry Parmentelat Date: Mon, 15 Sep 2014 18:54:07 +0000 (+0200) Subject: protect for cases where index.html and/or LICENSE.txt are not found (like on the... X-Git-Tag: sfa-3.1-12~1 X-Git-Url: http://git.onelab.eu/?p=sfa.git;a=commitdiff_plain;h=4db0fb4c8e067200712eb377e42013c6fc2c628b protect for cases where index.html and/or LICENSE.txt are not found (like on the pip-install side apparently) --- diff --git a/Makefile b/Makefile index 40394d27..ca37ab65 100644 --- a/Makefile +++ b/Makefile @@ -152,18 +152,20 @@ signatures: # did not seem to work the way I was trying to use it, so ... # this target is still helpful to produce the readme in html from README.md -index.zip: README.md +index.zip index.html: README.md python readme.py # I need to run this on my mac as my pypi # run git pull first as this often comes afet a module-tag # we need to re-run make so the version is right -git_pypi: +git_pypi: git pypi + +git: git pull - $(MAKE) pypi + $(MAKE) version # run this only once the sources are in on the right tag -pypi: +pypi: index.html setup.py sdist upload -r $(PYPI_TARGET) ssh $(TARBALL_HOST) mkdir -p $(TARBALL_TOPDIR)/$(VERSIONTAG) rsync -av dist/sfa-$(VERSIONTAG).tar.gz $(TARBALL_HOST):$(TARBALL_TOPDIR)/$(VERSIONTAG) diff --git a/setup.py b/setup.py index c8259f92..8f67e094 100755 --- a/setup.py +++ b/setup.py @@ -119,11 +119,16 @@ if sys.argv[1] in ['uninstall', 'remove', 'delete', 'clean']: feedback (directory, "failed") else: # avoid repeating what's in the specfile already - with open("LICENSE.txt") as l: - license = l.read() - long_description = "Could not open README.html" - with open("readme.html") as r: - long_description = r.read() + try: + with open("LICENSE.txt") as l: + license = l.read() + except: + license = "Could not open file LICENSE.txt" + try: + with open("index.html") as r: + long_description = r.read() + except: + long_description = "Unable to read index.html" setup(name='sfa', packages = packages,