Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-localzone for 
openSUSE:Factory checked in at 2023-01-08 21:25:36
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-localzone (Old)
 and      /work/SRC/openSUSE:Factory/.python-localzone.new.1563 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-localzone"

Sun Jan  8 21:25:36 2023 rev:6 rq:1056830 version:0.9.8

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-localzone/python-localzone.changes        
2021-01-19 16:03:02.319456472 +0100
+++ 
/work/SRC/openSUSE:Factory/.python-localzone.new.1563/python-localzone.changes  
    2023-01-08 21:25:36.371270871 +0100
@@ -1,0 +2,7 @@
+Sat Jan  7 23:06:36 UTC 2023 - Dirk Müller <dmuel...@suse.com>
+
+- update to 0.9.8:
+  * Support dnspython 2.1.
+- drop localzone-dnspython-2.1.patch (upstream)
+
+-------------------------------------------------------------------

Old:
----
  localzone-0.9.7.tar.gz
  localzone-dnspython-2.1.patch

New:
----
  localzone-0.9.8.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-localzone.spec ++++++
--- /var/tmp/diff_new_pack.ilbXQH/_old  2023-01-08 21:25:36.807273462 +0100
+++ /var/tmp/diff_new_pack.ilbXQH/_new  2023-01-08 21:25:36.815273509 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-localzone
 #
-# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2023 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-localzone
-Version:        0.9.7
+Version:        0.9.8
 Release:        0
 Summary:        A library for managing DNS zones
 License:        BSD-3-Clause
@@ -26,8 +26,6 @@
 URL:            https://github.com/ags-slc/localzone
 # The PyPI sdist does not provide the tests
 Source:         
https://github.com/ags-slc/localzone/archive/v%{version}.tar.gz#/localzone-%{version}.tar.gz
-# PATCH-FIX-UPSTREAM localzone-dnspython-2.1.patch gh#ags-slc/localzone#3 -- 
support dnspython 2.1
-Patch0:         
https://github.com/ags-slc/localzone/pull/3.patch#/localzone-dnspython-2.1.patch
 BuildRequires:  %{python_module dnspython}
 BuildRequires:  %{python_module pytest}
 BuildRequires:  %{python_module setuptools}

++++++ localzone-0.9.7.tar.gz -> localzone-0.9.8.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/localzone-0.9.7/CHANGELOG.rst 
new/localzone-0.9.8/CHANGELOG.rst
--- old/localzone-0.9.7/CHANGELOG.rst   2020-10-06 19:05:06.000000000 +0200
+++ new/localzone-0.9.8/CHANGELOG.rst   2021-01-20 03:53:27.000000000 +0100
@@ -1,3 +1,7 @@
+v0.9.8
+------
+- Support dnspython 2.1.
+
 v0.9.7
 ------
 - Support dnspython 2.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/localzone-0.9.7/localzone/__version__.py 
new/localzone-0.9.8/localzone/__version__.py
--- old/localzone-0.9.7/localzone/__version__.py        2020-10-06 
19:05:06.000000000 +0200
+++ new/localzone-0.9.8/localzone/__version__.py        2021-01-20 
03:53:27.000000000 +0100
@@ -1,4 +1,4 @@
-VERSION = (0, 9, 7)
+VERSION = (0, 9, 8)
 
 __title__ = "localzone"
 __description__ = "A simple library for managing DNS zones."
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/localzone-0.9.7/localzone/context.py 
new/localzone-0.9.8/localzone/context.py
--- old/localzone-0.9.7/localzone/context.py    2020-10-06 19:05:06.000000000 
+0200
+++ new/localzone-0.9.8/localzone/context.py    2021-01-20 03:53:27.000000000 
+0100
@@ -13,6 +13,14 @@
 import dns.rdataclass
 import dns.tokenizer
 import dns.zone
+try:
+    # The api for the zonefile reader was exposed in dnspython 2.1
+    from dns.zonefile import Reader
+    DNSPYTHON21 = True
+except ImportError:
+    from dns.zone import _MasterReader
+    DNSPYTHON21 = False
+
 from .models import Zone
 
 
