commit c25fc6de770f8039db188f44f77c4697c922c6c9 Author: James Antill Date: Mon Aug 8 13:59:20 2022 -0400 Import rpm: 734697446fbaa2e83a6fba824fcf9accff0cfddf diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..75f28d0 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/dnspython-1.15.0.tar.gz diff --git a/0001-Skip-tests-that-require-external-network-connection_rhbz#1914296.patch b/0001-Skip-tests-that-require-external-network-connection_rhbz#1914296.patch new file mode 100644 index 0000000..34dafa1 --- /dev/null +++ b/0001-Skip-tests-that-require-external-network-connection_rhbz#1914296.patch @@ -0,0 +1,105 @@ +From 0414551fab97825fb826882b9c23c1a3ea0b71ea Mon Sep 17 00:00:00 2001 +From: Rafael Guterres Jeffman +Date: Thu, 22 Apr 2021 10:08:41 -0300 +Subject: [PATCH] Skip tests that require external network connection. + +--- + tests/test_async.py | 11 ++--------- + tests/test_query.py | 9 ++------- + tests/test_resolver.py | 10 ++-------- + tests/test_resolver_override.py | 9 ++------- + 4 files changed, 8 insertions(+), 31 deletions(-) + +diff --git a/tests/test_async.py b/tests/test_async.py +index 0252f22..370c6bb 100644 +--- a/tests/test_async.py ++++ b/tests/test_async.py +@@ -38,15 +38,8 @@ try: + except Exception: + _ssl_available = False + +- +-# Some tests require the internet to be available to run, so let's +-# skip those if it's not there. +-_network_available = True +-try: +- socket.gethostbyname('dnspython.org') +-except socket.gaierror: +- _network_available = False +- ++# RHEL 9 build environment does not have provide external network access. ++_network_available = False + + # Probe for IPv4 and IPv6 + query_addresses = [] +diff --git a/tests/test_query.py b/tests/test_query.py +index 2cff377..99dc873 100644 +--- a/tests/test_query.py ++++ b/tests/test_query.py +@@ -36,13 +36,8 @@ import dns.query + import dns.tsigkeyring + import dns.zone + +-# Some tests require the internet to be available to run, so let's +-# skip those if it's not there. +-_network_available = True +-try: +- socket.gethostbyname('dnspython.org') +-except socket.gaierror: +- _network_available = False ++# RHEL 9 build environment does not have provide external network access. ++_network_available = False + + # Some tests use a "nano nameserver" for testing. It requires trio + # and threading, so try to import it and if it doesn't work, skip +diff --git a/tests/test_resolver.py b/tests/test_resolver.py +index 4f5643d..b26ab65 100644 +--- a/tests/test_resolver.py ++++ b/tests/test_resolver.py +@@ -18,7 +18,6 @@ + from io import StringIO + import selectors + import sys +-import socket + import time + import unittest + +@@ -31,13 +30,8 @@ import dns.resolver + import dns.tsig + import dns.tsigkeyring + +-# Some tests require the internet to be available to run, so let's +-# skip those if it's not there. +-_network_available = True +-try: +- socket.gethostbyname('dnspython.org') +-except socket.gaierror: +- _network_available = False ++# RHEL 9 build environment does not have provide external network access. ++_network_available = False + + # Some tests use a "nano nameserver" for testing. It requires trio + # and threading, so try to import it and if it doesn't work, skip +diff --git a/tests/test_resolver_override.py b/tests/test_resolver_override.py +index ac93316..036a42e 100644 +--- a/tests/test_resolver_override.py ++++ b/tests/test_resolver_override.py +@@ -9,13 +9,8 @@ import dns.rdataclass + import dns.rdatatype + import dns.resolver + +-# Some tests require the internet to be available to run, so let's +-# skip those if it's not there. +-_network_available = True +-try: +- socket.gethostbyname('dnspython.org') +-except socket.gaierror: +- _network_available = False ++# RHEL 9 build environment does not have provide external network access. ++_network_available = False + + + @unittest.skipIf(not _network_available, "Internet not reachable") +-- +2.30.2 + diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..423fb36 --- /dev/null +++ b/gating.yaml @@ -0,0 +1,7 @@ +# recipients: abokovoy, frenaud, kaleem, ftrivino, rjeffman +--- !Policy +product_versions: + - rhel-9 +decision_context: osci_compose_gate +rules: + - !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional} diff --git a/python-dns.spec b/python-dns.spec new file mode 100644 index 0000000..eeaa936 --- /dev/null +++ b/python-dns.spec @@ -0,0 +1,122 @@ +%global with_python3 0 + +Name: python-dns +Version: 1.15.0 +Release: 10%{?dist} +Summary: DNS toolkit for Python + +Group: Development/Languages +License: MIT +URL: http://www.dnspython.org/ + +Source0: http://www.dnspython.org/kits/%{version}/dnspython-%{version}.tar.gz + +BuildArch: noarch +Patch0: test_fails_on_missing_file.patch + +Provides: python2-dns = %{version}-%{release} +BuildRequires: python2-devel +BuildRequires: python2-setuptools + +%if 0%{?with_python3} +BuildRequires: python%{python3_pkgversion}-devel +BuildRequires: python%{python3_pkgversion}-setuptools +%endif + +%description +dnspython is a DNS toolkit for Python. It supports almost all record +types. It can be used for queries, zone transfers, and dynamic +updates. It supports TSIG authenticated messages and EDNS0. + +dnspython provides both high and low level access to DNS. The high +level classes perform queries for data of a given name, type, and +class, and return an answer set. The low level classes allow direct +manipulation of DNS zones, messages, names, and records. + +%package -n python2-dns +Summary: DNS toolkit for Python 2 +Group: Development/Languages +%{?python_provide:%python_provide python2-dns} + +%description -n python2-dns +dnspython is a DNS toolkit for Python. It supports almost all record +types. It can be used for queries, zone transfers, and dynamic +updates. It supports TSIG authenticated messages and EDNS0. + +dnspython provides both high and low level access to DNS. The high +level classes perform queries for data of a given name, type, and +class, and return an answer set. The low level classes allow direct +manipulation of DNS zones, messages, names, and records. + +%if 0%{?with_python3} +%package -n python%{python3_pkgversion}-dns +Summary: DNS toolkit for Python 3 +Group: Development/Languages +%{?python_provide:%python_provide python%{python3_pkgversion}-dns} + +%description -n python%{python3_pkgversion}-dns +dnspython3 is a DNS toolkit for Python 3. It supports almost all +record types. It can be used for queries, zone transfers, and dynamic +updates. It supports TSIG authenticated messages and EDNS0. + +dnspython3 provides both high and low level access to DNS. The high +level classes perform queries for data of a given name, type, and +class, and return an answer set. The low level classes allow direct +manipulation of DNS zones, messages, names, and records. +%endif + +%prep +%setup -q -n dnspython-%{version} +%patch0 -p1 + +# strip exec permissions so that we don't pick up dependencies from docs +find examples -type f | xargs chmod a-x + +%build +%py2_build + +%if 0%{?with_python3} + %py3_build +%endif + +%install +%py2_install + +%if 0%{?with_python3} + %py3_install +%endif + +%check +%{__python2} setup.py test + +%if 0%{?with_python3} +%{__python3} setup.py test +%endif + +%files -n python2-dns +%defattr(-,root,root,-) +# Add README.* when it is included with the source (commit a906279) +%doc {ChangeLog,LICENSE,examples} +%{python2_sitelib}/*egg-info +%{python2_sitelib}/dns + +%if 0%{?with_python3} +%files -n python%{python3_pkgversion}-dns +%defattr(-,root,root,-) +# Add README.* when it is included with the source (commit a906279) +%doc {ChangeLog,LICENSE,examples} +%{python3_sitelib}/*egg-info +%{python3_sitelib}/dns +%endif + +%changelog +* Thu Apr 25 2019 Tomas Orsava - 1.15.0-10 +- Bumping due to problems with modular RPM upgrade path +- Resolves: rhbz#1695587 + +* Thu Apr 25 2019 Tomas Orsava - 1.15.0-9 +- Bumping due to problems with modular RPM upgrade path +- Resolves: rhbz#1695587 + +* Wed Jul 18 2018 Lumír Balhar - 1.15.0-8 +- First version for python27 module diff --git a/sources b/sources new file mode 100644 index 0000000..9161996 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA1 (dnspython-1.15.0.tar.gz) = fcb8edb4b307f68a27cd356e7b44f53512b63b5e diff --git a/test_fails_on_missing_file.patch b/test_fails_on_missing_file.patch new file mode 100644 index 0000000..5c7c989 --- /dev/null +++ b/test_fails_on_missing_file.patch @@ -0,0 +1,12 @@ +diff -ruN /home/avram/Desktop/dnspython-1.15.0.orig/tests/test_zone.py /home/avram/Desktop/dnspython-1.15.0/tests/test_zone.py +--- a/tests/test_zone.py 2016-09-20 12:24:02.000000000 -0400 ++++ b/tests/test_zone.py 2016-10-04 07:59:39.717946790 -0400 +@@ -177,7 +177,7 @@ + def testToFileFilename(self): + z = dns.zone.from_file(here('example'), 'example') + try: +- z.to_file('example3-filename.out') ++ z.to_file(here('example3-filename.out')) + ok = filecmp.cmp(here('example3-filename.out'), + here('example3.good')) + finally: