From 8c8086413f93e64296be52a358c8995c9b7c8a8e Mon Sep 17 00:00:00 2001 From: Aleksei Stepanov Date: Tue, 12 Nov 2019 15:24:38 +0100 Subject: [PATCH] Move forward: remove deprecated code to unblock low level API changes Signed-off-by: Aleksei Stepanov --- exec_helpers/api.py | 47 --------------------------------------------- requirements.txt | 1 - tox.ini | 2 +- 3 files changed, 1 insertion(+), 49 deletions(-) diff --git a/exec_helpers/api.py b/exec_helpers/api.py index ff8c19b..11db1d2 100644 --- a/exec_helpers/api.py +++ b/exec_helpers/api.py @@ -30,7 +30,6 @@ import shlex import threading import typing -import warnings # Exec-Helpers Implementation from exec_helpers import constants @@ -240,52 +239,6 @@ def _prepare_command(self, cmd: str, chroot_path: typing.Optional[str] = None) - return f'chroot {target_path} sh -c {shlex.quote(f"eval {quoted_command}")}' return cmd - # noinspection PyIncorrectDocstring - def execute_async( # pylint: disable=missing-param-doc,differing-param-doc,differing-type-doc - self, *args: typing.Any, **kwargs: typing.Any - ) -> ExecuteAsyncResult: - """Execute command in async mode and return remote interface with IO objects. - - :param command: Command for execution - :type command: str - :param stdin: pass STDIN text to the process - :type stdin: typing.Union[bytes, str, bytearray, None] - :param open_stdout: open STDOUT stream for read - :type open_stdout: bool - :param open_stderr: open STDERR stream for read - :type open_stderr: bool - :param verbose: produce verbose log record on command call - :type verbose: bool - :param log_mask_re: regex lookup rule to mask command for logger. - all MATCHED groups will be replaced by '<*masked*>' - :type log_mask_re: typing.Optional[str] - :param chroot_path: chroot path override - :type chroot_path: typing.Optional[str] - :param kwargs: additional parameters for call. - :type kwargs: typing.Any - :return: NamedTuple with control interface and file-like objects for STDIN/STDERR/STDOUT - :rtype: typing.NamedTuple( - 'ExecuteAsyncResult', - [ - ('interface', typing.Any), - ('stdin', typing.Optional[typing.Any]), - ('stderr', typing.Optional[typing.Any]), - ('stdout', typing.Optional[typing.Any]), - ("started", datetime.datetime), - ] - ) - - .. versionchanged:: 1.2.0 open_stdout and open_stderr flags - .. versionchanged:: 1.2.0 stdin data - .. versionchanged:: 2.1.0 Use typed NamedTuple as result - .. versionchanged:: 4.1.0 support chroot - """ - warnings.warn( - "execute_async public usage is deprecated and will be disallowed at the next major release.", - DeprecationWarning, - ) - return self._execute_async(*args, **kwargs) - @abc.abstractmethod def _execute_async( self, diff --git a/requirements.txt b/requirements.txt index feacecc..1883967 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,5 @@ paramiko>=2.4 # LGPLv2.1+ tenacity>=4.4.0 # Apache-2.0 -six>=1.10.0 # MIT threaded>=2.0 # Apache-2.0 typing >= 3.6 ; python_version < "3.7" # PSF psutil >= 5.0 # BSD diff --git a/tox.ini b/tox.ini index 178e729..c7dea1d 100644 --- a/tox.ini +++ b/tox.ini @@ -5,7 +5,7 @@ [tox] minversion = 2.0 -envlist = black, pep8, pylint, mypy, bandit, pep257, py{36,37}, doc8, docs, py{36,37}-nocov +envlist = black, pep8, pylint, mypy, bandit, pep257, py{36,37,38}, doc8, docs, py{36,37,38}-nocov skipsdist = True skip_missing_interpreters = True