From 5264302f610d0d9caa515dc46b4ffc570163f651 Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Mon, 12 Feb 2024 12:27:05 -0500 Subject: [PATCH] Always disable network tests mock (by default) and koji builds never have network access, but testing that capability through a DNS resolution is not always accurate. Forcefully disable all network tests to avoid unnecessary build failures. --- python-pygit2-network-tests.patch | 12 ++++++++++++ python-pygit2.spec | 4 ++++ 2 files changed, 16 insertions(+) create mode 100644 python-pygit2-network-tests.patch diff --git a/python-pygit2-network-tests.patch b/python-pygit2-network-tests.patch new file mode 100644 index 0000000..623c233 --- /dev/null +++ b/python-pygit2-network-tests.patch @@ -0,0 +1,12 @@ +diff -up ./test/utils.py.orig ./test/utils.py +--- ./test/utils.py.orig 2024-02-12 12:22:29.272147056 -0500 ++++ ./test/utils.py 2024-02-12 12:23:45.876659120 -0500 +@@ -50,7 +50,7 @@ except socket.gaierror: + has_network = False + + requires_network = pytest.mark.skipif( +- not has_network, ++ True, + reason='Requires network') + + with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock: diff --git a/python-pygit2.spec b/python-pygit2.spec index 01f38d7..8731e86 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -13,6 +13,10 @@ Patch0: python-pygit2-transfer-size.patch # higher contain the patches needed for Python >= 3.12. # Remove when cffi >= 1.16.0 is available on all releases with Python 3.12. Patch: python-pygit2-cffiver.patch +# mock (by default) and koji builds never have network access, but testing +# that capability through a DNS resolution is not always accurate. +# Forcefully disable all network tests to avoid unnecessary build failures. +Patch: python-pygit2-network-tests.patch BuildRequires: make BuildRequires: gcc