@@ -57,25 +65,42 @@
     """
     with open(filename) as text:
         tok = dns.tokenizer.Tokenizer(text, filename)
-        reader = dns.zone._MasterReader(
-            tok,
-            origin=origin,
-            rdclass=dns.rdataclass.IN,
-            relativize=True,
-            zone_factory=Zone,
-            allow_include=True,
-            check_origin=True,
-        )
-        reader.read()
-
-        # TODO: remember that any method using the zone.filename property 
should
-        # have it passed as a parameter
-        reader.zone._filename = filename
-
-        # starting with dnspython v1.16.0, use default_ttl
-        try:
-            reader.zone._ttl = reader.default_ttl
-        except AttributeError:
-            reader.zone._ttl = reader.ttl
+        if DNSPYTHON21:
+            zone = Zone(
+                origin,
+                dns.rdataclass.IN,
+                relativize=True,
+                )
+            with zone.writer() as txn:
+                reader = Reader(
+                    tok,
+                    rdclass=dns.rdataclass.IN,
+                    txn=txn,
+                    allow_include=True,
+                )
+                reader.read()
+        else:
+            reader = _MasterReader(
+                tok,
+                origin=origin,
+                rdclass=dns.rdataclass.IN,
+                relativize=True,
+                zone_factory=Zone,
+                allow_include=True,
+                check_origin=True,
+            )
+            reader.read()
+            zone = reader.zone
+
+    # TODO: remember that any method using the zone.filename property should
+    # have it passed as a parameter
+    zone._filename = filename
+
+    # starting with dnspython v1.16.0, use default_ttl
+    try:
+        zone._ttl = reader.default_ttl
+    except AttributeError:
+        zone._ttl = reader.ttl
+
+    return zone
 
-        return reader.zone
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/localzone-0.9.7/localzone/models.py 
new/localzone-0.9.8/localzone/models.py
--- old/localzone-0.9.7/localzone/models.py     2020-10-06 19:05:06.000000000 
+0200
+++ new/localzone-0.9.8/localzone/models.py     2021-01-20 03:53:27.000000000 
+0100
@@ -49,11 +49,11 @@
         # record is released. Probably not a big deal, as there is really no
         # reason to hold the record given the existence of the soa property.
         # Should this implementation be reconsidered?
-        try:
-            self.soa.rdata.serial = next_serial
-        except TypeError:
+        if hasattr(self.soa.rdata, 'replace'):
             content = self.soa.rdata.replace(serial=next_serial).to_text()
             self.update_record(self.soa.hashid, content)
+        else:
+            self.soa.rdata.serial = next_serial
 
     def save(self, filename=None, autoserial=True):
         """
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/localzone-0.9.7/tests/test_context.py 
new/localzone-0.9.8/tests/test_context.py
--- old/localzone-0.9.7/tests/test_context.py   2020-10-06 19:05:06.000000000 
+0200
+++ new/localzone-0.9.8/tests/test_context.py   2021-01-20 03:53:27.000000000 
+0100
@@ -1,6 +1,9 @@
 import pytest
 import localzone
-from dns.zone import UnknownOrigin
+try:
+    from dns.zonefile import UnknownOrigin
+except ImportError:
+    from dns.zone import UnknownOrigin
 
 ZONEFILE = "tests/zonefiles/db.example.com"
 ORIGIN = "example.com."
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/localzone-0.9.7/tests/test_models.py 
new/localzone-0.9.8/tests/test_models.py
--- old/localzone-0.9.7/tests/test_models.py    2020-10-06 19:05:06.000000000 
+0200
+++ new/localzone-0.9.8/tests/test_models.py    2021-01-20 03:53:27.000000000 
+0100
@@ -1,4 +1,5 @@
 from dns.rdatatype import UnknownRdatatype
+from dns.exception import SyntaxError as DNSSyntaxError
 import pytest
 import localzone
 
@@ -77,7 +78,7 @@
 
 def test_zone_add_record_no_content():
     with localzone.manage(ZONEFILE, ORIGIN) as z:
-        with pytest.raises(AttributeError):
+        with pytest.raises((AttributeError, DNSSyntaxError)):
             z.add_record("test", "txt", None)
 
 

Reply via email to