Browse Source

Update docker-py and dockerpty

Signed-off-by: Aanand Prasad <[email protected]>
Aanand Prasad 9 years ago
parent
commit
be236d8801
4 changed files with 10 additions and 8 deletions
  1. 3 2
      compose/cli/main.py
  2. 2 2
      requirements.txt
  3. 2 2
      setup.py
  4. 3 2
      tests/unit/cli_test.py

+ 3 - 2
compose/cli/main.py

@@ -42,7 +42,7 @@ from .utils import yesno
 
 
 if not IS_WINDOWS_PLATFORM:
-    from dockerpty.pty import PseudoTerminal
+    from dockerpty.pty import PseudoTerminal, RunOperation
 
 log = logging.getLogger(__name__)
 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()
     try:
         try:
-            pty = PseudoTerminal(
+            operation = RunOperation(
                 project.client,
                 container.id,
                 interactive=not options['-T'],
                 logs=False,
             )
+            pty = PseudoTerminal(project.client, operation)
             sockets = pty.sockets()
             service.start_container(container)
             pty.start(sockets)

+ 2 - 2
requirements.txt

@@ -1,9 +1,9 @@
 PyYAML==3.11
 cached-property==1.2.0
-docker-py==1.7.0rc3
+docker-py==1.7.0
+dockerpty==0.4.1
 docopt==0.6.1
 enum34==1.0.4
-git+https://github.com/d11wtq/dockerpty.git@29b1394108b017ef3e3deaf00604a9eb99880d5e#egg=dockerpty
 jsonschema==2.5.1
 requests==2.7.0
 six==1.7.3

+ 2 - 2
setup.py

@@ -34,8 +34,8 @@ install_requires = [
     'requests >= 2.6.1, < 2.8',
     'texttable >= 0.8.1, < 0.9',
     'websocket-client >= 0.32.0, < 1.0',
-    'docker-py >= 1.5.0, < 2',
-    'dockerpty >= 0.3.4, < 0.4',
+    'docker-py >= 1.7.0, < 2',
+    'dockerpty >= 0.4.1, < 0.5',
     'six >= 1.3.0, < 2',
     'jsonschema >= 2.5.1, < 3',
 ]

+ 3 - 2
tests/unit/cli_test.py

@@ -79,8 +79,9 @@ class CLITestCase(unittest.TestCase):
             TopLevelCommand().dispatch(['help', 'nonexistent'], None)
 
     @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)
-    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()
         mock_client = mock.create_autospec(docker.Client)
         mock_project = mock.Mock(client=mock_client)
@@ -106,7 +107,7 @@ class CLITestCase(unittest.TestCase):
                 '--name': None,
             })
 
-        _, _, call_kwargs = mock_pseudo_terminal.mock_calls[0]
+        _, _, call_kwargs = mock_run_operation.mock_calls[0]
         assert call_kwargs['logs'] is False
 
     @pytest.mark.xfail(IS_WINDOWS_PLATFORM, reason="requires dockerpty")