Hello community, here is the log from the commit of package python-tqdm for openSUSE:Factory checked in at 2017-11-08 15:09:59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-tqdm (Old) and /work/SRC/openSUSE:Factory/.python-tqdm.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-tqdm" Wed Nov 8 15:09:59 2017 rev:5 rq:536029 version:4.19.4 Changes: -------- --- /work/SRC/openSUSE:Factory/python-tqdm/python-tqdm.changes 2017-10-13 14:18:11.418681477 +0200 +++ /work/SRC/openSUSE:Factory/.python-tqdm.new/python-tqdm.changes 2017-11-08 15:10:16.629733700 +0100 @@ -1,0 +2,14 @@ +Sun Oct 15 22:18:08 UTC 2017 - [email protected] + +- update to version 4.19.4: + * fix Lock:NotImplementedError on certain systems (#466 -> #468) + * use recursive locks (#469 -> #468) + + fix deadlocks + * tidy (#448) + * flush() on moveto() (#398 -> #399, #420, #467) + * update tests and benchmarks + +- changes from version 4.19.3: + * no changelog available + +------------------------------------------------------------------- Old: ---- tqdm-4.19.2.tar.gz New: ---- tqdm-4.19.4.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-tqdm.spec ++++++ --- /var/tmp/diff_new_pack.xbf4No/_old 2017-11-08 15:10:17.705694419 +0100 +++ /var/tmp/diff_new_pack.xbf4No/_new 2017-11-08 15:10:17.709694273 +0100 @@ -20,7 +20,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %bcond_without test Name: python-tqdm -Version: 4.19.2 +Version: 4.19.4 Release: 0 Summary: An extensible progress meter License: MPL-2.0 and MIT ++++++ tqdm-4.19.2.tar.gz -> tqdm-4.19.4.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tqdm-4.19.2/PKG-INFO new/tqdm-4.19.4/PKG-INFO --- old/tqdm-4.19.2/PKG-INFO 2017-10-09 01:33:54.000000000 +0200 +++ new/tqdm-4.19.4/PKG-INFO 2017-10-15 17:42:34.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: tqdm -Version: 4.19.2 +Version: 4.19.4 Summary: Fast, Extensible Progress Meter Home-page: https://github.com/tqdm/tqdm Author: tqdm developers diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tqdm-4.19.2/tqdm/_main.py new/tqdm-4.19.4/tqdm/_main.py --- old/tqdm-4.19.2/tqdm/_main.py 2017-10-02 02:01:47.000000000 +0200 +++ new/tqdm-4.19.4/tqdm/_main.py 2017-10-15 17:04:37.000000000 +0200 @@ -17,7 +17,7 @@ try: return eval(typ + '("' + val + '")') except: - if (typ == 'chr'): + if typ == 'chr': return chr(ord(eval('"' + val + '"'))) else: raise TqdmTypeError(val + ' : ' + typ) @@ -35,7 +35,7 @@ """ fp_write = fout.write - tmp = '' + # tmp = '' if not delim: while True: tmp = fin.read(buf_size) @@ -47,7 +47,7 @@ fp_write(tmp) callback(len(tmp)) - return + # return buf = '' # n = 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tqdm-4.19.2/tqdm/_tqdm.py new/tqdm-4.19.4/tqdm/_tqdm.py --- old/tqdm-4.19.2/tqdm/_tqdm.py 2017-10-09 01:17:47.000000000 +0200 +++ new/tqdm-4.19.4/tqdm/_tqdm.py 2017-10-15 17:06:27.000000000 +0200 @@ -50,8 +50,12 @@ # Create global parallelism locks to avoid racing issues with parallel bars # works only if fork available (Linux, MacOSX, but not on Windows) -mp_lock = mp.Lock() # multiprocessing lock -th_lock = th.Lock() # thread lock +try: + mp_lock = mp.RLock() # multiprocessing lock + th_lock = th.RLock() # thread lock +except OSError: # pragma: no cover + mp_lock = None + th_lock = None class TqdmDefaultWriteLock(object): @@ -63,7 +67,7 @@ """ def __init__(self): global mp_lock, th_lock - self.locks = [mp_lock, th_lock] + self.locks = [lk for lk in [mp_lock, th_lock] if lk is not None] def acquire(self): for lock in self.locks: @@ -917,7 +921,7 @@ return id(self) def __iter__(self): - ''' Backward-compatibility to use: for x in tqdm(iterable) ''' + """Backward-compatibility to use: for x in tqdm(iterable)""" # Inlining instance variables as locals (speed optimisation) iterable = self.iterable @@ -1211,6 +1215,7 @@ def moveto(self, n): self.fp.write(_unicode('\n' * n + _term_move_up() * -n)) + self.fp.flush() def clear(self, nolock=False): """ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tqdm-4.19.2/tqdm/_tqdm_gui.py new/tqdm-4.19.4/tqdm/_tqdm_gui.py --- old/tqdm-4.19.2/tqdm/_tqdm_gui.py 2017-09-21 00:07:59.000000000 +0200 +++ new/tqdm-4.19.4/tqdm/_tqdm_gui.py 2017-10-15 17:04:37.000000000 +0200 @@ -11,7 +11,7 @@ # a result precise floating numbers (instead of truncated int) from __future__ import division, absolute_import # import compatibility functions and utilities -import sys +# import sys from time import time from ._utils import _range # to inherit from the tqdm class @@ -27,16 +27,7 @@ Experimental GUI version of tqdm! """ - @classmethod - def write(cls, s, file=None, end="\n"): - """ - Print a message via tqdm_gui (just an alias for print) - """ - if file is None: - file = sys.stdout - # TODO: print text on GUI? - file.write(s) - file.write(end) + # TODO: @classmethod: write() on GUI? def __init__(self, *args, **kwargs): import matplotlib as mpl diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tqdm-4.19.2/tqdm/_tqdm_notebook.py new/tqdm-4.19.4/tqdm/_tqdm_notebook.py --- old/tqdm-4.19.2/tqdm/_tqdm_notebook.py 2017-09-21 00:07:59.000000000 +0200 +++ new/tqdm-4.19.4/tqdm/_tqdm_notebook.py 2017-10-15 17:04:37.000000000 +0200 @@ -116,7 +116,7 @@ # Get current iteration value from format_meter string if total: - n = None + # n = None if s: npos = s.find(r'/|/') # cause we use bar_format=r'{n}|...' # Check that n can be found in s (else n > total) @@ -150,17 +150,6 @@ return print_status - @classmethod - def write(cls, s, file=None, end="\n"): - """ - Print a message via tqdm_notebook (just an alias for print) - """ - if file is None: - file = sys.stdout - # Just an alias for print because overlap is impossible with ipywidgets - file.write(s) - file.write(end) - def __init__(self, *args, **kwargs): # Setup default output if kwargs.get('file', sys.stderr) is sys.stderr: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tqdm-4.19.2/tqdm/_utils.py new/tqdm-4.19.4/tqdm/_utils.py --- old/tqdm-4.19.2/tqdm/_utils.py 2017-10-02 02:01:47.000000000 +0200 +++ new/tqdm-4.19.4/tqdm/_utils.py 2017-10-15 17:04:37.000000000 +0200 @@ -93,7 +93,7 @@ items = [[k, self[k]] for k in self] inst_dict = vars(self).copy() inst_dict.pop('_keys', None) - return (self.__class__, (items,), inst_dict) + return self.__class__, (items,), inst_dict # Methods with indirect access via the above methods setdefault = MutableMapping.setdefault @@ -160,13 +160,11 @@ import struct from sys import stdin, stdout - io_handle = None + io_handle = -12 # assume stderr if fp == stdin: io_handle = -10 elif fp == stdout: io_handle = -11 - else: # assume stderr - io_handle = -12 h = windll.kernel32.GetStdHandle(io_handle) csbi = create_string_buffer(22) @@ -181,8 +179,8 @@ return None -def _environ_cols_tput(*args): # pragma: no cover - """ cygwin xterm (windows) """ +def _environ_cols_tput(*_): # pragma: no cover + """cygwin xterm (windows)""" try: import shlex cols = int(subprocess.check_call(shlex.split('tput cols'))) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tqdm-4.19.2/tqdm/_version.py new/tqdm-4.19.4/tqdm/_version.py --- old/tqdm-4.19.2/tqdm/_version.py 2017-10-09 01:18:57.000000000 +0200 +++ new/tqdm-4.19.4/tqdm/_version.py 2017-10-15 17:13:33.000000000 +0200 @@ -5,7 +5,7 @@ __all__ = ["__version__"] # major, minor, patch, -extra -version_info = 4, 19, 2 +version_info = 4, 19, 4 # Nice string for the version __version__ = '.'.join(map(str, version_info)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tqdm-4.19.2/tqdm/tests/tests_main.py new/tqdm-4.19.4/tqdm/tests/tests_main.py --- old/tqdm-4.19.2/tqdm/tests/tests_main.py 2017-10-02 02:01:47.000000000 +0200 +++ new/tqdm-4.19.4/tqdm/tests/tests_main.py 2017-10-15 17:04:37.000000000 +0200 @@ -15,7 +15,7 @@ def test_main(): """Test command line pipes""" ls_out = _sh('ls').replace('\r\n', '\n') - ls = subprocess.Popen(('ls'), stdout=subprocess.PIPE, + ls = subprocess.Popen('ls', stdout=subprocess.PIPE, stderr=subprocess.STDOUT) res = _sh(sys.executable, '-c', 'from tqdm import main; main()', stdin=ls.stdout, stderr=subprocess.STDOUT) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tqdm-4.19.2/tqdm/tests/tests_perf.py new/tqdm-4.19.4/tqdm/tests/tests_perf.py --- old/tqdm-4.19.2/tqdm/tests/tests_perf.py 2017-10-02 02:01:47.000000000 +0200 +++ new/tqdm-4.19.4/tqdm/tests/tests_perf.py 2017-10-15 17:04:37.000000000 +0200 @@ -27,7 +27,7 @@ def cpu_sleep(t): """Sleep the given amount of cpu time""" start = process_time() - while ((process_time() - start) < t): + while (process_time() - start) < t: pass @@ -45,7 +45,7 @@ cpu_sleep(sleeptime) t2 = process_time() - start2 - if (abs(t1) < 0.0001 and (t1 < t2 / 10)): + if abs(t1) < 0.0001 and (t1 < t2 / 10): return True raise SkipTest @@ -132,7 +132,7 @@ eta = (total - n[0]) / rate if rate > 0 else 0 eta_fmt = format_interval(eta) - bar = "#" * int(frac * width) + # bar = "#" * int(frac * width) barfill = " " * int((1.0 - frac) * width) bar_length, frac_bar_length = divmod(int(frac * width * 10), 10) bar = '#' * bar_length @@ -168,9 +168,10 @@ with closing(MockIO()) as our_file: a = 0 - with relative_timer() as time_tqdm: - for i in trange(total, file=our_file): - a += i + with trange(total, file=our_file) as t: + with relative_timer() as time_tqdm: + for i in t: + a += i assert (a == (total * total - total) / 2.0) a = 0 @@ -221,10 +222,11 @@ with closing(MockIO()) as our_file: a = 0 - with relative_timer() as time_tqdm: - for i in trange(total, file=our_file, leave=True, miniters=1, - mininterval=0, maxinterval=0): - a += i + with trange(total, file=our_file, leave=True, miniters=1, + mininterval=0, maxinterval=0) as t: + with relative_timer() as time_tqdm: + for i in t: + a += i assert (a == (total * total - total) / 2.0) a = 0 @@ -280,22 +282,23 @@ with closing(MockIO()) as our_file: a = 0 - with relative_timer() as time_tqdm: - for i in trange(total, file=our_file, leave=True, miniters=1, - mininterval=0, maxinterval=0): - a += i + with trange(total, file=our_file, leave=True, miniters=1, + mininterval=0, maxinterval=0) as t: + with relative_timer() as time_tqdm: + for i in t: + a += i assert (a == (total * total - total) / 2.0) a = 0 + s = simple_progress(_range(total), file=our_file, leave=True, + miniters=1, mininterval=0) with relative_timer() as time_bench: - for i in simple_progress( - _range(total), file=our_file, leave=True, miniters=1, - mininterval=0): + for i in s: a += i # Compute relative overhead of tqdm against native range() try: - assert (time_tqdm() < 2 * time_bench()) + assert (time_tqdm() < 2.5 * time_bench()) except AssertionError: raise AssertionError('trange(%g): %f, simple_progress(%g): %f' % (total, time_tqdm(), total, time_bench())) @@ -327,7 +330,7 @@ # Compute relative overhead of tqdm against native range() try: - assert (time_tqdm() < 2 * time_bench()) + assert (time_tqdm() < 2.5 * time_bench()) except AssertionError: raise AssertionError('tqdm(%g): %f, simple_progress(%g): %f' % (total, time_tqdm(), total, time_bench())) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tqdm-4.19.2/tqdm/tests/tests_tqdm.py new/tqdm-4.19.4/tqdm/tests/tests_tqdm.py --- old/tqdm-4.19.2/tqdm/tests/tests_tqdm.py 2017-10-09 01:17:47.000000000 +0200 +++ new/tqdm-4.19.4/tqdm/tests/tests_tqdm.py 2017-10-15 17:04:37.000000000 +0200 @@ -68,34 +68,34 @@ class DiscreteTimer(object): - '''Virtual discrete time manager, to precisely control time for tests''' + """Virtual discrete time manager, to precisely control time for tests""" def __init__(self): self.t = 0.0 def sleep(self, t): - '''Sleep = increment the time counter (almost no CPU used)''' + """Sleep = increment the time counter (almost no CPU used)""" self.t += t def time(self): - '''Get the current time''' + """Get the current time""" return self.t class FakeSleep(object): - '''Wait until the discrete timer reached the required time''' + """Wait until the discrete timer reached the required time""" def __init__(self, dtimer): self.dtimer = dtimer def sleep(self, t): end = t + self.dtimer.t - while (self.dtimer.t < end): + while self.dtimer.t < end: sleep(0.0000001) # sleep a bit to interrupt (instead of pass) def cpu_timify(t, timer=None): - '''Force tqdm to use the specified timer instead of system-wide time()''' + """Force tqdm to use the specified timer instead of system-wide time()""" if timer is None: timer = DiscreteTimer() t._time = timer.time @@ -126,7 +126,7 @@ class UnicodeIO(IOBase): - ''' Unicode version of StringIO ''' + """Unicode version of StringIO""" def __init__(self, *args, **kwargs): super(UnicodeIO, self).__init__(*args, **kwargs) @@ -580,6 +580,8 @@ our_file.seek(0) out = our_file.read() + assert all(i in out for i in ("0/10", "1/10", "3/10")) + assert "2/10" not in out assert t.dynamic_miniters and not t.smoothing assert t.miniters == 5 t.close() @@ -762,6 +764,7 @@ @with_setup(pretest, posttest) def test_update(): """Test manual creation and updates""" + res = None with closing(StringIO()) as our_file: with tqdm(total=2, file=our_file, miniters=1, mininterval=0) \ as progressbar: @@ -1160,7 +1163,7 @@ except TqdmDeprecationWarning as e: if 'Please use `tqdm_gui(...)` instead of `tqdm(..., gui=True)`' \ not in our_file.getvalue(): - raise + raise e else: raise DeprecationError('Should not allow manual gui=True without' ' overriding __iter__() and update()') @@ -1658,6 +1661,11 @@ @with_setup(pretest, posttest) def test_threading(): """Test multiprocess/thread-realted features""" - from multiprocessing import Lock - tqdm.set_lock(Lock()) + from multiprocessing import RLock + try: + mp_lock = RLock() + except OSError: + pass + else: + tqdm.set_lock(mp_lock) # TODO: test interleaved output #445 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tqdm-4.19.2/tqdm.egg-info/PKG-INFO new/tqdm-4.19.4/tqdm.egg-info/PKG-INFO --- old/tqdm-4.19.2/tqdm.egg-info/PKG-INFO 2017-10-09 01:33:54.000000000 +0200 +++ new/tqdm-4.19.4/tqdm.egg-info/PKG-INFO 2017-10-15 17:42:34.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: tqdm -Version: 4.19.2 +Version: 4.19.4 Summary: Fast, Extensible Progress Meter Home-page: https://github.com/tqdm/tqdm Author: tqdm developers
