From 51951c5e8e11d7cb483ffcbf798923a1676ea1078a25669c4c9d5597610a2fa8 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Tue, 9 Jan 2024 21:31:35 +0000 Subject: [PATCH] - update to 4.0.0: * Bump major version due to incompatible change * Remove class DnsAsyncRequest, asyncore is removed from Python 3.12 and it would require a substial rewrite - If you need async DNS, use aiodns instead. (LP: #2003329) * Switch build system from setuptools with setup.py to flit * If /etc/resolv.conf, assume DNS server is '127.0.0.1', this changes the existing behavior - in previous releases there would be a FileNotFoundError. - drop python3-py3dns-handle-absent-resolv.patch, python3-py3dns-py3_friendly_warning.patch: solved upstream differently OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-py3dns?expand=0&rev=7 --- py3dns-3.2.1.tar.gz | 3 -- py3dns-4.0.0.tar.gz | 3 ++ python-py3dns.changes | 16 ++++++++++ python-py3dns.spec | 22 ++++++-------- python3-py3dns-handle-absent-resolv.patch | 37 ----------------------- python3-py3dns-py3_friendly_warning.patch | 11 ------- 6 files changed, 29 insertions(+), 63 deletions(-) delete mode 100644 py3dns-3.2.1.tar.gz create mode 100644 py3dns-4.0.0.tar.gz delete mode 100644 python3-py3dns-handle-absent-resolv.patch delete mode 100644 python3-py3dns-py3_friendly_warning.patch diff --git a/py3dns-3.2.1.tar.gz b/py3dns-3.2.1.tar.gz deleted file mode 100644 index cf1bc60..0000000 --- a/py3dns-3.2.1.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1f07d4463e98d9859ce0280c3eaa57da670ad623f6d4d3285c67dca23d7045e4 -size 30691 diff --git a/py3dns-4.0.0.tar.gz b/py3dns-4.0.0.tar.gz new file mode 100644 index 0000000..1ae5656 --- /dev/null +++ b/py3dns-4.0.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ddfdb691a6b7db3e706cd1e33ffeb5a4f45f28e0b8574ea4b8b74ef2c055330b +size 33734 diff --git a/python-py3dns.changes b/python-py3dns.changes index b9a7dd7..417ad8c 100644 --- a/python-py3dns.changes +++ b/python-py3dns.changes @@ -1,3 +1,19 @@ +------------------------------------------------------------------- +Tue Jan 9 21:30:53 UTC 2024 - Dirk Müller + +- update to 4.0.0: + * Bump major version due to incompatible change + * Remove class DnsAsyncRequest, asyncore is removed from Python + 3.12 and it would require a substial rewrite - + If you need async DNS, use aiodns instead. (LP: #2003329) + * Switch build system from setuptools with setup.py to flit + * If /etc/resolv.conf, assume DNS server is '127.0.0.1', this + changes the existing behavior - in previous releases there + would be a FileNotFoundError. +- drop python3-py3dns-handle-absent-resolv.patch, + python3-py3dns-py3_friendly_warning.patch: solved upstream + differently + ------------------------------------------------------------------- Tue Sep 10 12:56:30 UTC 2019 - Tomáš Chvátal diff --git a/python-py3dns.spec b/python-py3dns.spec index 559953b..2b19e38 100644 --- a/python-py3dns.spec +++ b/python-py3dns.spec @@ -1,7 +1,7 @@ # # spec file for package python-py3dns # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,19 +16,17 @@ # -%{?!python_module:%define python_module() python-%{**} python3-%{**}} -%define skip_python2 1 Name: python-py3dns -Version: 3.2.1 +Version: 4.0.0 Release: 0 Summary: Python module for DNS (Domain Name Service) License: CNRI-Python Group: Development/Languages/Python URL: https://launchpad.net/py3dns Source: https://files.pythonhosted.org/packages/source/p/py3dns/py3dns-%{version}.tar.gz -Patch0: python3-py3dns-handle-absent-resolv.patch -Patch1: python3-py3dns-py3_friendly_warning.patch -BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module flit-core} +BuildRequires: %{python_module pip} +BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros BuildArch: noarch @@ -40,14 +38,13 @@ This package contains a module (dnslib) that implements a DNS symbolic constants used by DNS (dnstype, dnsclass, dnsopcode). %prep -%setup -q -n py3dns-%{version} -%autopatch -p1 +%autosetup -p1 -n py3dns-%{version} %build -%python_build +%pyproject_wheel %install -%python_install +%pyproject_install %python_expand %fdupes %{buildroot}%{$python_sitelib} %check @@ -57,6 +54,7 @@ symbolic constants used by DNS (dnstype, dnsclass, dnsopcode). %files %{python_files} %license LICENSE %doc README* CHANGES -%{python_sitelib}/* +%{python_sitelib}/DNS +%{python_sitelib}/py3dns-%{version}.dist-info %changelog diff --git a/python3-py3dns-handle-absent-resolv.patch b/python3-py3dns-handle-absent-resolv.patch deleted file mode 100644 index fafcfc5..0000000 --- a/python3-py3dns-handle-absent-resolv.patch +++ /dev/null @@ -1,37 +0,0 @@ -From c95cb269a6f0cb57c1204c29bec30d40e41eb2ef Mon Sep 17 00:00:00 2001 -From: Ralph Bean -Date: Thu, 2 Feb 2017 12:19:00 -0500 -Subject: [PATCH] Handle /etc/resolv.conf - ---- - DNS/Base.py | 10 +++++++--- - 1 file changed, 7 insertions(+), 3 deletions(-) - -Index: py3dns-3.2.1/DNS/Base.py -=================================================================== ---- py3dns-3.2.1.orig/DNS/Base.py -+++ py3dns-3.2.1/DNS/Base.py -@@ -11,7 +11,7 @@ Changes for Python3 port © 2011-14 Scot - Base functionality. Request and Response classes, that sort of thing. - """ - --import socket, string, types, time, select -+import socket, string, types, time, select, warnings - import errno - from . import Type,Class,Opcode - import asyncore -@@ -50,8 +50,12 @@ defaults= { 'protocol':'udp', 'port':53, - - def ParseResolvConf(resolv_path="/etc/resolv.conf"): - "parses the /etc/resolv.conf file and sets defaults for name servers" -- with open(resolv_path, 'r') as stream: -- return ParseResolvConfFromIterable(stream) -+ try: -+ with open(resolv_path, 'r') as stream: -+ return ParseResolvConfFromIterable(stream) -+ except FileNotFoundError as e: -+ warnings.warn(e) -+ return - - def ParseResolvConfFromIterable(lines): - "parses a resolv.conf formatted stream and sets defaults for name servers" diff --git a/python3-py3dns-py3_friendly_warning.patch b/python3-py3dns-py3_friendly_warning.patch deleted file mode 100644 index 2dda991..0000000 --- a/python3-py3dns-py3_friendly_warning.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/DNS/Base.py 2018-03-27 21:22:25.000000000 +0000 -+++ b/DNS/Base.py 2018-03-27 21:21:57.000000000 +0000 -@@ -53,7 +53,7 @@ - with open(resolv_path, 'r') as stream: - return ParseResolvConfFromIterable(stream) - except FileNotFoundError as e: -- warnings.warn(e) -+ warnings.warn(str(e)) - return - - def ParseResolvConfFromIterable(lines):