mirror of https://github.com/docker/compose.git
Merge pull request #2822 from aanand/update-docker-py-and-dockerpty
Update docker-py and dockerpty
This commit is contained in:
commit
c2db1a24bf
|
@ -42,7 +42,7 @@ from .utils import yesno
|
||||||
|
|
||||||
|
|
||||||
if not IS_WINDOWS_PLATFORM:
|
if not IS_WINDOWS_PLATFORM:
|
||||||
from dockerpty.pty import PseudoTerminal
|
from dockerpty.pty import PseudoTerminal, RunOperation
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
console_handler = logging.StreamHandler(sys.stderr)
|
console_handler = logging.StreamHandler(sys.stderr)
|
||||||
|
@ -712,12 +712,13 @@ def run_one_off_container(container_options, project, service, options):
|
||||||
signals.set_signal_handler_to_shutdown()
|
signals.set_signal_handler_to_shutdown()
|
||||||
try:
|
try:
|
||||||
try:
|
try:
|
||||||
pty = PseudoTerminal(
|
operation = RunOperation(
|
||||||
project.client,
|
project.client,
|
||||||
container.id,
|
container.id,
|
||||||
interactive=not options['-T'],
|
interactive=not options['-T'],
|
||||||
logs=False,
|
logs=False,
|
||||||
)
|
)
|
||||||
|
pty = PseudoTerminal(project.client, operation)
|
||||||
sockets = pty.sockets()
|
sockets = pty.sockets()
|
||||||
service.start_container(container)
|
service.start_container(container)
|
||||||
pty.start(sockets)
|
pty.start(sockets)
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
PyYAML==3.11
|
PyYAML==3.11
|
||||||
cached-property==1.2.0
|
cached-property==1.2.0
|
||||||
docker-py==1.7.0rc3
|
docker-py==1.7.0
|
||||||
|
dockerpty==0.4.1
|
||||||
docopt==0.6.1
|
docopt==0.6.1
|
||||||
enum34==1.0.4
|
enum34==1.0.4
|
||||||
git+https://github.com/d11wtq/dockerpty.git@29b1394108b017ef3e3deaf00604a9eb99880d5e#egg=dockerpty
|
|
||||||
jsonschema==2.5.1
|
jsonschema==2.5.1
|
||||||
requests==2.7.0
|
requests==2.7.0
|
||||||
six==1.7.3
|
six==1.7.3
|
||||||
|
|
4
setup.py
4
setup.py
|
@ -34,8 +34,8 @@ install_requires = [
|
||||||
'requests >= 2.6.1, < 2.8',
|
'requests >= 2.6.1, < 2.8',
|
||||||
'texttable >= 0.8.1, < 0.9',
|
'texttable >= 0.8.1, < 0.9',
|
||||||
'websocket-client >= 0.32.0, < 1.0',
|
'websocket-client >= 0.32.0, < 1.0',
|
||||||
'docker-py >= 1.5.0, < 2',
|
'docker-py >= 1.7.0, < 2',
|
||||||
'dockerpty >= 0.3.4, < 0.4',
|
'dockerpty >= 0.4.1, < 0.5',
|
||||||
'six >= 1.3.0, < 2',
|
'six >= 1.3.0, < 2',
|
||||||
'jsonschema >= 2.5.1, < 3',
|
'jsonschema >= 2.5.1, < 3',
|
||||||
]
|
]
|
||||||
|
|
|
@ -79,8 +79,9 @@ class CLITestCase(unittest.TestCase):
|
||||||
TopLevelCommand().dispatch(['help', 'nonexistent'], None)
|
TopLevelCommand().dispatch(['help', 'nonexistent'], None)
|
||||||
|
|
||||||
@pytest.mark.xfail(IS_WINDOWS_PLATFORM, reason="requires dockerpty")
|
@pytest.mark.xfail(IS_WINDOWS_PLATFORM, reason="requires dockerpty")
|
||||||
|
@mock.patch('compose.cli.main.RunOperation', autospec=True)
|
||||||
@mock.patch('compose.cli.main.PseudoTerminal', autospec=True)
|
@mock.patch('compose.cli.main.PseudoTerminal', autospec=True)
|
||||||
def test_run_interactive_passes_logs_false(self, mock_pseudo_terminal):
|
def test_run_interactive_passes_logs_false(self, mock_pseudo_terminal, mock_run_operation):
|
||||||
command = TopLevelCommand()
|
command = TopLevelCommand()
|
||||||
mock_client = mock.create_autospec(docker.Client)
|
mock_client = mock.create_autospec(docker.Client)
|
||||||
mock_project = mock.Mock(client=mock_client)
|
mock_project = mock.Mock(client=mock_client)
|
||||||
|
@ -106,7 +107,7 @@ class CLITestCase(unittest.TestCase):
|
||||||
'--name': None,
|
'--name': None,
|
||||||
})
|
})
|
||||||
|
|
||||||
_, _, call_kwargs = mock_pseudo_terminal.mock_calls[0]
|
_, _, call_kwargs = mock_run_operation.mock_calls[0]
|
||||||
assert call_kwargs['logs'] is False
|
assert call_kwargs['logs'] is False
|
||||||
|
|
||||||
@pytest.mark.xfail(IS_WINDOWS_PLATFORM, reason="requires dockerpty")
|
@pytest.mark.xfail(IS_WINDOWS_PLATFORM, reason="requires dockerpty")
|
||||||
|
|
Loading…
Reference in New Issue