From c16a3ce8612be2f347c1a07638b0cf59bd59775e Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Mar 14 2018 18:57:12 +0000 Subject: Patch EPEL to skip the python tests Signed-off-by: Stephen Gallagher --- diff --git a/0001-Skip-python-tests-where-unsupported.patch b/0001-Skip-python-tests-where-unsupported.patch new file mode 100644 index 0000000..134bbfe --- /dev/null +++ b/0001-Skip-python-tests-where-unsupported.patch @@ -0,0 +1,45 @@ +From c118049a734891287c04163617fb4fb994c18a7b Mon Sep 17 00:00:00 2001 +From: Stephen Gallagher +Date: Wed, 14 Mar 2018 14:46:20 -0400 +Subject: [PATCH] Skip python tests where unsupported + +Some platforms like RHEL 7 do not have python3-gobject + +Signed-off-by: Stephen Gallagher +--- + modulemd/test-modulemd-python.py | 16 +++++++++++----- + 1 file changed, 11 insertions(+), 5 deletions(-) + +diff --git a/modulemd/test-modulemd-python.py b/modulemd/test-modulemd-python.py +index ae292ecb7b6a5c6778a0f25db58b55d5172d3e03..83e62055c461f7269482dd2d408a1c7979732879 100755 +--- a/modulemd/test-modulemd-python.py ++++ b/modulemd/test-modulemd-python.py +@@ -1,14 +1,20 @@ + #!/usr/bin/python3 + + import os +-import unittest ++import sys + +-import gi +-gi.require_version('Modulemd', os.getenv('MODULEMD_NSVERSION')) +-from gi.repository import Modulemd +-from gi.repository import GLib ++try: ++ import unittest ++ import gi ++ gi.require_version('Modulemd', os.getenv('MODULEMD_NSVERSION')) ++ from gi.repository import Modulemd ++ from gi.repository import GLib ++except ImportError: ++ # Return error 77 to skip this test on platforms without the necessary ++ # python modules ++ sys.exit (77) + + class TestIssues(unittest.TestCase): + + def test_issue24(self): + # Verify that we can handle boolean variant types +-- +2.14.3 + diff --git a/libmodulemd.spec b/libmodulemd.spec index d59fd8e..33ff88a 100644 --- a/libmodulemd.spec +++ b/libmodulemd.spec @@ -18,9 +18,9 @@ BuildRequires: pkgconfig(gobject-2.0) BuildRequires: pkgconfig(gobject-introspection-1.0) BuildRequires: pkgconfig(yaml-0.1) BuildRequires: pkgconfig(gtk-doc) -BuildRequires: python3-gobject-base # Patches +Patch0001: 0001-Skip-python-tests-where-unsupported.patch %description C Library for manipulating module metadata files.