Repository: googleapis/gax-python

Issue:
Remove `beta` from gRPC imports
### What:
Change imports of `grpc.beta...` to `grpc...`.

### Why:
gRPC is almost GA, and gcloud has already made this change: https://github.com/GoogleCloudPlatform/gcloud-python/pull/2149

Discussion:
codecov-io: ## [Current coverage](https://codecov.io/gh/googleapis/gax-python/pull/127?src=pr) is 97.20% (diff: 100%)
> Merging [#127](https://codecov.io/gh/googleapis/gax-python/pull/127?src=pr) into [master](https://codecov.io/gh/googleapis/gax-python/branch/master?src=pr) will increase coverage by **<.01%**


```diff
@@             master       #127   diff @@
==========================================
  Files             8          8          
  Lines           607        608     +1   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits            590        591     +1   
  Misses           17         17          
  Partials          0          0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last update [d59635e...06e8393](https://codecov.io/gh/googleapis/gax-python/compare/d59635e37d2420908a2828da8f54c0bbbd4cf4e6...06e83934e1138579078192bcd706593e6426f070?src=pr)
bjwatson: @geigerj FYI, I published a copy of this at https://testpypi.python.org/pypi/google-gax
bjwatson: LGTM. Can you update https://pypi.python.org/pypi/google-gax? Should be almost identical to `0.13.0` on https://testpypi.python.org/pypi/google-gax.
dhermes: Yay!

Patch:
diff --git a/google/gax/__init__.py b/google/gax/__init__.py
index 09c38a5..ef0116a 100644
--- a/google/gax/__init__.py
+++ b/google/gax/__init__.py
@@ -33,7 +33,7 @@ from __future__ import absolute_import
 import collections
 
 
-__version__ = '0.12.5'
+__version__ = '0.13.0'
 
 
 INITIAL_PAGE = object()
diff --git a/google/gax/grpc.py b/google/gax/grpc.py
index 4cefc35..8d43e56 100644
--- a/google/gax/grpc.py
+++ b/google/gax/grpc.py
@@ -30,8 +30,8 @@
 """Adapts the grpc surface."""
 
 from __future__ import absolute_import
-from grpc.beta import implementations
-from grpc.beta.interfaces import StatusCode
+import grpc
+from grpc import StatusCode
 from grpc.framework.interfaces.face import face
 from . import auth
 
@@ -82,8 +82,8 @@ def _make_grpc_auth_func(auth_func):
 def _make_channel_creds(auth_func, ssl_creds):
     """Converts the auth func into the composite creds expected by grpc."""
     grpc_auth_func = _make_grpc_auth_func(auth_func)
-    call_creds = implementations.metadata_call_credentials(grpc_auth_func)
-    return implementations.composite_channel_credentials(ssl_creds, call_creds)
+    call_creds = grpc.metadata_call_credentials(grpc_auth_func)
+    return grpc.composite_channel_credentials(ssl_creds, call_creds)
 
 
 def create_stub(generated_create_stub, service_path, port, ssl_creds=None,
@@ -108,15 +108,14 @@ def create_stub(generated_create_stub, service_path, port, ssl_creds=None,
     """
     if channel is None:
         if ssl_creds is None:
-            ssl_creds = implementations.ssl_channel_credentials(
-                None, None, None)
+            ssl_creds = grpc.ssl_channel_credentials()
         if metadata_transformer is None:
             if scopes is None:
                 scopes = []
             metadata_transformer = auth.make_auth_func(scopes)
 
         channel_creds = _make_channel_creds(metadata_transformer, ssl_creds)
-        channel = implementations.secure_channel(
-            service_path, port, channel_creds)
+        target = '{}:{}'.format(service_path, port)
+        channel = grpc.secure_channel(target, channel_creds)
 
     return generated_create_stub(channel)
diff --git a/setup.py b/setup.py
index b3b1a20..6ac8e92 100644
--- a/setup.py
+++ b/setup.py
@@ -50,9 +50,9 @@ with open('google/gax/__init__.py', 'r') as f:
 
 install_requires = [
     'future>=0.15.2',
-    'grpcio>=1.0rc1',
+    'grpcio>=1.0.0',
     'ply==3.8',
-    'protobuf>=3.0.0b3',
+    'protobuf>=3.0.0',
     'oauth2client>=1.5.2',
 ]
 


Test patch:
diff --git a/test-requirements.txt b/test-requirements.txt
index a7edf65..db1112c 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -3,11 +3,4 @@ pytest>=2.8.3
 pytest-cov>=1.8.1
 pytest-timeout>=1.0.0
 unittest2>=1.1.0
-
-# TODO: remove this line when grpcio goes to 1.0.0. This is only necessary
-# because pip (running in Travis CI) will not install the release candidate
-# when it gets pulled in as a dependency of grpcio-tools, below, which causes
-# build failure in Python 3 environments
-grpcio>=1.0.0rc1
-
-grpcio-tools>=1.0.0rc2
+grpcio-tools>=1.0.0
diff --git a/test/test_grpc.py b/test/test_grpc.py
index 56329d9..0a81550 100644
--- a/test/test_grpc.py
+++ b/test/test_grpc.py
@@ -46,23 +46,24 @@ class TestCreateStub(unittest2.TestCase):
     FAKE_SERVICE_PATH = 'service_path'
     FAKE_PORT = 10101
 
-    @mock.patch('grpc.beta.implementations.composite_channel_credentials')
-    @mock.patch('grpc.beta.implementations.ssl_channel_credentials')
-    @mock.patch('grpc.beta.implementations.secure_channel')
+    @mock.patch('grpc.composite_channel_credentials')
+    @mock.patch('grpc.ssl_channel_credentials')
+    @mock.patch('grpc.secure_channel')
     @mock.patch('google.gax.auth.make_auth_func')
     def test_creates_a_stub_ok_with_no_scopes(
             self, auth, chan, chan_creds, comp):
         got_channel = grpc.create_stub(
             _fake_create_stub, self.FAKE_SERVICE_PATH, self.FAKE_PORT)
-        chan_creds.assert_called_once_with(None, None, None)
-        chan.assert_called_once_with(self.FAKE_SERVICE_PATH, self.FAKE_PORT,
-                                     comp.return_value)
+        chan_creds.assert_called_once_with()
+        chan.assert_called_once_with(
+            '{}:{}'.format(self.FAKE_SERVICE_PATH, self.FAKE_PORT),
+            comp.return_value)
         auth.assert_called_once_with([])
         self.assertEqual(got_channel, chan.return_value)
 
-    @mock.patch('grpc.beta.implementations.composite_channel_credentials')
-    @mock.patch('grpc.beta.implementations.ssl_channel_credentials')
-    @mock.patch('grpc.beta.implementations.secure_channel')
+    @mock.patch('grpc.composite_channel_credentials')
+    @mock.patch('grpc.ssl_channel_credentials')
+    @mock.patch('grpc.secure_channel')
     @mock.patch('google.gax.auth.make_auth_func')
     def test_creates_a_stub_ok_with_scopes(
             self, auth, chan, chan_creds, comp):
@@ -70,15 +71,16 @@ class TestCreateStub(unittest2.TestCase):
         grpc.create_stub(
             _fake_create_stub, self.FAKE_SERVICE_PATH, self.FAKE_PORT,
             scopes=fake_scopes)
-        chan_creds.assert_called_once_with(None, None, None)
-        chan.assert_called_once_with(self.FAKE_SERVICE_PATH, self.FAKE_PORT,
-                                     comp.return_value)
+        chan_creds.assert_called_once_with()
+        chan.assert_called_once_with(
+            '{}:{}'.format(self.FAKE_SERVICE_PATH, self.FAKE_PORT),
+            comp.return_value)
         auth.assert_called_once_with(fake_scopes)
 
-    @mock.patch('grpc.beta.implementations.metadata_call_credentials')
-    @mock.patch('grpc.beta.implementations.composite_channel_credentials')
-    @mock.patch('grpc.beta.implementations.ssl_channel_credentials')
-    @mock.patch('grpc.beta.implementations.secure_channel')
+    @mock.patch('grpc.metadata_call_credentials')
+    @mock.patch('grpc.composite_channel_credentials')
+    @mock.patch('grpc.ssl_channel_credentials')
+    @mock.patch('grpc.secure_channel')
     @mock.patch('google.gax.auth.make_auth_func')
     def test_creates_a_stub_with_given_channel(
             self, auth, chan, chan_creds, comp, md):
@@ -93,10 +95,10 @@ class TestCreateStub(unittest2.TestCase):
         self.assertFalse(comp.called)
         self.assertFalse(md.called)
 
-    @mock.patch('grpc.beta.implementations.metadata_call_credentials')
-    @mock.patch('grpc.beta.implementations.composite_channel_credentials')
-    @mock.patch('grpc.beta.implementations.ssl_channel_credentials')
-    @mock.patch('grpc.beta.implementations.secure_channel')
+    @mock.patch('grpc.metadata_call_credentials')
+    @mock.patch('grpc.composite_channel_credentials')
+    @mock.patch('grpc.ssl_channel_credentials')
+    @mock.patch('grpc.secure_channel')
     @mock.patch('google.gax.auth.make_auth_func')
     def test_creates_a_stub_ok_with_given_creds(self, auth, chan, chan_creds,
                                                 comp, md):
@@ -104,8 +106,9 @@ class TestCreateStub(unittest2.TestCase):
         got_channel = grpc.create_stub(
             _fake_create_stub, self.FAKE_SERVICE_PATH, self.FAKE_PORT,
             ssl_creds=fake_creds)
-        chan.assert_called_once_with(self.FAKE_SERVICE_PATH, self.FAKE_PORT,
-                                     comp.return_value)
+        chan.assert_called_once_with(
+            '{}:{}'.format(self.FAKE_SERVICE_PATH, self.FAKE_PORT),
+            comp.return_value)
         auth.assert_called_once_with([])
         self.assertTrue(chan.called)
         self.assertFalse(chan_creds.called)
@@ -113,9 +116,9 @@ class TestCreateStub(unittest2.TestCase):
         self.assertTrue(md.called)
         self.assertEqual(got_channel, chan.return_value)
 
-    @mock.patch('grpc.beta.implementations.composite_channel_credentials')
-    @mock.patch('grpc.beta.implementations.ssl_channel_credentials')
-    @mock.patch('grpc.beta.implementations.secure_channel')
+    @mock.patch('grpc.composite_channel_credentials')
+    @mock.patch('grpc.ssl_channel_credentials')
+    @mock.patch('grpc.secure_channel')
     @mock.patch('google.gax.auth.make_auth_func')
     def test_creates_a_stub_ok_with_given_auth_func(self, auth, dummy_chan,
                                                     dummy_chan_creds, dummy_md):