Skip to content

Commit

Permalink
Move forward: remove deprecated code to unblock low level API changes
Browse files Browse the repository at this point in the history
Signed-off-by: Aleksei Stepanov <penguinolog@gmail.com>
  • Loading branch information
penguinolog committed Nov 12, 2019
1 parent 6b788fe commit 8c80864
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 49 deletions.
47 changes: 0 additions & 47 deletions exec_helpers/api.py
Expand Up @@ -30,7 +30,6 @@
import shlex
import threading
import typing
import warnings

# Exec-Helpers Implementation
from exec_helpers import constants
Expand Down Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion 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
2 changes: 1 addition & 1 deletion tox.ini
Expand Up @@ -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

Expand Down

0 comments on commit 8c80864

Please sign in to comment.