Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-ntplib for openSUSE:Factory checked in at 2022-12-08 16:51:49 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-ntplib (Old) and /work/SRC/openSUSE:Factory/.python-ntplib.new.1835 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-ntplib" Thu Dec 8 16:51:49 2022 rev:3 rq:1041241 version:0.4.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-ntplib/python-ntplib.changes 2020-10-02 17:37:35.382748866 +0200 +++ /work/SRC/openSUSE:Factory/.python-ntplib.new.1835/python-ntplib.changes 2022-12-08 16:51:58.435725220 +0100 @@ -1,0 +2,10 @@ +Wed Dec 7 19:56:00 UTC 2022 - Yogalakshmi Arunachalam <yarunacha...@suse.com> + +- Update to version 0.4.0 - 2021-05-28 + - flake8 conformance + - Add ROA Reference ID + +- Update to version 0.3.4 - 2020-04-28 + - Re-release of 0.3.3 (0.3.3 was mistakenly deleted from PyPI) + +------------------------------------------------------------------- Old: ---- ntplib-0.3.3.tar.gz New: ---- ntplib-0.4.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-ntplib.spec ++++++ --- /var/tmp/diff_new_pack.OwXr6I/_old 2022-12-08 16:51:58.903727620 +0100 +++ /var/tmp/diff_new_pack.OwXr6I/_new 2022-12-08 16:51:58.907727641 +0100 @@ -1,7 +1,7 @@ # -# spec file for package python-ntplib +# spec file # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,7 +19,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define upstream_name ntplib Name: python-%{upstream_name} -Version: 0.3.3 +Version: 0.4.0 Release: 0 Summary: Python NTP library License: MIT ++++++ ntplib-0.3.3.tar.gz -> ntplib-0.4.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ntplib-0.3.3/CHANGELOG new/ntplib-0.4.0/CHANGELOG --- old/ntplib-0.3.3/CHANGELOG 2015-07-27 22:16:39.000000000 +0200 +++ new/ntplib-0.4.0/CHANGELOG 2021-05-28 20:52:59.000000000 +0200 @@ -1,3 +1,12 @@ +version 0.4.0 - 2021-05-28 +-------------------------- +- flake8 conformance +- Add ROA Reference ID + +version 0.3.4 - 2020-04-28 +-------------------------- +- Re-release of 0.3.3 (0.3.3 was mistakenly deleted from PyPI) + version 0.3.3 - 2015-07-27 -------------------------- - Change to more permissive MIT license diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ntplib-0.3.3/LICENSE new/ntplib-0.4.0/LICENSE --- old/ntplib-0.3.3/LICENSE 1970-01-01 01:00:00.000000000 +0100 +++ new/ntplib-0.4.0/LICENSE 2021-05-28 20:48:15.000000000 +0200 @@ -0,0 +1,23 @@ +############################################################################### +# The MIT License (MIT) +# +# Copyright (C) 2009-2015 Charles-Francois Natali <cf.nat...@gmail.com> +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +############################################################################### \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ntplib-0.3.3/MANIFEST new/ntplib-0.4.0/MANIFEST --- old/ntplib-0.3.3/MANIFEST 2014-02-02 16:18:39.000000000 +0100 +++ new/ntplib-0.4.0/MANIFEST 1970-01-01 01:00:00.000000000 +0100 @@ -1,8 +0,0 @@ -ntplib.py -test_ntplib.py -setup.py -CHANGELOG -COPYING -COPYING.LESSER -MANIFEST -PKG-INFO diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ntplib-0.3.3/MANIFEST.in new/ntplib-0.4.0/MANIFEST.in --- old/ntplib-0.3.3/MANIFEST.in 1970-01-01 01:00:00.000000000 +0100 +++ new/ntplib-0.4.0/MANIFEST.in 2021-05-28 20:48:15.000000000 +0200 @@ -0,0 +1,3 @@ +include LICENSE +include README.md +include CHANGELOG \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ntplib-0.3.3/PKG-INFO new/ntplib-0.4.0/PKG-INFO --- old/ntplib-0.3.3/PKG-INFO 2015-07-27 22:52:27.000000000 +0200 +++ new/ntplib-0.4.0/PKG-INFO 2021-05-28 21:05:54.073379500 +0200 @@ -1,8 +1,8 @@ Metadata-Version: 1.1 Name: ntplib -Version: 0.3.3 +Version: 0.4.0 Summary: Python NTP library -Home-page: http://code.google.com/p/ntplib/ +Home-page: https://github.com/cf-natali/ntplib Author: Charles-Francois Natali Author-email: cf.nat...@gmail.com License: MIT @@ -55,3 +55,8 @@ Classifier: Programming Language :: Python Classifier: Operating System :: OS Independent Classifier: Topic :: System :: Networking :: Time Synchronization +Classifier: Programming Language :: Python :: 2.7 +Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ntplib-0.3.3/README.md new/ntplib-0.4.0/README.md --- old/ntplib-0.3.3/README.md 1970-01-01 01:00:00.000000000 +0100 +++ new/ntplib-0.4.0/README.md 2021-05-28 20:48:15.000000000 +0200 @@ -0,0 +1,42 @@ +<h1 align="center">ntplib</h1> +<div align="center">An NTP Client for Python</div> +<br /> + +[](https://pypi.python.org/pypi/ntplib) +[](https://pypi.python.org/pypi/ntplib) + +# Description + +This module offers a simple interface to query NTP servers from Python. + +It also provides utility functions to translate NTP fields values to text +(mode, leap indicatorâ¦). Since itâs pure Python, and only depends on core +modules, it should work on any platform with a Python implementation. + + +# Example + +``` +>>> import ntplib +>>> from time import ctime +>>> c = ntplib.NTPClient() +>>> response = c.request('europe.pool.ntp.org', version=3) +>>> response.offset +-0.143156766891 +>>> response.version +3 +>>> ctime(response.tx_time) +'Sun May 17 09:32:48 2009' +>>> ntplib.leap_to_text(response.leap) +'no warning' +>>> response.root_delay +0.0046844482421875 +>>> ntplib.ref_id_to_text(response.ref_id) +193.190.230.66 +``` + +# Installation + +``` +python setup.py install +``` \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ntplib-0.3.3/ntplib.egg-info/PKG-INFO new/ntplib-0.4.0/ntplib.egg-info/PKG-INFO --- old/ntplib-0.3.3/ntplib.egg-info/PKG-INFO 1970-01-01 01:00:00.000000000 +0100 +++ new/ntplib-0.4.0/ntplib.egg-info/PKG-INFO 2021-05-28 21:05:53.000000000 +0200 @@ -0,0 +1,62 @@ +Metadata-Version: 1.1 +Name: ntplib +Version: 0.4.0 +Summary: Python NTP library +Home-page: https://github.com/cf-natali/ntplib +Author: Charles-Francois Natali +Author-email: cf.nat...@gmail.com +License: MIT +Description: + ntplib - Python NTP library + =========================== + + Description + ----------- + + This module offers a simple interface to query NTP servers from Python. + + It also provides utility functions to translate NTP fields values to text (mode, + leap indicator...). Since it's pure Python, and only depends on core modules, it + should work on any platform with a Python implementation. + + Example + ------- + + >>> import ntplib + >>> from time import ctime + >>> c = ntplib.NTPClient() + >>> response = c.request('europe.pool.ntp.org', version=3) + >>> response.offset + -0.143156766891 + >>> response.version + 3 + >>> ctime(response.tx_time) + 'Sun May 17 09:32:48 2009' + >>> ntplib.leap_to_text(response.leap) + 'no warning' + >>> response.root_delay + 0.0046844482421875 + >>> ntplib.ref_id_to_text(response.ref_id) + 193.190.230.66 + + + Installation + ------------ + + As root:: + + # python setup.py install + + or just copy ntplib.py inside a directory in your sys.path, e.g. + `/usr/lib/python2.5/`. + +Platform: UNKNOWN +Classifier: License :: OSI Approved :: MIT License +Classifier: Programming Language :: Python +Classifier: Operating System :: OS Independent +Classifier: Topic :: System :: Networking :: Time Synchronization +Classifier: Programming Language :: Python :: 2.7 +Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ntplib-0.3.3/ntplib.egg-info/SOURCES.txt new/ntplib-0.4.0/ntplib.egg-info/SOURCES.txt --- old/ntplib-0.3.3/ntplib.egg-info/SOURCES.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/ntplib-0.4.0/ntplib.egg-info/SOURCES.txt 2021-05-28 21:05:53.000000000 +0200 @@ -0,0 +1,11 @@ +CHANGELOG +LICENSE +MANIFEST.in +README.md +ntplib.py +setup.cfg +setup.py +ntplib.egg-info/PKG-INFO +ntplib.egg-info/SOURCES.txt +ntplib.egg-info/dependency_links.txt +ntplib.egg-info/top_level.txt \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ntplib-0.3.3/ntplib.egg-info/dependency_links.txt new/ntplib-0.4.0/ntplib.egg-info/dependency_links.txt --- old/ntplib-0.3.3/ntplib.egg-info/dependency_links.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/ntplib-0.4.0/ntplib.egg-info/dependency_links.txt 2021-05-28 21:05:53.000000000 +0200 @@ -0,0 +1 @@ + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ntplib-0.3.3/ntplib.egg-info/top_level.txt new/ntplib-0.4.0/ntplib.egg-info/top_level.txt --- old/ntplib-0.3.3/ntplib.egg-info/top_level.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/ntplib-0.4.0/ntplib.egg-info/top_level.txt 2021-05-28 21:05:53.000000000 +0200 @@ -0,0 +1 @@ +ntplib diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ntplib-0.3.3/ntplib.py new/ntplib-0.4.0/ntplib.py --- old/ntplib-0.3.3/ntplib.py 2015-07-27 22:20:45.000000000 +0200 +++ new/ntplib-0.4.0/ntplib.py 2021-05-28 20:48:15.000000000 +0200 @@ -81,6 +81,7 @@ "1PPS": "External 1 PPS input", "FREE": "(Internal clock)", "INIT": "(Initialization)", + "ROA\0": "Real Observatorio de la Armada", "\0\0\0\0": "NULL", } """reference identifier table""" @@ -112,7 +113,7 @@ """leap indicator table""" -class NTPPacket: +class NTPPacket(object): """NTP packet class. This represents an NTP packet. @@ -166,7 +167,8 @@ NTPException -- in case of invalid field """ try: - packed = struct.pack(NTPPacket._PACKET_FORMAT, + packed = struct.pack( + NTPPacket._PACKET_FORMAT, (self.leap << 6 | self.version << 3 | self.mode), self.stratum, self.poll, @@ -198,8 +200,10 @@ NTPException -- in case of invalid packet format """ try: - unpacked = struct.unpack(NTPPacket._PACKET_FORMAT, - data[0:struct.calcsize(NTPPacket._PACKET_FORMAT)]) + unpacked = struct.unpack( + NTPPacket._PACKET_FORMAT, + data[0:struct.calcsize(NTPPacket._PACKET_FORMAT)] + ) except struct.error: raise NTPException("Invalid NTP packet.") @@ -227,7 +231,7 @@ def __init__(self): """Constructor.""" - NTPPacket.__init__(self) + super(NTPStats, self).__init__() self.dest_timestamp = 0 """destination timestamp""" @@ -269,14 +273,14 @@ return ntp_to_system_time(self.dest_timestamp) -class NTPClient: +class NTPClient(object): """NTP client session.""" def __init__(self): """Constructor.""" pass - def request(self, host, version=2, port='ntp', timeout=5): + def request(self, host, version=2, port="ntp", timeout=5): """Query a NTP server. Parameters: @@ -299,8 +303,11 @@ s.settimeout(timeout) # create the request packet - mode 3 is client - query_packet = NTPPacket(mode=3, version=version, - tx_timestamp=system_to_ntp_time(time.time())) + query_packet = NTPPacket( + mode=3, + version=version, + tx_timestamp=system_to_ntp_time(time.time()) + ) # send the request s.sendto(query_packet.to_data(), sockaddr) @@ -437,11 +444,11 @@ NTPException -- in case of invalid stratum """ if stratum in NTP.STRATUM_TABLE: - return NTP.STRATUM_TABLE[stratum] % (stratum) + return NTP.STRATUM_TABLE[stratum] % stratum elif 1 < stratum < 16: - return "secondary reference (%s)" % (stratum) + return "secondary reference (%s)" % stratum elif stratum == 16: - return "unsynchronized (%s)" % (stratum) + return "unsynchronized (%s)" % stratum else: raise NTPException("Invalid stratum or reserved.") @@ -464,12 +471,12 @@ # return the result as a string or dot-formatted IP address if 0 <= stratum <= 1: - text = '%c%c%c%c' % fields + text = "%c%c%c%c" % fields if text in NTP.REF_ID_TABLE: return NTP.REF_ID_TABLE[text] else: - return "Unidentified reference source '%s'" % (text) + return "Unidentified reference source '%s'" % text elif 2 <= stratum < 255: - return '%d.%d.%d.%d' % fields + return "%d.%d.%d.%d" % fields else: raise NTPException("Invalid stratum.") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ntplib-0.3.3/setup.cfg new/ntplib-0.4.0/setup.cfg --- old/ntplib-0.3.3/setup.cfg 1970-01-01 01:00:00.000000000 +0100 +++ new/ntplib-0.4.0/setup.cfg 2021-05-28 21:05:54.077379500 +0200 @@ -0,0 +1,22 @@ +[bdist_wheel] +universal = 1 + +[flake8] +max-line-length = 100 +inline-quotes = double + +[isort] +balanced_wrapping = true +line_length = 80 +lines_after_imports = 2 +multi_line_output = 3 +not_skip = __init__.py +order_by_type = true + +[metadata] +description-file = README.md + +[egg_info] +tag_build = +tag_date = 0 + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ntplib-0.3.3/setup.py new/ntplib-0.4.0/setup.py --- old/ntplib-0.3.3/setup.py 2015-07-27 22:15:44.000000000 +0200 +++ new/ntplib-0.4.0/setup.py 2021-05-28 20:51:34.000000000 +0200 @@ -1,4 +1,4 @@ -from distutils.core import setup +from setuptools import setup long_description = """ @@ -47,19 +47,25 @@ """ -setup(name='ntplib', - version='0.3.3', - description='Python NTP library', - author='Charles-Francois Natali', - author_email='cf.nat...@gmail.com', - url='http://code.google.com/p/ntplib/', - py_modules=['ntplib'], - license='MIT', - classifiers=[ - 'License :: OSI Approved :: MIT License', - 'Programming Language :: Python', - 'Operating System :: OS Independent', - 'Topic :: System :: Networking :: Time Synchronization' - ], - long_description=long_description - ) +setup( + name="ntplib", + version="0.4.0", + description="Python NTP library", + author="Charles-Francois Natali", + author_email="cf.nat...@gmail.com", + url="https://github.com/cf-natali/ntplib", + py_modules=["ntplib"], + license="MIT", + classifiers=[ + "License :: OSI Approved :: MIT License", + "Programming Language :: Python", + "Operating System :: OS Independent", + "Topic :: System :: Networking :: Time Synchronization", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + ], + long_description=long_description +) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ntplib-0.3.3/test_ntplib.py new/ntplib-0.4.0/test_ntplib.py --- old/ntplib-0.3.3/test_ntplib.py 2014-02-02 16:18:39.000000000 +0100 +++ new/ntplib-0.4.0/test_ntplib.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,100 +0,0 @@ -"""Python NTP library tests.""" - - -import time -import unittest - -import ntplib - - -class TestNTPLib(unittest.TestCase): - - NTP_SERVER = "pool.ntp.org" - """test NTP server""" - - POLL_DELAY = 1 - """delay between NTP polls, in seconds""" - - DELTA_TOLERANCE = 0.5 - """tolerance for offset/delay comparisons, in seconds""" - - def test_basic(self): - """Basic tests.""" - self.assertTrue(issubclass(ntplib.NTPException, Exception)) - - ntplib.NTPClient() - - def test_request(self): - """Request tests.""" - client = ntplib.NTPClient() - - t1 = time.time() - info = client.request(self.NTP_SERVER) - t2 = time.time() - - # check response - self.assertTrue(isinstance(info, ntplib.NTPStats)) - self.assertTrue(0 < info.version <= 4) - self.assertTrue(isinstance(info.offset, float)) - self.assertTrue(0 <= info.stratum < 0xff) - self.assertTrue(-0x7f <= info.precision < 0x7f) - self.assertTrue(isinstance(info.root_delay, float)) - self.assertTrue(isinstance(info.root_dispersion, float)) - self.assertTrue(isinstance(info.delay, float)) - self.assertTrue(isinstance(info.leap, int)) - self.assertIn(info.leap, ntplib.NTP.LEAP_TABLE) - self.assertTrue(0 <= info.poll < 0xfff) - self.assertTrue(isinstance(info.mode, int)) - self.assertIn(info.mode, ntplib.NTP.MODE_TABLE) - self.assertTrue(0 <= info.ref_id < 0xffffffff) - self.assertTrue(isinstance(info.tx_time, float)) - self.assertTrue(isinstance(info.ref_time, float)) - self.assertTrue(isinstance(info.orig_time, float)) - self.assertTrue(isinstance(info.recv_time, float)) - self.assertTrue(isinstance(info.dest_time, float)) - - time.sleep(self.POLL_DELAY) - - new_info = client.request(self.NTP_SERVER) - - # check timestamps - self.assertTrue(t1 < info.orig_time < info.dest_time < t2) - self.assertTrue(info.orig_time < new_info.orig_time) - self.assertTrue(info.recv_time < new_info.recv_time) - self.assertTrue(info.tx_time < new_info.tx_time) - self.assertTrue(info.dest_time < new_info.dest_time) - - # check the offset and delay - self.assertLess(abs(new_info.offset - info.offset), - self.DELTA_TOLERANCE) - self.assertLess(abs(new_info.delay - info.delay), self.DELTA_TOLERANCE) - - # try reaching a non existent server - self.assertRaises(ntplib.NTPException, - client.request, "localhost", port=42) - - # try reaching a non existent server with a custom timeout - t = time.time() - self.assertRaises(ntplib.NTPException, - client.request, "localhost", port=42, timeout=1) - self.assertTrue(0.7 < time.time() - t < 1.3) - - def test_helpers(self): - """Helper methods tests.""" - client = ntplib.NTPClient() - - time.sleep(self.POLL_DELAY) - info = client.request(self.NTP_SERVER) - - self.assertEqual(int(info.tx_time), ntplib.ntp_to_system_time( - ntplib.system_to_ntp_time(int(info.tx_time)))) - - self.assertTrue(isinstance(ntplib.leap_to_text(info.leap), str)) - self.assertTrue(isinstance(ntplib.mode_to_text(info.mode), str)) - self.assertTrue(isinstance(ntplib.stratum_to_text(info.stratum), str)) - self.assertTrue(isinstance(ntplib.ref_id_to_text(info.ref_id, - info.stratum), str)) - - -if __name__ == '__main__': - unittest.main()