diff -Nru python-plumbum-1.6.8/debian/changelog python-plumbum-1.6.9/debian/changelog --- python-plumbum-1.6.8/debian/changelog 2019-11-11 09:15:00.000000000 +0000 +++ python-plumbum-1.6.9/debian/changelog 2020-04-19 08:07:32.000000000 +0000 @@ -1,3 +1,18 @@ +python-plumbum (1.6.9-1) unstable; urgency=medium + + * New upstream version 1.6.9 + + -- Philipp Huebner Sun, 19 Apr 2020 10:07:32 +0200 + +python-plumbum (1.6.8-2) unstable; urgency=medium + + * Moved maintainership to Debian Python Modules Team + * Updated Vcs-* fields + * Fixed debian/copyright + * Updated Standards-Version: 4.5.0 (no changes needed) + + -- Philipp Huebner Fri, 28 Feb 2020 14:12:30 +0100 + python-plumbum (1.6.8-1) unstable; urgency=medium * New upstream version 1.6.8 diff -Nru python-plumbum-1.6.8/debian/control python-plumbum-1.6.9/debian/control --- python-plumbum-1.6.8/debian/control 2019-11-11 09:04:34.000000000 +0000 +++ python-plumbum-1.6.9/debian/control 2020-04-18 17:35:48.000000000 +0000 @@ -1,5 +1,6 @@ Source: python-plumbum -Maintainer: Philipp Huebner +Maintainer: Debian Python Modules Team +Uploaders: Philipp Huebner Section: python Testsuite: autopkgtest-pkg-python Priority: optional @@ -8,9 +9,9 @@ dh-python, python3-all, python3-setuptools -Standards-Version: 4.4.1 -Vcs-Browser: https://salsa.debian.org/debian/python-plumbum -Vcs-Git: https://salsa.debian.org/debian/python-plumbum.git +Standards-Version: 4.5.0 +Vcs-Browser: https://salsa.debian.org/python-team/modules/python-plumbum +Vcs-Git: https://salsa.debian.org/python-team/modules/python-plumbum.git Homepage: http://plumbum.readthedocs.org Rules-Requires-Root: no diff -Nru python-plumbum-1.6.8/debian/copyright python-plumbum-1.6.9/debian/copyright --- python-plumbum-1.6.8/debian/copyright 2019-10-21 10:31:42.000000000 +0000 +++ python-plumbum-1.6.9/debian/copyright 2020-04-18 17:35:48.000000000 +0000 @@ -4,13 +4,13 @@ Files: * Copyright: 2013-2018 Tomer Filiba -License: Expat +License: MIT Files: debian/* Copyright: 2014-2018 Philipp Huebner -License: Expat +License: MIT -License: Expat +License: MIT 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 @@ -25,6 +25,6 @@ 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 + 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. diff -Nru python-plumbum-1.6.8/PKG-INFO python-plumbum-1.6.9/PKG-INFO --- python-plumbum-1.6.8/PKG-INFO 2019-10-30 21:23:39.000000000 +0000 +++ python-plumbum-1.6.9/PKG-INFO 2020-03-23 14:17:07.000000000 +0000 @@ -1,6 +1,6 @@ -Metadata-Version: 1.1 +Metadata-Version: 1.2 Name: plumbum -Version: 1.6.8 +Version: 1.6.9 Summary: Plumbum: shell combinators library Home-page: https://plumbum.readthedocs.io Author: Tomer Filiba @@ -24,9 +24,9 @@ .. image:: https://img.shields.io/pypi/pyversions/plumbum.svg :target: https://pypi.python.org/pypi/plumbum/ :alt: PyPI Versions - .. image:: https://anaconda.org/conda-forge/plumbum/badges/version.svg - :target: https://anaconda.org/conda-forge/plumbum - :alt: Anaconda-Server Badge + .. image:: https://img.shields.io/conda/vn/conda-forge/plumbum.svg + :target: https://github.com/conda-forge/plumbum-feedstock + :alt: Conda-Forge Badge .. image:: https://img.shields.io/pypi/l/plumbum.svg :target: https://pypi.python.org/pypi/plumbum/ :alt: PyPI License @@ -218,6 +218,8 @@ Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 Classifier: Topic :: Software Development :: Build Tools Classifier: Topic :: System :: Systems Administration Provides: plumbum +Requires-Python: >=2.6,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.* diff -Nru python-plumbum-1.6.8/plumbum/commands/base.py python-plumbum-1.6.9/plumbum/commands/base.py --- python-plumbum-1.6.8/plumbum/commands/base.py 2019-10-30 21:16:49.000000000 +0000 +++ python-plumbum-1.6.9/plumbum/commands/base.py 2020-03-23 14:14:44.000000000 +0000 @@ -143,7 +143,6 @@ raise NotImplementedError() def nohup(self, - command, cwd='.', stdout='nohup.out', stderr=None, diff -Nru python-plumbum-1.6.8/plumbum/commands/modifiers.py python-plumbum-1.6.9/plumbum/commands/modifiers.py --- python-plumbum-1.6.8/plumbum/commands/modifiers.py 2019-10-30 21:16:49.000000000 +0000 +++ python-plumbum-1.6.9/plumbum/commands/modifiers.py 2020-03-23 14:14:44.000000000 +0000 @@ -374,7 +374,7 @@ else: stdout = self.stdout append = self.append - return cmd.nohup(cmd, self.cwd, stdout, self.stderr, append) + return cmd.nohup(self.cwd, stdout, self.stderr, append) NOHUP = _NOHUP() diff -Nru python-plumbum-1.6.8/plumbum/commands/processes.py python-plumbum-1.6.9/plumbum/commands/processes.py --- python-plumbum-1.6.8/plumbum/commands/processes.py 2019-10-30 21:16:49.000000000 +0000 +++ python-plumbum-1.6.9/plumbum/commands/processes.py 2020-03-23 14:14:44.000000000 +0000 @@ -1,7 +1,6 @@ import time import atexit import heapq -from subprocess import Popen from threading import Thread from plumbum.lib import IS_WIN32, six @@ -24,7 +23,7 @@ return proc.returncode, stdout, stderr -def _iter_lines(proc, decode, linesize, line_timeout=None): +def _iter_lines_posix(proc, decode, linesize, line_timeout=None): try: from selectors import DefaultSelector, EVENT_READ except ImportError: @@ -62,6 +61,62 @@ yield 1, decode(line) +def _iter_lines_win32(proc, decode, linesize, line_timeout=None): + + class Piper(Thread): + + def __init__(self, fd, pipe): + super().__init__(name="PlumbumPiper%sThread" % fd) + self.pipe = pipe + self.fd = fd + self.empty = False + self.daemon = True + super().start() + + def read_from_pipe(self): + return self.pipe.readline(linesize) + + def run(self): + for line in iter(self.read_from_pipe, b''): + queue.put((self.fd, decode(line))) + # self.pipe.close() + + if line_timeout is None: + line_timeout = float("inf") + queue = Queue() + pipers = [Piper(0, proc.stdout), Piper(1, proc.stderr)] + last_line_ts = time.time() + empty = True + while True: + try: + yield queue.get_nowait() + last_line_ts = time.time() + empty = False + except QueueEmpty: + empty = True + if time.time() - last_line_ts > line_timeout: + raise ProcessLineTimedOut("popen line timeout expired", getattr(proc, "argv", None), getattr(proc, "machine", None)) + if proc.poll() is not None: + break + if empty: + time.sleep(0.1) + + for piper in pipers: + piper.join() + + while True: + try: + yield queue.get_nowait() + except QueueEmpty: + break + + +if IS_WIN32: + _iter_lines = _iter_lines_win32 +else: + _iter_lines = _iter_lines_posix + + #=================================================================================================== # Exceptions #=================================================================================================== diff -Nru python-plumbum-1.6.8/plumbum/machines/local.py python-plumbum-1.6.9/plumbum/machines/local.py --- python-plumbum-1.6.8/plumbum/machines/local.py 2019-05-15 20:08:05.000000000 +0000 +++ python-plumbum-1.6.9/plumbum/machines/local.py 2020-03-23 14:14:44.000000000 +0000 @@ -42,6 +42,12 @@ def __iter__(self): return self.iter_lines() + def __enter__(self): + return self._proc.__enter__() + + def __exit__(self, *args, **kwargs): + return self._proc.__exit__(*args, **kwargs) + def __getattr__(self, name): return getattr(self._proc, name) diff -Nru python-plumbum-1.6.8/plumbum/path/base.py python-plumbum-1.6.9/plumbum/path/base.py --- python-plumbum-1.6.8/plumbum/path/base.py 2019-10-30 21:16:49.000000000 +0000 +++ python-plumbum-1.6.9/plumbum/path/base.py 2020-03-23 14:14:44.000000000 +0000 @@ -38,7 +38,11 @@ return self.join(other) __truediv__ = __div__ - __getitem__ = __div__ + + def __getitem__(self, key): + if type(key) == str or isinstance(key, Path): + return self / key + return str(self)[key] def __floordiv__(self, expr): """Returns a (possibly empty) list of paths that matched the glob-pattern under this path""" @@ -414,7 +418,7 @@ results.extend(fn(single_pattern)) return sorted(list(set(results))) - def resolve(strict=False): + def resolve(self, strict=False): """Added to allow pathlib like syntax. Does nothing since Plumbum paths are always absolute. Does not (currently) resolve symlinks.""" diff -Nru python-plumbum-1.6.8/plumbum/path/local.py python-plumbum-1.6.9/plumbum/path/local.py --- python-plumbum-1.6.8/plumbum/path/local.py 2019-10-30 21:16:49.000000000 +0000 +++ python-plumbum-1.6.9/plumbum/path/local.py 2020-03-23 14:14:44.000000000 +0000 @@ -58,6 +58,9 @@ cls, os.path.normpath(os.path.join(*(str(p) for p in parts)))) return self + def __fspath__(self): + return self._path() + @property def _path(self): return str(self) diff -Nru python-plumbum-1.6.8/plumbum/path/remote.py python-plumbum-1.6.9/plumbum/path/remote.py --- python-plumbum-1.6.8/plumbum/path/remote.py 2019-10-30 21:16:49.000000000 +0000 +++ python-plumbum-1.6.9/plumbum/path/remote.py 2020-03-23 14:14:44.000000000 +0000 @@ -3,6 +3,7 @@ from plumbum.path.base import Path, FSUser from plumbum.lib import _setdoc, six from plumbum.commands import shquote, ProcessExecutionError +import os import sys try: # Py3 @@ -170,7 +171,7 @@ def stat(self): res = self.remote._path_stat(self) if res is None: - raise OSError(errno.ENOENT) + raise OSError(errno.ENOENT, os.strerror(errno.ENOENT), '') return res @_setdoc(Path) diff -Nru python-plumbum-1.6.8/plumbum/typed_env.py python-plumbum-1.6.9/plumbum/typed_env.py --- python-plumbum-1.6.8/plumbum/typed_env.py 2019-10-30 21:16:49.000000000 +0000 +++ python-plumbum-1.6.9/plumbum/typed_env.py 2020-03-23 14:14:44.000000000 +0000 @@ -6,6 +6,11 @@ NO_DEFAULT = object() +# must not inherit from AttributeError, so not to mess with python's attribute-lookup flow +class EnvironmentVariableError(KeyError): + pass + + class TypedEnv(MutableMapping): """ This object can be used in 'exploratory' mode: @@ -29,7 +34,7 @@ try: print(p.tmp) - except KeyError: + except EnvironmentVariableError: print("TMP/TEMP is not defined") else: assert False @@ -52,7 +57,7 @@ return self try: return self.convert(instance._raw_get(*self.names)) - except KeyError: + except EnvironmentVariableError: if self.default is NO_DEFAULT: raise return self.default @@ -64,6 +69,10 @@ pass class Bool(_BaseVar): + """ + Converts 'yes|true|1|no|false|0' to the appropriate boolean value. + Case-insensitive. Throws a ``ValueError`` for any other value. + """ def convert(self, s): s = s.lower() @@ -81,6 +90,10 @@ convert = staticmethod(float) class CSV(_BaseVar): + """ + Comma-separated-strings get split using the ``separator`` (',' by default) into + a list of objects of type ``type`` (``str`` by default). + """ def __init__(self, name, default=NO_DEFAULT, type=str, separator=","): super(TypedEnv.CSV, self).__init__(name, default=default) @@ -117,12 +130,12 @@ if value is not NO_DEFAULT: return value else: - raise KeyError(key_names[0]) + raise EnvironmentVariableError(key_names[0]) def __contains__(self, key): try: self._raw_get(key) - except KeyError: + except EnvironmentVariableError: return False else: return True @@ -131,7 +144,7 @@ # if we're here then there was no descriptor defined try: return self._raw_get(name) - except KeyError: + except EnvironmentVariableError: raise AttributeError("%s has no attribute %r" % (self.__class__, name)) def __getitem__(self, key): @@ -140,7 +153,7 @@ def get(self, key, default=None): try: return self[key] - except KeyError: + except EnvironmentVariableError: return default def __dir__(self): diff -Nru python-plumbum-1.6.8/plumbum/version.py python-plumbum-1.6.9/plumbum/version.py --- python-plumbum-1.6.8/plumbum/version.py 2019-10-30 21:20:48.000000000 +0000 +++ python-plumbum-1.6.9/plumbum/version.py 2020-03-23 14:14:44.000000000 +0000 @@ -1,3 +1,3 @@ -version = (1, 6, 8) +version = (1, 6, 9) version_string = ".".join(map(str, version)) -release_date = "2019.10.30" +release_date = "2020.03.23" diff -Nru python-plumbum-1.6.8/plumbum.egg-info/PKG-INFO python-plumbum-1.6.9/plumbum.egg-info/PKG-INFO --- python-plumbum-1.6.8/plumbum.egg-info/PKG-INFO 2019-10-30 21:23:39.000000000 +0000 +++ python-plumbum-1.6.9/plumbum.egg-info/PKG-INFO 2020-03-23 14:17:07.000000000 +0000 @@ -1,6 +1,6 @@ -Metadata-Version: 1.1 +Metadata-Version: 1.2 Name: plumbum -Version: 1.6.8 +Version: 1.6.9 Summary: Plumbum: shell combinators library Home-page: https://plumbum.readthedocs.io Author: Tomer Filiba @@ -24,9 +24,9 @@ .. image:: https://img.shields.io/pypi/pyversions/plumbum.svg :target: https://pypi.python.org/pypi/plumbum/ :alt: PyPI Versions - .. image:: https://anaconda.org/conda-forge/plumbum/badges/version.svg - :target: https://anaconda.org/conda-forge/plumbum - :alt: Anaconda-Server Badge + .. image:: https://img.shields.io/conda/vn/conda-forge/plumbum.svg + :target: https://github.com/conda-forge/plumbum-feedstock + :alt: Conda-Forge Badge .. image:: https://img.shields.io/pypi/l/plumbum.svg :target: https://pypi.python.org/pypi/plumbum/ :alt: PyPI License @@ -218,6 +218,8 @@ Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 Classifier: Topic :: Software Development :: Build Tools Classifier: Topic :: System :: Systems Administration Provides: plumbum +Requires-Python: >=2.6,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.* diff -Nru python-plumbum-1.6.8/README.rst python-plumbum-1.6.9/README.rst --- python-plumbum-1.6.8/README.rst 2019-10-30 21:16:49.000000000 +0000 +++ python-plumbum-1.6.9/README.rst 2020-03-23 14:14:44.000000000 +0000 @@ -16,9 +16,9 @@ .. image:: https://img.shields.io/pypi/pyversions/plumbum.svg :target: https://pypi.python.org/pypi/plumbum/ :alt: PyPI Versions -.. image:: https://anaconda.org/conda-forge/plumbum/badges/version.svg - :target: https://anaconda.org/conda-forge/plumbum - :alt: Anaconda-Server Badge +.. image:: https://img.shields.io/conda/vn/conda-forge/plumbum.svg + :target: https://github.com/conda-forge/plumbum-feedstock + :alt: Conda-Forge Badge .. image:: https://img.shields.io/pypi/l/plumbum.svg :target: https://pypi.python.org/pypi/plumbum/ :alt: PyPI License diff -Nru python-plumbum-1.6.8/setup.py python-plumbum-1.6.9/setup.py --- python-plumbum-1.6.8/setup.py 2019-05-15 20:08:05.000000000 +0000 +++ python-plumbum-1.6.9/setup.py 2020-03-23 14:14:44.000000000 +0000 @@ -80,8 +80,10 @@ "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", "Topic :: Software Development :: Build Tools", "Topic :: System :: Systems Administration", ], + python_requires='>=2.6,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*', )