summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2017-01-15 14:21:49 -0500
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2017-01-16 16:13:00 -0500
commit3e5a0347468fe106076cbf8d1b44e2fa754b9da6 (patch)
treed2aca08f523504df0ef61bbd1ceb7f376aabc5e3 /setup.py
parent5700ebe231507629a49c8bff615f3c491f7120ea (diff)
downloadbuildstream-3e5a0347468fe106076cbf8d1b44e2fa754b9da6.tar.gz
setup.py: Ensure OSTree version >= v2016.8
There is no easy way to check the version we need for OSTree with introspection, we only have version "1.0". So we try to access a method directly and bail out if it doesnt exist.
Diffstat (limited to 'setup.py')
-rwxr-xr-xsetup.py21
1 files changed, 18 insertions, 3 deletions
diff --git a/setup.py b/setup.py
index 64c330e18..73893f4f8 100755
--- a/setup.py
+++ b/setup.py
@@ -32,6 +32,17 @@ except ImportError:
" install setuptools).")
sys.exit(1)
+
+##################################################################
+# We require at least v2016.8 of OSTree, which contain the
+# fixes in this bug:
+# https://github.com/ostreedev/ostree/pull/417
+##################################################################
+def exit_ostree(reason):
+ print(reason + ": BuildStream requires OSTree >= v2016.8 with Python bindings. "
+ "Install it using your package manager (usually ostree or gir1.2-ostree-1.0).")
+ sys.exit(1)
+
try:
import gi
except ImportError:
@@ -43,9 +54,13 @@ try:
gi.require_version('OSTree', '1.0')
from gi.repository import OSTree
except:
- print("BuildStream requires OSTree with Python bindings. Install it using"
- " your package manager (usually ostree or gir1.2-ostree-1.0).")
- sys.exit(1)
+ exit_ostree("OSTree not found")
+
+try:
+ checkout_at = OSTree.Repo.checkout_at
+except AttributeError:
+ exit_ostree("OSTree too old")
+
setup(name='buildstream',
version='0.1',