changeset 72:ecee3e8f35e5

Fix `setuptools` install.
author Ludovic Chabant <ludovic@chabant.com>
date Sat, 30 Aug 2014 09:46:37 -0700
parents 79f14718ffec
children 64788ad39c14
files MANIFEST.in setup.py
diffstat 2 files changed, 20 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/MANIFEST.in	Sat Aug 30 09:46:29 2014 -0700
+++ b/MANIFEST.in	Sat Aug 30 09:46:37 2014 -0700
@@ -1,7 +1,8 @@
-include README.md
-include CHANGELOG.md
-include LICENSE.md
-recursive-include piecrust *.py
+include README.rst
+include CHANGELOG.rst
+include LICENSE.rst
+recursive-include piecrust *.py mime.types
+recursive-include piecrust/resources *
 recursive-include tests *.py
 #global-exclude .DS_Store
 #global-exclude Thumbs.db
--- a/setup.py	Sat Aug 30 09:46:29 2014 -0700
+++ b/setup.py	Sat Aug 30 09:46:37 2014 -0700
@@ -111,9 +111,21 @@
     f.close()
 
 
-# Always generate an up to date version.
-version = generate_version()
-write_version(version)
+# Always try to generate an up to date version.
+# Otherwise, fall back on an (hopefully) existing version file.
+try:
+    version = generate_version()
+    write_version(version)
+except:
+    version = None
+
+if version is None:
+    try:
+        from piecrust.__version__ import APP_VERSION
+        version = APP_VERSION
+    except ImportError:
+        raise Exception("Can't get version from either a version file or "
+                        "from the repository.")
 
 
 setup(name="piecrust",